![]() |
kspaceFirstOrder3D-CUDA
1.1
The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Class for HDF5 header. More...
#include <HDF5_File.h>
Public Types | |
enum | TFileHeaderItems { CREATED_BY = 0, CREATION_DATA = 1, FILE_DESCRIPTION = 2, MAJOR_VERSION = 3, MINOR_VERSION = 4, FILE_TYPE = 5, HOST_NAME = 6, TOTAL_MEMORY_CONSUMPTION = 7, PEAK_CORE_MEMORY_CONSUMPTION = 8, TOTAL_EXECUTION_TIME = 9, DATA_LOAD_TIME = 10, PREPROCESSING_TIME = 11, SIMULATION_TIME = 12, POST_PROCESSING_TIME = 13, NUMBER_OF_CORES = 14 } |
List of all header items. More... | |
enum | TFileType { INPUT = 0, OUTPUT = 1, CHECKPOINT = 2, UNKNOWN = 3 } |
HDF5 file type. More... | |
enum | TFileVersion { VERSION_10 = 0, VERSION_11 = 1, VERSION_UNKNOWN = 2 } |
HDF5 file version. More... | |
Public Member Functions | |
THDF5_FileHeader () | |
Constructor. More... | |
THDF5_FileHeader (const THDF5_FileHeader &src) | |
Copy constructor. More... | |
~THDF5_FileHeader () | |
Destructor. More... | |
void | ReadHeaderFromInputFile (THDF5_File &inputFile) |
Read header from the input file. More... | |
void | ReadHeaderFromOutputFile (THDF5_File &outputFile) |
Read Header from output file (necessary for checkpoint-restart). More... | |
void | ReadHeaderFromCheckpointFile (THDF5_File &checkpointFile) |
Read Header from checkpoint file (necessary for checkpoint-restart). More... | |
void | WriteHeaderToOutputFile (THDF5_File &outputFile) |
Write header to the output file. More... | |
void | WriteHeaderToCheckpointFile (THDF5_File &checkpointFile) |
Write header to the output file. More... | |
void | SetCodeName (const std::string &codeName) |
Set code name. More... | |
void | SetActualCreationTime () |
Set creation time. More... | |
void | SetMajorFileVersion () |
Set major file version. More... | |
void | SetMinorFileVersion () |
Set minor file version. More... | |
TFileVersion | GetFileVersion () |
Set major file version in a string. More... | |
bool | CheckMajorFileVersion () |
Check major file version. More... | |
bool | CheckMinorFileVersion () |
Check minor file version. More... | |
THDF5_FileHeader::TFileType | GetFileType () |
Get File type. More... | |
void | SetFileType (const THDF5_FileHeader::TFileType fileType) |
Set file type. More... | |
void | SetHostName () |
Set host name. More... | |
void | SetMemoryConsumption (const size_t totalMemory) |
Set memory consumption. More... | |
void | SetExecutionTimes (const double totalTime, const double loadTime, const double preProcessingTime, const double simulationTime, const double postprocessingTime) |
Set execution times. More... | |
void | GetExecutionTimes (double &totalTime, double &loadTime, double &preProcessingTime, double &simulationTime, double &postprocessingTime) |
Get execution times stored in the output file header. More... | |
void | SetNumberOfCores () |
Set number of cores. More... | |
Static Public Member Functions | |
static std::string | GetCurrentHDF5_MajorVersion () |
Get string version of current Major version. More... | |
static std::string | GetCurrentHDF5_MinorVersion () |
Get string version of current Minor version. More... | |
Private Member Functions | |
void | PopulateHeaderFileMap () |
Populate the map with the header items. More... | |
Private Attributes | |
std::map< TFileHeaderItems, std::string > | headerValues |
map for the header values. | |
std::map< TFileHeaderItems, std::string > | headerNames |
map for the header names. | |
Static Private Attributes | |
static const std::string | hdf5_FileTypesNames [] = {"input", "output", "checkpoint", "unknown"} |
String representation of different file types. | |
static const std::string | hdf5_MajorFileVersionsNames [] = {"1"} |
String representations of Major file versions. | |
static const std::string | hdf5_MinorFileVersionsNames [] = {"0","1"} |
String representations of Major file versions. | |
This class manages all information that can be stored in the input output or checkpoint file header.
Definition at line 730 of file HDF5_File.h.
List of all header items.
Definition at line 740 of file HDF5_File.h.
HDF5 file type.
Definition at line 764 of file HDF5_File.h.
HDF5 file version.
Definition at line 777 of file HDF5_File.h.
THDF5_FileHeader::THDF5_FileHeader | ( | ) |
Constructor.
Definition at line 1205 of file HDF5_File.cpp.
THDF5_FileHeader::THDF5_FileHeader | ( | const THDF5_FileHeader & | src | ) |
THDF5_FileHeader::~THDF5_FileHeader | ( | ) |
Destructor.
Definition at line 1227 of file HDF5_File.cpp.
|
inline |
Check major file version.
Definition at line 862 of file HDF5_File.h.
|
inline |
Check minor file version.
Definition at line 872 of file HDF5_File.h.
|
inlinestatic |
Get string version of current Major version.
Definition at line 821 of file HDF5_File.h.
|
inlinestatic |
Get string version of current Minor version.
Definition at line 831 of file HDF5_File.h.
void THDF5_FileHeader::GetExecutionTimes | ( | double & | totalTime, |
double & | loadTime, | ||
double & | preProcessingTime, | ||
double & | simulationTime, | ||
double & | postprocessingTime | ||
) |
Get execution times stored in the output file header.
[out] | totalTime | - Total time |
[out] | loadTime | - Time to load data |
[out] | preProcessingTime | - Preprocessing time |
[out] | simulationTime | - Simulation time |
[out] | postprocessingTime | - Post processing time |
Definition at line 1575 of file HDF5_File.cpp.
THDF5_FileHeader::TFileType THDF5_FileHeader::GetFileType | ( | ) |
Get File type.
Definition at line 1472 of file HDF5_File.cpp.
THDF5_FileHeader::TFileVersion THDF5_FileHeader::GetFileVersion | ( | ) |
Get file version as an enum.
Definition at line 1447 of file HDF5_File.cpp.
|
private |
Create map with names for the header.
Definition at line 1609 of file HDF5_File.cpp.
void THDF5_FileHeader::ReadHeaderFromCheckpointFile | ( | THDF5_File & | checkpointFile | ) |
Read the file header form the checkpoint file. We need the header to verify the file version and type.
[in,out] | checkpointFile | - Checkpoint file handle |
Definition at line 1336 of file HDF5_File.cpp.
void THDF5_FileHeader::ReadHeaderFromInputFile | ( | THDF5_File & | inputFile | ) |
Read header from the input file.
[in,out] | inputFile | - Input file handle |
ios:failure | when en error happens |
Definition at line 1241 of file HDF5_File.cpp.
void THDF5_FileHeader::ReadHeaderFromOutputFile | ( | THDF5_File & | outputFile | ) |
Read header from output file (necessary for checkpoint-restart). Read only execution times (the others are read from the input file, or calculated based on the very last leg of the simulation). This function is called only if checkpoint-restart is enabled.
[in,out] | outputFile | - Output file handle |
Definition at line 1290 of file HDF5_File.cpp.
void THDF5_FileHeader::SetActualCreationTime | ( | ) |
Set actual date and time.
Definition at line 1429 of file HDF5_File.cpp.
|
inline |
Set code name to the header.
[in] | codeName | - code version |
Definition at line 808 of file HDF5_File.h.
void THDF5_FileHeader::SetExecutionTimes | ( | const double | totalTime, |
const double | loadTime, | ||
const double | preProcessingTime, | ||
const double | simulationTime, | ||
const double | postprocessingTime | ||
) |
Set execution times in file header.
[in] | totalTime | - Total time |
[in] | loadTime | - Time to load data |
[in] | preProcessingTime | - Preprocessing time |
[in] | simulationTime | - Simulation time |
[in] | postprocessingTime | - Post processing time |
Definition at line 1552 of file HDF5_File.cpp.
void THDF5_FileHeader::SetFileType | ( | const THDF5_FileHeader::TFileType | fileType | ) |
Set File type.
[in] | fileType | - File type |
Definition at line 1491 of file HDF5_File.cpp.
void THDF5_FileHeader::SetHostName | ( | ) |
Set Host name.
Definition at line 1503 of file HDF5_File.cpp.
|
inline |
Set major file version.
Definition at line 840 of file HDF5_File.h.
void THDF5_FileHeader::SetMemoryConsumption | ( | const size_t | totalMemory | ) |
Set memory consumption.
[in] | totalMemory | - Total memory consumption |
Definition at line 1531 of file HDF5_File.cpp.
|
inline |
Set minor file version.
Definition at line 849 of file HDF5_File.h.
void THDF5_FileHeader::SetNumberOfCores | ( | ) |
Set Number of cores.
Definition at line 1593 of file HDF5_File.cpp.
void THDF5_FileHeader::WriteHeaderToCheckpointFile | ( | THDF5_File & | checkpointFile | ) |
Write header to the output file (only a subset of all possible fields are written).
[in,out] | checkpointFile | - Checkpoint file handle |
Definition at line 1386 of file HDF5_File.cpp.
void THDF5_FileHeader::WriteHeaderToOutputFile | ( | THDF5_File & | outputFile | ) |
Write header into the output file.
[in,out] | outputFile | - Output file handle |
Definition at line 1369 of file HDF5_File.cpp.