OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
H5PartWrapper Class Referenceabstract

#include <H5PartWrapper.h>

Inheritance diagram for H5PartWrapper:
Inheritance graph
[legend]

Public Member Functions

virtual ~H5PartWrapper ()
 
void close ()
 
double getLastPosition ()
 
virtual void readHeader ()=0
 
virtual void readStep (PartBunchBase< double, 3 > *, h5_ssize_t firstParticle, h5_ssize_t lastParticle)=0
 
virtual void writeHeader ()=0
 
virtual void writeStep (PartBunchBase< double, 3 > *, const std::map< std::string, double > &)=0
 
virtual bool predecessorIsSameFlavour () const =0
 
void storeCavityInformation ()
 
size_t getNumParticles () const
 

Protected Member Functions

 H5PartWrapper (const std::string &fileName, h5_int32_t flags=H5_O_WRONLY)
 
 H5PartWrapper (const std::string &fileName, int restartStep, std::string sourceFile, h5_int32_t flags=H5_O_RDWR)
 
void open (h5_int32_t flags)
 
void copyFile (const std::string &sourceFile, int lastStep=-1, h5_int32_t flags=H5_O_WRONLY)
 
void copyFileSystem (const std::string &sourceFile)
 
void copyHeader (h5_file_t source)
 
void copyStep (h5_file_t source, int step)
 
void copyStepHeader (h5_file_t source)
 
void copyStepData (h5_file_t source)
 
void sendFailureMessage (bool failed, const std::string &where, const std::string &what)
 
void receiveFailureMessage (int sourceNode, const std::string &where, const std::string &what)
 

Static Protected Member Functions

static void reportOnError (h5_int64_t rc, const char *file, int line)
 

Protected Attributes

h5_file_t file_m
 
std::string fileName_m
 
std::string predecessorOPALFlavour_m
 
h5_int64_t numSteps_m
 
bool startedFromExistingFile_m
 

Static Protected Attributes

static std::string copyFilePrefix_m = ".copy"
 

Detailed Description

Definition at line 34 of file H5PartWrapper.h.

Constructor & Destructor Documentation

◆ ~H5PartWrapper()

H5PartWrapper::~H5PartWrapper ( )
virtual

Definition at line 56 of file H5PartWrapper.cpp.

References close().

Here is the call graph for this function:

◆ H5PartWrapper() [1/2]

H5PartWrapper::H5PartWrapper ( const std::string &  fileName,
h5_int32_t  flags = H5_O_WRONLY 
)
protected

Definition at line 32 of file H5PartWrapper.cpp.

References open().

Here is the call graph for this function:

◆ H5PartWrapper() [2/2]

H5PartWrapper::H5PartWrapper ( const std::string &  fileName,
int  restartStep,
std::string  sourceFile,
h5_int32_t  flags = H5_O_RDWR 
)
protected

Definition at line 42 of file H5PartWrapper.cpp.

References copyFile(), fileName_m, and open().

Here is the call graph for this function:

Member Function Documentation

◆ close()

void H5PartWrapper::close ( )

◆ copyFile()

void H5PartWrapper::copyFile ( const std::string &  sourceFile,
int  lastStep = -1,
h5_int32_t  flags = H5_O_WRONLY 
)
protected

◆ copyFileSystem()

void H5PartWrapper::copyFileSystem ( const std::string &  sourceFile)
protected

Definition at line 252 of file H5PartWrapper.cpp.

References fileName_m, IpplInfo::myNode(), receiveFailureMessage(), and sendFailureMessage().

Referenced by copyFile().

Here is the call graph for this function:

◆ copyHeader()

void H5PartWrapper::copyHeader ( h5_file_t  source)
protected

Definition at line 289 of file H5PartWrapper.cpp.

References file_m, READFILEATTRIB, REPORTONERROR, WRITEFILEATTRIB, and WRITESTRINGFILEATTRIB.

Referenced by copyFile().

◆ copyStep()

void H5PartWrapper::copyStep ( h5_file_t  source,
int  step 
)
protected

Definition at line 359 of file H5PartWrapper.cpp.

References copyStepData(), copyStepHeader(), file_m, numSteps_m, and REPORTONERROR.

Referenced by copyFile().

Here is the call graph for this function:

◆ copyStepData()

void H5PartWrapper::copyStepData ( h5_file_t  source)
protected

