528 void Create(
const char * FileName,
529 unsigned int Flags = H5F_ACC_TRUNC );
532 void Open(
const char * FileName,
533 unsigned int Flags = H5F_ACC_RDONLY);
541 return HDF5_FileId != H5I_BADID;
553 return (access(FileName, F_OK) == 0);
557 return (_access_s(FileName, 0) == 0 );
566 hid_t CreateGroup(
const hid_t ParentGroup,
567 const char * GroupName);
570 hid_t OpenGroup(
const hid_t ParentGroup,
571 const char * GroupName);
574 void CloseGroup(
const hid_t Group);
589 hid_t OpenDataset(
const hid_t ParentGroup,
590 const char * DatasetName);
593 hid_t CreateFloatDataset(
const hid_t ParentGroup,
594 const char * DatasetName,
597 const size_t CompressionLevel);
600 hid_t CreateIndexDataset(
const hid_t ParentGroup,
601 const char * DatasetName,
604 const size_t CompressionLevel);
607 void CloseDataset (
const hid_t HDF5_Dataset_id);
612 void WriteHyperSlab(
const hid_t HDF5_Dataset_id,
617 void WriteHyperSlab(
const hid_t HDF5_Dataset_id,
620 const size_t * Data);
623 void WriteCuboidToHyperSlab(
const hid_t HDF5_Dataset_id,
628 const float * MatrixData);
631 void WriteSensorByMaskToHyperSlab(
const hid_t HDF5_Dataset_id,
633 const size_t IndexSensorSize,
634 const size_t * IndexSensorData,
636 const float * MatrixData);
639 void WriteScalarValue(
const hid_t ParentGroup,
640 const char * DatasetName,
643 void WriteScalarValue(
const hid_t ParentGroup,
644 const char * DatasetName,
648 void ReadScalarValue(
const hid_t ParentGroup,
649 const char * DatasetName,
652 void ReadScalarValue(
const hid_t ParentGroup,
653 const char * DatasetName,
657 void ReadCompleteDataset(
const hid_t ParentGroup,
658 const char * DatasetName,
662 void ReadCompleteDataset(
const hid_t ParentGroup,
663 const char * DatasetName,
672 const char * DatasetName);
675 size_t GetDatasetNumberOfDimensions(
const hid_t ParentGroup,
676 const char * DatasetName);
679 size_t GetDatasetElementCount(
const hid_t ParentGroup,
680 const char * DatasetName);
684 void WriteMatrixDataType(
const hid_t ParentGroup,
685 const char * DatasetName,
686 const THDF5_MatrixDataType & MatrixDataType);
689 void WriteMatrixDomainType(
const hid_t ParentGroup,
690 const char * DatasetName,
691 const THDF5_MatrixDomainType & MatrixDomainType);
695 const char * DatasetName);
698 const char * DatasetName);
701 void WriteStringAttribute(
const hid_t ParentGroup,
702 const char * DatasetName,
703 const char * AttributeName,
704 const string & Value);
706 string ReadStringAttribute (
const hid_t ParentGroup,
707 const char * DatasetName,
708 const char * AttributeName);
728 static const string HDF5_MatrixDomainTypeNames[];
730 static const string HDF5_MatrixDataTypeNames[];
758 hdf5_fhi_creation_date = 1,
759 hdf5_fhi_file_description = 2,
760 hdf5_fhi_major_version = 3,
761 hdf5_fhi_minor_version = 4,
762 hdf5_fhi_file_type = 5,
763 hdf5_fhi_host_name = 6,
764 hdf5_fhi_total_memory_consumption = 7,
765 hdf5_fhi_peak_core_memory_consumption = 8,
766 hdf5_fhi_total_execution_time = 9,
767 hdf5_fhi_data_load_time = 10,
768 hdf5_fhi_preprocessing_time = 11,
769 hdf5_fhi_simulation_time = 12,
770 hdf5_fhi_postprocessing_time = 13,
771 hdf5_fhi_number_of_cores = 14
780 hdf5_ft_checkpoint = 2,
781 hdf5_ft_unknown = 3};
789 hdf5_fv_unknown = 2};
800 void ReadHeaderFromInputFile(
THDF5_File & InputFile);
802 void ReadHeaderFromOutputFile(
THDF5_File & OutputFile);
804 void ReadHeaderFromCheckpointFile(
THDF5_File & CheckpointFile);
807 void WriteHeaderToOutputFile(
THDF5_File & OutputFile);
809 void WriteHeaderToCheckpointFile(
THDF5_File & CheckpointFile);
818 HDF5_FileHeaderValues[hdf5_fhi_created_by] = CodeName;
822 void SetActualCreationTime();
831 return HDF5_MajorFileVersionsNames[0];
841 return HDF5_MinorFileVersionsNames[1];
847 HDF5_FileHeaderValues[hdf5_fhi_major_version] = GetCurrentHDF5_MajorVersion();
852 HDF5_FileHeaderValues[hdf5_fhi_minor_version] = GetCurrentHDF5_MinorVersion();
856 THDF5_FileVersion GetFileVersion();
865 return (HDF5_FileHeaderValues[hdf5_fhi_major_version] == GetCurrentHDF5_MajorVersion());
874 return (HDF5_FileHeaderValues[hdf5_fhi_minor_version] <= GetCurrentHDF5_MinorVersion());
885 void SetMemoryConsumption(
size_t TotalMemory);
887 void SetExecutionTimes(
const double TotalTime,
888 const double LoadTime,
889 const double PreProcessingTime,
890 const double SimulationTime,
891 const double PostprocessingTime);
894 void GetExecutionTimes(
double& TotalTime,
896 double& PreProcessingTime,
897 double& SimulationTime,
898 double& PostprocessingTime);
900 void SetNumberOfCores();
904 void PopulateHeaderFileMap();
912 static const string HDF5_FileTypesNames[];
914 static const string HDF5_MajorFileVersionsNames[];
916 static const string HDF5_MinorFileVersionsNames[];
string FileName
File name.
static const char * HDF5_MatrixDomainTypeName
String representation of the Domain type in the HDF5 file.
static bool IsAccessible(const char *FileName)
Does the file exist? static method.
bool IsOpened() const
Is the file opened?
static const char * HDF5_MatrixDataTypeName
String representation of the Data type in the HDF5 file.
hid_t HDF5_FileId
HDF file handle.
hid_t GetRootGroup() const
Get handle to the root group.
The header file containing the structure with 3D dimension sizes.
THDF5_MatrixDomainType
HDF5 Matrix domain type (real or complex).
THDF5_MatrixDataType
HDF5 matrix data type (float or uint64).
Class wrapping the HDF5 routines.
Structure with 4D dimension sizes (3 in space and 1 in time).