1
0
Fork 0
mirror of https://github.com/gwm17/Mask.git synced 2024-11-26 12:08:52 -05:00

Updated MaskFile data sizes to be more explict across platforms (where possible)

This commit is contained in:
Gordon McCann 2021-10-08 14:37:26 -04:00
parent d50a48190e
commit e24b949e48
3 changed files with 26 additions and 26 deletions

View File

@ -33,7 +33,7 @@ namespace Mask {
std::string m_outfile_name; std::string m_outfile_name;
RxnType m_rxn_type; RxnType m_rxn_type;
uint64_t m_nsamples; uint32_t m_nsamples;
}; };

View File

@ -49,26 +49,26 @@ namespace Mask {
FileType file_type; FileType file_type;
std::string filename; std::string filename;
unsigned int buffer_position; uint32_t buffer_position;
unsigned int buffer_end; uint32_t buffer_end;
unsigned int data_size; uint32_t data_size;
RxnType m_rxn_type; RxnType m_rxn_type;
int buffersize_bytes; uint32_t buffersize_bytes;
std::fstream file; std::fstream file;
std::vector<char> data_buffer; std::vector<char> data_buffer;
static constexpr int onestep_rxn_n = 2; static constexpr uint32_t onestep_rxn_n = 2;
static constexpr int twostep_rxn_n = 4; static constexpr uint32_t twostep_rxn_n = 4;
static constexpr int threestep_rxn_n = 6; static constexpr uint32_t threestep_rxn_n = 6;
static constexpr int buffersize = 10000; //number of events static constexpr uint64_t buffersize = 10000; //number of events
static constexpr int width = 0; static constexpr int width = 0;
static constexpr int precision = 3; static constexpr int precision = 3;
static constexpr std::size_t double_size = sizeof(double); static constexpr std::size_t double_size = sizeof(double);
static constexpr std::size_t int_size = sizeof(int); static constexpr std::size_t int_size = sizeof(uint32_t);
static constexpr std::size_t bool_size = sizeof(bool); static constexpr std::size_t bool_size = sizeof(bool);
}; };

View File

@ -226,11 +226,11 @@ namespace Mask {
//For progress tracking //For progress tracking
uint64_t percent5 = 0.05*m_nsamples; uint32_t percent5 = 0.05*m_nsamples;
uint64_t count = 0; uint32_t count = 0;
uint64_t npercent = 0; uint32_t npercent = 0;
for(uint64_t i=0; i<m_nsamples; i++) for(uint32_t i=0; i<m_nsamples; i++)
{ {
if(++count == percent5) if(++count == percent5)
{//Show update every 5 percent {//Show update every 5 percent
@ -264,11 +264,11 @@ namespace Mask {
output.WriteHeader(m_rxn_type, m_nsamples); output.WriteHeader(m_rxn_type, m_nsamples);
//For progress tracking //For progress tracking
uint64_t percent5 = 0.05*m_nsamples; uint32_t percent5 = 0.05*m_nsamples;
uint64_t count = 0; uint32_t count = 0;
uint64_t npercent = 0; uint32_t npercent = 0;
for(uint64_t i=0; i<m_nsamples; i++) for(uint32_t i=0; i<m_nsamples; i++)
{ {
if(++count == percent5) if(++count == percent5)
{ {
@ -301,11 +301,11 @@ namespace Mask {
output.WriteHeader(m_rxn_type, m_nsamples); output.WriteHeader(m_rxn_type, m_nsamples);
//For progress tracking //For progress tracking
uint64_t percent5 = 0.05*m_nsamples; uint32_t percent5 = 0.05*m_nsamples;
uint64_t count = 0; uint32_t count = 0;
uint64_t npercent = 0; uint32_t npercent = 0;
for(uint64_t i=0; i<m_nsamples; i++) for(uint32_t i=0; i<m_nsamples; i++)
{ {
if(++count == percent5) if(++count == percent5)
{ {
@ -341,11 +341,11 @@ namespace Mask {
output.WriteHeader(m_rxn_type, m_nsamples); output.WriteHeader(m_rxn_type, m_nsamples);
//For progress updating //For progress updating
uint64_t percent5 = 0.05*m_nsamples; uint32_t percent5 = 0.05*m_nsamples;
uint64_t count = 0; uint32_t count = 0;
uint64_t npercent = 0; uint32_t npercent = 0;
for(uint64_t i=0; i<m_nsamples; i++) for(uint32_t i=0; i<m_nsamples; i++)
{ {
if(++count == percent5) if(++count == percent5)
{ {