merge fix

This commit is contained in:
maliakal_d 2022-03-31 15:09:58 +02:00
commit c2ef6d700e
10 changed files with 57 additions and 69 deletions

View File

@ -58,6 +58,7 @@ This document describes the differences between v7.0.0 and v6.x.x
- fpga/kernel programming, checks if drive is a special file and not a normal file - fpga/kernel programming, checks if drive is a special file and not a normal file
- gotthard 25 um image reconstructed in gui and virtual hdf5 (firmware updated for slave to reverse channels) - gotthard 25 um image reconstructed in gui and virtual hdf5 (firmware updated for slave to reverse channels)
- master binary file in json format now - master binary file in json format now
- fixed bug introduced in 6.0.0: hdf5 files created 1 file per frame after the initial file which had maxframesperfile
2. Resolved Issues 2. Resolved Issues
================== ==================

View File

@ -72,7 +72,7 @@ void BinaryDataFile::WriteToFile(char *buffer, const int buffersize,
++subFileIndex_; ++subFileIndex_;
CreateFile(); CreateFile();
} }
numFramesInFile_++; ++numFramesInFile_;
// write to file // write to file
int ret = 0; int ret = 0;

View File

@ -111,7 +111,7 @@ void DataProcessor::SetupFileWriter(const bool filewriteEnable,
} }
void DataProcessor::CreateFirstFiles( void DataProcessor::CreateFirstFiles(
const std::string filePath, const std::string fileNamePrefix, const std::string &filePath, const std::string &fileNamePrefix,
const uint64_t fileIndex, const bool overWriteEnable, const bool silentMode, const uint64_t fileIndex, const bool overWriteEnable, const bool silentMode,
const int modulePos, const int numUnitsPerReadout, const int modulePos, const int numUnitsPerReadout,
const uint32_t udpPortNumber, const uint32_t maxFramesPerFile, const uint32_t udpPortNumber, const uint32_t maxFramesPerFile,

View File

@ -48,8 +48,8 @@ class DataProcessor : private virtual slsDetectorDefs, public ThreadObject {
const fileFormat fileFormatType, const fileFormat fileFormatType,
std::mutex *hdf5LibMutex); std::mutex *hdf5LibMutex);
void CreateFirstFiles(const std::string filePath, void CreateFirstFiles(const std::string &filePath,
const std::string fileNamePrefix, const std::string &fileNamePrefix,
const uint64_t fileIndex, const bool overWriteEnable, const uint64_t fileIndex, const bool overWriteEnable,
const bool silentMode, const int modulePos, const bool silentMode, const int modulePos,
const int numUnitsPerReadout, const int numUnitsPerReadout,

View File

@ -84,10 +84,7 @@ class File : private virtual slsDetectorDefs {
virtual void WriteToFile(char *buffer, const int buffersize, virtual void WriteToFile(char *buffer, const int buffersize,
const uint64_t currentFrameNumber, const uint64_t currentFrameNumber,
const uint32_t numPacketsCaught) { const uint32_t numPacketsCaught) = 0;
LOG(logERROR) << "This is a generic function WriteToFile that "
"should be overloaded by a derived class";
};
protected: protected:
slsDetectorDefs::fileFormat format_; slsDetectorDefs::fileFormat format_;

View File

@ -128,7 +128,7 @@ void HDF5DataFile::CreateFirstHDF5DataFile(
} }
void HDF5DataFile::CreateFile() { void HDF5DataFile::CreateFile() {
numFramesInFile_ = 0;
numFilesInAcquisition_++; numFilesInAcquisition_++;
std::ostringstream os; std::ostringstream os;
@ -237,7 +237,7 @@ void HDF5DataFile::WriteToFile(char *buffer, const int buffersize,
++subFileIndex_; ++subFileIndex_;
CreateFile(); CreateFile();
} }
numFramesInFile_++; ++numFramesInFile_;
// extend dataset (when receiver start followed by many status starts // extend dataset (when receiver start followed by many status starts
// (jungfrau))) // (jungfrau)))

View File

@ -3,7 +3,7 @@
#include "MasterAttributes.h" #include "MasterAttributes.h"
void MasterAttributes::GetBinaryAttributes( void MasterAttributes::GetBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->StartObject(); w->StartObject();
GetCommonBinaryAttributes(w); GetCommonBinaryAttributes(w);
switch (detType) { switch (detType) {
@ -70,13 +70,15 @@ void MasterAttributes::WriteHDF5Attributes(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetCommonBinaryAttributes( void MasterAttributes::GetCommonBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Version"); w->Key("Version");
w->SetMaxDecimalPlaces(2); w->SetMaxDecimalPlaces(2);
w->Double(BINARY_WRITER_VERSION); w->Double(BINARY_WRITER_VERSION);
w->Key("Timestamp"); w->Key("Timestamp");
time_t t = time(nullptr); time_t t = time(nullptr);
w->String(ctime(&t)); std::string sTime(ctime(&t));
std::replace(sTime.begin(), sTime.end(), '\n', '\0');
w->String(sTime.c_str());
w->Key("Detector Type"); w->Key("Detector Type");
w->String(sls::ToString(detType).c_str()); w->String(sls::ToString(detType).c_str());
w->Key("Timing Mode"); w->Key("Timing Mode");
@ -110,7 +112,7 @@ void MasterAttributes::GetCommonBinaryAttributes(
} }
void MasterAttributes::GetFinalBinaryAttributes( void MasterAttributes::GetFinalBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
// adding few common parameters to the end // adding few common parameters to the end
if (!additionalJsonHeader.empty()) { if (!additionalJsonHeader.empty()) {
w->Key("Additional Json Header"); w->Key("Additional Json Header");
@ -153,8 +155,7 @@ void MasterAttributes::GetFinalBinaryAttributes(
#ifdef HDF5C #ifdef HDF5C
void MasterAttributes::WriteCommonHDF5Attributes(H5File *fd, Group *group) { void MasterAttributes::WriteCommonHDF5Attributes(H5File *fd, Group *group) {
char c[1024]; char c[1024]{};
memset(c, 0, sizeof(c));
// version // version
{ {
double version = BINARY_WRITER_VERSION; double version = BINARY_WRITER_VERSION;
@ -276,8 +277,7 @@ void MasterAttributes::WriteCommonHDF5Attributes(H5File *fd, Group *group) {
} }
void MasterAttributes::WriteFinalHDF5Attributes(H5File *fd, Group *group) { void MasterAttributes::WriteFinalHDF5Attributes(H5File *fd, Group *group) {
char c[1024]; char c[1024]{};
memset(c, 0, sizeof(c));
// Total Frames in file // Total Frames in file
{ {
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
@ -302,8 +302,7 @@ void MasterAttributes::WriteHDF5Exptime(H5File *fd, Group *group) {
StrType strdatatype(PredType::C_S1, 256); StrType strdatatype(PredType::C_S1, 256);
DataSet dataset = DataSet dataset =
group->createDataSet("Exposure Time", strdatatype, dataspace); group->createDataSet("Exposure Time", strdatatype, dataspace);
char c[1024]; char c[1024]{};
memset(c, 0, sizeof(c));
sls::strcpy_safe(c, sls::ToString(exptime)); sls::strcpy_safe(c, sls::ToString(exptime));
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
@ -313,8 +312,7 @@ void MasterAttributes::WriteHDF5Period(H5File *fd, Group *group) {
StrType strdatatype(PredType::C_S1, 256); StrType strdatatype(PredType::C_S1, 256);
DataSet dataset = DataSet dataset =
group->createDataSet("Acquisition Period", strdatatype, dataspace); group->createDataSet("Acquisition Period", strdatatype, dataspace);
char c[1024]; char c[1024]{};
memset(c, 0, sizeof(c));
sls::strcpy_safe(c, sls::ToString(period)); sls::strcpy_safe(c, sls::ToString(period));
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
@ -371,7 +369,7 @@ void MasterAttributes::WriteHDF5ReadNRows(H5File *fd, Group *group) {
} }
void MasterAttributes::WriteHDF5ThresholdEnergy(H5File *fd, Group *group) { void MasterAttributes::WriteHDF5ThresholdEnergy(H5File *fd, Group *group) {
char c[1024]{0}; char c[1024]{};
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
DataSet dataset = group->createDataSet("Threshold Energy", DataSet dataset = group->createDataSet("Threshold Energy",
PredType::NATIVE_INT, dataspace); PredType::NATIVE_INT, dataspace);
@ -385,7 +383,7 @@ void MasterAttributes::WriteHDF5ThresholdEnergy(H5File *fd, Group *group) {
} }
void MasterAttributes::WriteHDF5ThresholdEnergies(H5File *fd, Group *group) { void MasterAttributes::WriteHDF5ThresholdEnergies(H5File *fd, Group *group) {
char c[1024]{0}; char c[1024]{};
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
StrType strdatatype(PredType::C_S1, 1024); StrType strdatatype(PredType::C_S1, 1024);
DataSet dataset = DataSet dataset =
@ -395,7 +393,7 @@ void MasterAttributes::WriteHDF5ThresholdEnergies(H5File *fd, Group *group) {
} }
void MasterAttributes::WriteHDF5SubExpTime(H5File *fd, Group *group) { void MasterAttributes::WriteHDF5SubExpTime(H5File *fd, Group *group) {
char c[1024]{0}; char c[1024]{};
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
StrType strdatatype(PredType::C_S1, 256); StrType strdatatype(PredType::C_S1, 256);
DataSet dataset = DataSet dataset =
@ -405,7 +403,7 @@ void MasterAttributes::WriteHDF5SubExpTime(H5File *fd, Group *group) {
} }
void MasterAttributes::WriteHDF5SubPeriod(H5File *fd, Group *group) { void MasterAttributes::WriteHDF5SubPeriod(H5File *fd, Group *group) {
char c[1024]{0}; char c[1024]{};
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
StrType strdatatype(PredType::C_S1, 256); StrType strdatatype(PredType::C_S1, 256);
DataSet dataset = DataSet dataset =
@ -422,7 +420,7 @@ void MasterAttributes::WriteHDF5SubQuad(H5File *fd, Group *group) {
} }
void MasterAttributes::WriteHDF5RateCorrections(H5File *fd, Group *group) { void MasterAttributes::WriteHDF5RateCorrections(H5File *fd, Group *group) {
char c[1024]{0}; char c[1024]{};
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
StrType strdatatype(PredType::C_S1, 1024); StrType strdatatype(PredType::C_S1, 1024);
DataSet dataset = DataSet dataset =
@ -440,7 +438,7 @@ void MasterAttributes::WriteHDF5CounterMask(H5File *fd, Group *group) {
void MasterAttributes::WriteHDF5ExptimeArray(H5File *fd, Group *group) { void MasterAttributes::WriteHDF5ExptimeArray(H5File *fd, Group *group) {
for (int i = 0; i != 3; ++i) { for (int i = 0; i != 3; ++i) {
char c[1024]{0}; char c[1024]{};
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
StrType strdatatype(PredType::C_S1, 256); StrType strdatatype(PredType::C_S1, 256);
DataSet dataset = DataSet dataset =
@ -452,7 +450,7 @@ void MasterAttributes::WriteHDF5ExptimeArray(H5File *fd, Group *group) {
void MasterAttributes::WriteHDF5GateDelayArray(H5File *fd, Group *group) { void MasterAttributes::WriteHDF5GateDelayArray(H5File *fd, Group *group) {
for (int i = 0; i != 3; ++i) { for (int i = 0; i != 3; ++i) {
char c[1024]{0}; char c[1024]{};
DataSpace dataspace = DataSpace(H5S_SCALAR); DataSpace dataspace = DataSpace(H5S_SCALAR);
StrType strdatatype(PredType::C_S1, 256); StrType strdatatype(PredType::C_S1, 256);
DataSet dataset = DataSet dataset =
@ -474,8 +472,7 @@ void MasterAttributes::WriteHDF5BurstMode(H5File *fd, Group *group) {
StrType strdatatype(PredType::C_S1, 256); StrType strdatatype(PredType::C_S1, 256);
DataSet dataset = DataSet dataset =
group->createDataSet("Burst Mode", strdatatype, dataspace); group->createDataSet("Burst Mode", strdatatype, dataspace);
char c[1024]; char c[1024]{};
memset(c, 0, sizeof(c));
sls::strcpy_safe(c, sls::ToString(burstMode)); sls::strcpy_safe(c, sls::ToString(burstMode));
dataset.write(c, strdatatype); dataset.write(c, strdatatype);
} }
@ -531,7 +528,7 @@ void MasterAttributes::WriteHDF5DbitList(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetGotthardBinaryAttributes( void MasterAttributes::GetGotthardBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime"); w->Key("Exptime");
w->String(sls::ToString(exptime).c_str()); w->String(sls::ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");
@ -549,7 +546,7 @@ void MasterAttributes::WriteGotthardHDF5Attributes(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetJungfrauBinaryAttributes( void MasterAttributes::GetJungfrauBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime"); w->Key("Exptime");
w->String(sls::ToString(exptime).c_str()); w->String(sls::ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");
@ -570,7 +567,7 @@ void MasterAttributes::WriteJungfrauHDF5Attributes(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetEigerBinaryAttributes( void MasterAttributes::GetEigerBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Dynamic Range"); w->Key("Dynamic Range");
w->Uint(dynamicRange); w->Uint(dynamicRange);
w->Key("Ten Giga"); w->Key("Ten Giga");
@ -609,7 +606,7 @@ void MasterAttributes::WriteEigerHDF5Attributes(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetMythen3BinaryAttributes( void MasterAttributes::GetMythen3BinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Dynamic Range"); w->Key("Dynamic Range");
w->Uint(dynamicRange); w->Uint(dynamicRange);
w->Key("Ten Giga"); w->Key("Ten Giga");
@ -646,7 +643,7 @@ void MasterAttributes::WriteMythen3HDF5Attributes(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetGotthard2BinaryAttributes( void MasterAttributes::GetGotthard2BinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime"); w->Key("Exptime");
w->String(sls::ToString(exptime).c_str()); w->String(sls::ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");
@ -664,7 +661,7 @@ void MasterAttributes::WriteGotthard2HDF5Attributes(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetMoenchBinaryAttributes( void MasterAttributes::GetMoenchBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime"); w->Key("Exptime");
w->String(sls::ToString(exptime).c_str()); w->String(sls::ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");
@ -688,7 +685,7 @@ void MasterAttributes::WriteMoenchHDF5Attributes(H5File *fd, Group *group) {
#endif #endif
void MasterAttributes::GetCtbBinaryAttributes( void MasterAttributes::GetCtbBinaryAttributes(
rapidjson::Writer<rapidjson::StringBuffer> *w) { rapidjson::PrettyWriter<rapidjson::StringBuffer> *w) {
w->Key("Exptime"); w->Key("Exptime");
w->String(sls::ToString(exptime).c_str()); w->String(sls::ToString(exptime).c_str());
w->Key("Period"); w->Key("Period");

View File

@ -8,7 +8,7 @@
#include "sls/sls_detector_defs.h" #include "sls/sls_detector_defs.h"
#include <rapidjson/stringbuffer.h> #include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h> #include <rapidjson/prettywriter.h>
#ifdef HDF5C #ifdef HDF5C
#include "H5Cpp.h" #include "H5Cpp.h"
@ -65,15 +65,15 @@ class MasterAttributes {
MasterAttributes() = default; MasterAttributes() = default;
~MasterAttributes() = default; ~MasterAttributes() = default;
void GetBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); void GetBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteHDF5Attributes(H5File *fd, Group *group); void WriteHDF5Attributes(H5File *fd, Group *group);
#endif #endif
void void
GetCommonBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetCommonBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
void void
GetFinalBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetFinalBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteCommonHDF5Attributes(H5File *fd, Group *group); void WriteCommonHDF5Attributes(H5File *fd, Group *group);
void WriteFinalHDF5Attributes(H5File *fd, Group *group); void WriteFinalHDF5Attributes(H5File *fd, Group *group);
@ -105,42 +105,42 @@ class MasterAttributes {
#endif #endif
void void
GetGotthardBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetGotthardBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteGotthardHDF5Attributes(H5File *fd, Group *group); void WriteGotthardHDF5Attributes(H5File *fd, Group *group);
#endif #endif
void void
GetJungfrauBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetJungfrauBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteJungfrauHDF5Attributes(H5File *fd, Group *group); void WriteJungfrauHDF5Attributes(H5File *fd, Group *group);
#endif #endif
void void
GetEigerBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetEigerBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteEigerHDF5Attributes(H5File *fd, Group *group); void WriteEigerHDF5Attributes(H5File *fd, Group *group);
#endif #endif
void void
GetMythen3BinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetMythen3BinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteMythen3HDF5Attributes(H5File *fd, Group *group); void WriteMythen3HDF5Attributes(H5File *fd, Group *group);
#endif #endif
void void
GetGotthard2BinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetGotthard2BinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteGotthard2HDF5Attributes(H5File *fd, Group *group); void WriteGotthard2HDF5Attributes(H5File *fd, Group *group);
#endif #endif
void void
GetMoenchBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); GetMoenchBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteMoenchHDF5Attributes(H5File *fd, Group *group); void WriteMoenchHDF5Attributes(H5File *fd, Group *group);
#endif #endif
void GetCtbBinaryAttributes(rapidjson::Writer<rapidjson::StringBuffer> *w); void GetCtbBinaryAttributes(rapidjson::PrettyWriter<rapidjson::StringBuffer> *w);
#ifdef HDF5C #ifdef HDF5C
void WriteCtbHDF5Attributes(H5File *fd, Group *group); void WriteCtbHDF5Attributes(H5File *fd, Group *group);
#endif #endif

View File

@ -7,38 +7,31 @@
namespace masterFileUtility { namespace masterFileUtility {
std::string CreateMasterBinaryFile(const std::string filePath, std::string CreateMasterBinaryFile(const std::string &filePath,
const std::string fileNamePrefix, const std::string &fileNamePrefix,
const uint64_t fileIndex, const uint64_t fileIndex,
const bool overWriteEnable, const bool overWriteEnable,
const bool silentMode, const bool silentMode,
MasterAttributes *attr) { MasterAttributes *attr) {
// create file name
std::ostringstream os; std::ostringstream os;
os << filePath << "/" << fileNamePrefix << "_master" os << filePath << "/" << fileNamePrefix << "_master"
<< "_" << fileIndex << ".json"; << "_" << fileIndex << ".json";
std::string fileName = os.str(); std::string fileName = os.str();
// create file std::string mode = "w";
FILE *fd{nullptr}; if (!overWriteEnable)
if (!overWriteEnable) { mode = "wx";
if (nullptr == (fd = fopen((const char *)fileName.c_str(), "wx"))) { FILE *fd = fopen(fileName.c_str(), mode.c_str());
fd = nullptr; if(!fd) {
throw sls::RuntimeError("Could not create binary master file " + throw sls::RuntimeError("Could not create/overwrite binary master file " +
fileName); fileName);
}
} else if (nullptr == (fd = fopen((const char *)fileName.c_str(), "w"))) {
fd = nullptr;
throw sls::RuntimeError(
"Could not create/overwrite binary master file " + fileName);
} }
rapidjson::StringBuffer s; rapidjson::StringBuffer s;
rapidjson::Writer<rapidjson::StringBuffer> writer(s); rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(s);
attr->GetBinaryAttributes(&writer); attr->GetBinaryAttributes(&writer);
std::string message = s.GetString(); if (fwrite(s.GetString(), 1, strlen(s.GetString()), fd) !=
if (fwrite((void *)message.c_str(), 1, message.length(), fd) != strlen(s.GetString())) {
message.length()) {
throw sls::RuntimeError( throw sls::RuntimeError(
"Master binary file incorrect number of bytes written to file"); "Master binary file incorrect number of bytes written to file");
} }

View File

@ -14,8 +14,8 @@ using namespace H5;
namespace masterFileUtility { namespace masterFileUtility {
std::string CreateMasterBinaryFile(const std::string filePath, std::string CreateMasterBinaryFile(const std::string &filePath,
const std::string fileNamePrefix, const std::string &fileNamePrefix,
const uint64_t fileIndex, const uint64_t fileIndex,
const bool overWriteEnable, const bool overWriteEnable,
const bool silentMode, const bool silentMode,