1 #ifndef OPAL_H5PARTWRAPPER_H
2 #define OPAL_H5PARTWRAPPER_H
18 #define REPORTONERROR(rc) H5PartWrapper::reportOnError(rc, __FILE__, __LINE__)
19 #define READFILEATTRIB(type, file, name, value) REPORTONERROR(H5ReadFileAttrib##type(file, name, value));
20 #define WRITESTRINGFILEATTRIB(file, name, value) REPORTONERROR(H5WriteFileAttribString(file, name, value));
21 #define WRITEFILEATTRIB(type, file, name, value, length) REPORTONERROR(H5WriteFileAttrib##type(file, name, value, length));
23 #define READSTEPATTRIB(type, file, name, value) REPORTONERROR(H5ReadStepAttrib##type(file, name, value));
24 #define WRITESTRINGSTEPATTRIB(file, name, value) REPORTONERROR(H5WriteStepAttribString(file, name, value));
25 #define WRITESTEPATTRIB(type, file, name, value, length) REPORTONERROR(H5WriteStepAttrib##type(file, name, value, length));
27 #define READDATA(type, file, name, value) REPORTONERROR(H5PartReadData##type(file, name, value));
28 #define WRITEDATA(type, file, name, value) REPORTONERROR(H5PartWriteData##type(file, name, value));
49 H5PartWrapper(
const std::string &fileName, h5_int32_t flags = H5_O_WRONLY);
50 H5PartWrapper(
const std::string &fileName,
int restartStep, std::string sourceFile, h5_int32_t flags = H5_O_RDWR);
52 void open(h5_int32_t flags);
54 void copyFile(
const std::string &sourceFile,
int lastStep = -1, h5_int32_t flags = H5_O_WRONLY);
57 void copyStep(h5_file_t source,
int step);
61 const std::string &
where,
62 const std::string &what);
64 const std::string &where,
65 const std::string &what);
67 static void reportOnError(h5_int64_t rc,
const char* file,
int line);
81 ERRORMSG(
"H5 rc= " << rc <<
" in " << file <<
" @ line " << line <<
endl);
88 h5_ssize_t numStepsInSource = H5GetNumSteps(
file_m);
89 h5_ssize_t
readStep = numStepsInSource - 1;
92 h5_float64_t pathLength;
98 #endif //OPAL_H5PARTWRAPPER_H
void open(h5_int32_t flags)
virtual void writeStep(PartBunchBase< double, 3 > *, const std::map< std::string, double > &)=0
void sendFailureMessage(bool failed, const std::string &where, const std::string &what)
void copyHeader(h5_file_t source)
void copyStep(h5_file_t source, int step)
virtual bool predecessorIsSameFlavour() const =0
std::string predecessorOPALFlavour_m
#define REPORTONERROR(rc)
void copyFileSystem(const std::string &sourceFile)
static std::string copyFilePrefix_m
PETE_TTTree< OpWhere, typename Cond_t::PETE_Expr_t, typename True_t::PETE_Expr_t, PETE_Scalar< Vektor< T, Dim > > > where(const PETE_Expr< Cond_t > &c, const PETE_Expr< True_t > &t, const Vektor< T, Dim > &f)
static void reportOnError(h5_int64_t rc, const char *file, int line)
void copyStepHeader(h5_file_t source)
void storeCavityInformation()
virtual void writeHeader()=0
#define READSTEPATTRIB(type, file, name, value)
virtual void readStep(PartBunchBase< double, 3 > *, h5_ssize_t firstParticle, h5_ssize_t lastParticle)=0
virtual void readHeader()=0
bool startedFromExistingFile_m
void copyFile(const std::string &sourceFile, int lastStep=-1, h5_int32_t flags=H5_O_WRONLY)
void copyStepData(h5_file_t source)
H5PartWrapper(const std::string &fileName, h5_int32_t flags=H5_O_WRONLY)
void receiveFailureMessage(int sourceNode, const std::string &where, const std::string &what)
size_t getNumParticles() const
Inform & endl(Inform &inf)