Definition at line 444 of file H5PartWrapper.cpp.

References Util::c_data(), file_m, IpplInfo::getNodes(), IpplInfo::myNode(), READDATA, REPORTONERROR, and WRITEDATA.

Referenced by copyStep().

Here is the call graph for this function:

◆ copyStepHeader()

void H5PartWrapper::copyStepHeader ( h5_file_t  source)
protected

◆ getLastPosition()

double H5PartWrapper::getLastPosition ( )
inline

Definition at line 89 of file H5PartWrapper.h.

References file_m, open(), readStep(), READSTEPATTRIB, and REPORTONERROR.

Referenced by H5Writer::getLastPosition().

Here is the call graph for this function:

◆ getNumParticles()

size_t H5PartWrapper::getNumParticles ( ) const

◆ open()

void H5PartWrapper::open ( h5_int32_t  flags)
protected

◆ predecessorIsSameFlavour()

virtual bool H5PartWrapper::predecessorIsSameFlavour ( ) const
pure virtual

◆ readHeader()

virtual void H5PartWrapper::readHeader ( )
pure virtual

◆ readStep()

virtual void H5PartWrapper::readStep ( PartBunchBase< double, 3 > *  ,
h5_ssize_t  firstParticle,
h5_ssize_t  lastParticle 
)
pure virtual

◆ receiveFailureMessage()

void H5PartWrapper::receiveFailureMessage ( int  sourceNode,
const std::string &  where,
const std::string &  what 
)
protected

Definition at line 511 of file H5PartWrapper.cpp.

References IpplInfo::Comm, getMessage(), Communicate::receive_block(), and where().

Referenced by copyFileSystem().

Here is the call graph for this function:

◆ reportOnError()

void H5PartWrapper::reportOnError ( h5_int64_t  rc,
const char *  file,
int  line 
)
inlinestaticprotected

Definition at line 83 of file H5PartWrapper.h.

References endl(), and ERRORMSG.

Referenced by H5PartWrapperForPT::writeStepData().

Here is the call graph for this function:

◆ sendFailureMessage()

void H5PartWrapper::sendFailureMessage ( bool  failed,
const std::string &  where,
const std::string &  what 
)
protected

Definition at line 499 of file H5PartWrapper.cpp.

References Communicate::broadcast_all(), IpplInfo::Comm, putMessage(), and where().

Referenced by copyFileSystem().

Here is the call graph for this function:

◆ storeCavityInformation()

void H5PartWrapper::storeCavityInformation ( )

Write number of Cavities with autophase information

Definition at line 85 of file H5PartWrapper.cpp.

References close(), end(), endl(), file_m, OpalData::getFirstMaxPhases(), OpalData::getInstance(), OpalData::getLastMaxPhases(), OpalData::getNumberOfMaxPhases(), INFOMSG, open(), WRITEFILEATTRIB, and WRITESTRINGFILEATTRIB.

Referenced by H5Writer::storeCavityInformation().

Here is the call graph for this function:

◆ writeHeader()

virtual void H5PartWrapper::writeHeader ( )
pure virtual

Implemented in H5PartWrapperForPT, and H5PartWrapperForPC.

Referenced by H5Writer::H5Writer().

◆ writeStep()

virtual void H5PartWrapper::writeStep ( PartBunchBase< double, 3 > *  ,
const std::map< std::string, double > &   
)
pure virtual

Member Data Documentation

◆ copyFilePrefix_m

std::string H5PartWrapper::copyFilePrefix_m = ".copy"
staticprotected

Definition at line 79 of file H5PartWrapper.h.

Referenced by copyFile().

◆ file_m

h5_file_t H5PartWrapper::file_m
protected

◆ fileName_m

std::string H5PartWrapper::fileName_m
protected

Definition at line 74 of file H5PartWrapper.h.

Referenced by copyFile(), copyFileSystem(), H5PartWrapper(), and open().

◆ numSteps_m

h5_int64_t H5PartWrapper::numSteps_m
protected

◆ predecessorOPALFlavour_m

std::string H5PartWrapper::predecessorOPALFlavour_m
protected

◆ startedFromExistingFile_m

bool H5PartWrapper::startedFromExistingFile_m
protected

Definition at line 77 of file H5PartWrapper.h.


The documentation for this class was generated from the following files: