Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
|
#include <Hdf5DataWriter.hpp>
Public Member Functions | |
Hdf5DataWriter (DistributedVectorFactory &rVectorFactory, const std::string &rDirectory, const std::string &rBaseName, bool cleanDirectory=true, bool extendData=false, std::string datasetName="Data", bool useCache=false) | |
virtual | ~Hdf5DataWriter () |
void | DefineFixedDimension (long dimensionSize) |
void | DefineFixedDimension (const std::vector< unsigned > &rNodesToOuputOriginalIndices, const std::vector< unsigned > &rNodesToOuputPermutedIndices, long vecSize) |
void | DefineUnlimitedDimension (const std::string &rVariableName, const std::string &rVariableUnits, unsigned estimatedLength=1) |
void | AdvanceAlongUnlimitedDimension () |
int | DefineVariable (const std::string &rVariableName, const std::string &rVariableUnits) |
bool | IsInDefineMode () |
virtual void | EndDefineMode () |
void | PossiblyExtend () |
void | EmptyDataset () |
void | PutVector (int variableID, Vec petscVector) |
void | PutStripedVector (std::vector< int > variableIDs, Vec petscVector) |
bool | GetUsingCache () |
void | WriteCache () |
void | PutUnlimitedVariable (double value) |
void | Close () |
int | GetVariableByName (const std::string &rVariableName) |
bool | ApplyPermutation (const std::vector< unsigned > &rPermutation, bool unsafeExtendingMode=false) |
void | SetFixedChunkSize (const unsigned &rTimestepsPerChunk, const unsigned &rNodesPerChunk, const unsigned &rVariablesPerChunk) |
void | SetTargetChunkSize (hsize_t targetSize) |
void | SetAlignment (hsize_t alignment) |
Public Member Functions inherited from AbstractHdf5Access | |
AbstractHdf5Access (const std::string &rDirectory, const std::string &rBaseName, const std::string &rDatasetName, bool makeAbsolute=true) | |
AbstractHdf5Access (const FileFinder &rDirectory, const std::string &rBaseName, const std::string &rDatasetName) | |
virtual | ~AbstractHdf5Access () |
bool | IsDataComplete () |
std::vector< unsigned > | GetIncompleteNodeMap () |
std::string | GetUnlimitedDimensionName () |
std::string | GetUnlimitedDimensionUnit () |
Private Member Functions | |
void | CheckVariableName (const std::string &rName) |
void | CheckUnitsName (const std::string &rName) |
void | ComputeIncompleteOffset () |
void | OpenFile () |
hsize_t | CalculateNumberOfChunks () |
void | CalculateChunkDims (unsigned targetSize, unsigned *pChunkSizeInBytes, bool *pAllOneChunk) |
void | SetChunkSize () |
Friends | |
class | TestHdf5DataWriter |
Additional Inherited Members | |
Protected Member Functions inherited from AbstractHdf5Access | |
bool | DoesDatasetExist (const std::string &rDatasetName) |
void | SetUnlimitedDatasetId () |
void | SetMainDatasetRawChunkCache () |
Protected Attributes inherited from AbstractHdf5Access | |
std::string | mBaseName |
std::string | mDatasetName |
FileFinder | mDirectory |
bool | mIsDataComplete |
std::string | mUnlimitedDimensionName |
std::string | mUnlimitedDimensionUnit |
bool | mIsUnlimitedDimensionSet |
std::vector< unsigned > | mIncompleteNodeIndices |
hid_t | mFileId |
hid_t | mUnlimitedDatasetId |
hid_t | mVariablesDatasetId |
hsize_t | mDatasetDims [DATASET_DIMS] |
Static Protected Attributes inherited from AbstractHdf5Access | |
static const unsigned | DATASET_DIMS = 3 |
A concrete HDF5 data writer class.
Definition at line 48 of file Hdf5DataWriter.hpp.
Hdf5DataWriter::Hdf5DataWriter | ( | DistributedVectorFactory & | rVectorFactory, |
const std::string & | rDirectory, | ||
const std::string & | rBaseName, | ||
bool | cleanDirectory = true , |
||
bool | extendData = false , |
||
std::string | datasetName = "Data" , |
||
bool | useCache = false |
||
) |
Constructor.
rVectorFactory | the factory to use in creating PETSc Vec and DistributedVector objects. |
rDirectory | the directory in which to write the data to file, relative to chaste test output. |
rBaseName | the name of the file in which to write the data |
cleanDirectory | whether to clean the directory (defaults to true) |
extendData | whether to try opening an existing file and appending to it. |
datasetName | The name of the HDF5 dataset to write, defaults to "Data". |
useCache | Whether to cache writes so only whole chunks are written to disk. |
The extendData parameter allows us to add to an existing dataset. It only really makes sense if the existing file has an unlimited dimension which we can extend. It also only makes sense if cleanDirectory is false, otherwise there won't be a file there to read...
Definition at line 52 of file Hdf5DataWriter.cpp.
References AdvanceAlongUnlimitedDimension(), ComputeIncompleteOffset(), AbstractHdf5Access::DATASET_DIMS, AbstractHdf5Access::DoesDatasetExist(), EXCEPTION, DistributedVectorFactory::GetLocalOwnership(), mCacheFirstTimeStep, mChunkSize, mCleanDirectory, mCurrentTimeStep, mDataCache, mDataFixedDimensionSize, AbstractHdf5Access::mDatasetDims, AbstractHdf5Access::mDatasetName, mFileFixedDimensionSize, AbstractHdf5Access::mFileId, mFixedChunkSize, AbstractHdf5Access::mIncompleteNodeIndices, mIncompletePermIndices, AbstractHdf5Access::mIsDataComplete, mIsFixedDimensionSet, mIsInDefineMode, AbstractHdf5Access::mIsUnlimitedDimensionSet, mLo, mNumberOwned, mOffset, mrVectorFactory, AbstractHdf5Access::mUnlimitedDatasetId, mUseCache, mUseExistingFile, DataWriterVariable::mVariableName, mVariables, AbstractHdf5Access::mVariablesDatasetId, DataWriterVariable::mVariableUnits, OpenFile(), and AbstractHdf5Access::SetUnlimitedDatasetId().
|
virtual |
Destructor.
Definition at line 271 of file Hdf5DataWriter.cpp.
References Close(), PetscTools::Destroy(), mDoublePermutation, and mSinglePermutation.
void Hdf5DataWriter::AdvanceAlongUnlimitedDimension | ( | ) |
Advance along the unlimited dimension. Normally this will be called when all variables in a row have been input.
Definition at line 1126 of file Hdf5DataWriter.cpp.
References EXCEPTION, mChunkSize, mCurrentTimeStep, AbstractHdf5Access::mDatasetDims, mEstimatedUnlimitedLength, AbstractHdf5Access::mIsUnlimitedDimensionSet, mNeedExtend, mUseCache, and WriteCache().
Referenced by Hdf5DataWriter(), VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
bool Hdf5DataWriter::ApplyPermutation | ( | const std::vector< unsigned > & | rPermutation, |
bool | unsafeExtendingMode = false |
||
) |
Apply a permutation to all occurences of PutVector Should be called when in define mode
rPermutation | a forward/?reverse permutation |
unsafeExtendingMode | is true when we are extending a file which requires a permutation to be applied to it. In particular we are extending a cardiac simulation with "original node ordering" |
Definition at line 1196 of file Hdf5DataWriter.cpp.
References EXCEPTION, mDataFixedDimensionSize, mDoublePermutation, mFileFixedDimensionSize, mHi, mIsInDefineMode, mLo, mSinglePermutation, and PetscTools::SetupMat().
|
private |
Calculate (and save in the member variables) chunk dimensions based on a target size. Chunks are kept as "square" as possible while wasting as little space around the edges of the dataset as possible.
[in] | targetSize | The target number of entries in each dimension in the chunk. |
[out] | pChunkSizeInBytes | The size of the resulting chunk in bytes. |
[out] | pAllOneChunk | Whether the dataset is spanned by a single chunk. |
Definition at line 1308 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::DATASET_DIMS, mChunkSize, and AbstractHdf5Access::mDatasetDims.
Referenced by SetChunkSize().
|
private |
Little method to calculate the number of chunks resulting from given chunk dimensions.
Definition at line 1297 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::DATASET_DIMS, mChunkSize, and AbstractHdf5Access::mDatasetDims.
Referenced by SetChunkSize().
|
private |
Check name of unit is allowed, i.e. contains only alphanumeric & _, and isn't blank.
rName | unit name |
Definition at line 508 of file Hdf5DataWriter.cpp.
References EXCEPTION.
Referenced by CheckVariableName(), and DefineVariable().
|
private |
Check name of variable is allowed, i.e. contains only alphanumeric & _, and isn't blank.
rName | variable name |
Definition at line 499 of file Hdf5DataWriter.cpp.
References CheckUnitsName(), and EXCEPTION.
Referenced by DefineVariable().
void Hdf5DataWriter::Close | ( | ) |
Close any open files.
Definition at line 1083 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::mFileId, mIsInDefineMode, AbstractHdf5Access::mIsUnlimitedDimensionSet, AbstractHdf5Access::mUnlimitedDatasetId, mUseCache, AbstractHdf5Access::mVariablesDatasetId, and WriteCache().
Referenced by ~Hdf5DataWriter(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
|
private |
Compute mOffset and mNumberOwned from mIncompleteNodeIndices when we have incomplete data.
Definition at line 430 of file Hdf5DataWriter.cpp.
References mHi, AbstractHdf5Access::mIncompleteNodeIndices, mIncompletePermIndices, mLo, mNumberOwned, and mOffset.
Referenced by Hdf5DataWriter(), and DefineFixedDimension().
void Hdf5DataWriter::DefineFixedDimension | ( | const std::vector< unsigned > & | rNodesToOuputOriginalIndices, |
const std::vector< unsigned > & | rNodesToOuputPermutedIndices, | ||
long | vecSize | ||
) |
Define the fixed dimension, assuming incomplete data output (subset of the nodes).
rNodesToOuputOriginalIndices | Node indices to be output as in the original mesh (precondition: to be monotonic increasing) |
vecSize | |
rNodesToOuputPermutedIndices | Node indices to be output as they are in the runtime parallel partitioned mesh |
Definition at line 404 of file Hdf5DataWriter.cpp.
References ComputeIncompleteOffset(), DefineFixedDimension(), EXCEPTION, mFileFixedDimensionSize, AbstractHdf5Access::mIncompleteNodeIndices, mIncompletePermIndices, and AbstractHdf5Access::mIsDataComplete.
void Hdf5DataWriter::DefineFixedDimension | ( | long | dimensionSize | ) |
Define the fixed dimension, assuming complete data output (all the nodes).
dimensionSize | The size of the dimension |
Definition at line 379 of file Hdf5DataWriter.cpp.
References EXCEPTION, DistributedVectorFactory::GetHigh(), DistributedVectorFactory::GetLocalOwnership(), DistributedVectorFactory::GetLow(), mDataFixedDimensionSize, mFileFixedDimensionSize, mHi, mIsFixedDimensionSet, mIsInDefineMode, mLo, mNumberOwned, mOffset, and mrVectorFactory.
Referenced by VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh(), DefineFixedDimension(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), ExtendedBidomainProblem< DIM >::save(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
void Hdf5DataWriter::DefineUnlimitedDimension | ( | const std::string & | rVariableName, |
const std::string & | rVariableUnits, | ||
unsigned | estimatedLength = 1 |
||
) |
Define a variable.
rVariableName | The name of the dimension |
rVariableUnits | The physical units of the dimension |
estimatedLength | An estimate of the unlimited dimension length for performance reasons |
Definition at line 1106 of file Hdf5DataWriter.cpp.
References EXCEPTION, mEstimatedUnlimitedLength, mIsInDefineMode, AbstractHdf5Access::mIsUnlimitedDimensionSet, AbstractHdf5Access::mUnlimitedDimensionName, and AbstractHdf5Access::mUnlimitedDimensionUnit.
Referenced by VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), ExtendedBidomainProblem< DIM >::save(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
int Hdf5DataWriter::DefineVariable | ( | const std::string & | rVariableName, |
const std::string & | rVariableUnits | ||
) |
Define a variable.
rVariableName | The name of the dimension |
rVariableUnits | The physical units of the dimension |
Definition at line 464 of file Hdf5DataWriter.cpp.
References CheckUnitsName(), CheckVariableName(), EXCEPTION, mIsInDefineMode, DataWriterVariable::mVariableName, mVariables, and DataWriterVariable::mVariableUnits.
Referenced by VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), ExtendedBidomainProblem< DIM >::save(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
void Hdf5DataWriter::EmptyDataset | ( | ) |
Reset mCurrentTimeStep to 0 and resize the dataset and unlimited dataset to size 1 in the first dimension. Future writes will therefore overwrite the original contents.
* THIS METHOD (EFFECTIVELY) DELETES THE DATASET! * *
Definition at line 1166 of file Hdf5DataWriter.cpp.
References mCurrentTimeStep, AbstractHdf5Access::mDatasetDims, mNeedExtend, and PossiblyExtend().
Referenced by PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
|
virtual |
End the define mode of the DataWriter.
Definition at line 525 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::DATASET_DIMS, EXCEPTION, ChasteBuildInfo::GetProvenanceString(), mChunkSize, mDataCache, AbstractHdf5Access::mDatasetDims, AbstractHdf5Access::mDatasetName, mEstimatedUnlimitedLength, mFileFixedDimensionSize, AbstractHdf5Access::mFileId, AbstractHdf5Access::mIncompleteNodeIndices, AbstractHdf5Access::mIsDataComplete, mIsFixedDimensionSet, mIsInDefineMode, AbstractHdf5Access::mIsUnlimitedDimensionSet, mNumberOwned, AbstractHdf5Access::mUnlimitedDatasetId, AbstractHdf5Access::mUnlimitedDimensionName, AbstractHdf5Access::mUnlimitedDimensionUnit, mUseCache, mVariables, AbstractHdf5Access::mVariablesDatasetId, OpenFile(), SetChunkSize(), and AbstractHdf5Access::SetMainDatasetRawChunkCache().
Referenced by VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), ExtendedBidomainProblem< DIM >::save(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
bool Hdf5DataWriter::GetUsingCache | ( | ) |
Whether we're caching writes
Definition at line 991 of file Hdf5DataWriter.cpp.
References mUseCache.
int Hdf5DataWriter::GetVariableByName | ( | const std::string & | rVariableName | ) |
Get the id of the given variable, the variable must already exist or an exception will be thrown.
rVariableName | variable name to look up |
Definition at line 1176 of file Hdf5DataWriter.cpp.
References EXCEPTION, and mVariables.
Referenced by PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
bool Hdf5DataWriter::IsInDefineMode | ( | ) |
Check whether writer is in define mode.
When in define mode variables can be defined but no data may be written, and vice versa. When extending, the writer will be in define mode if the dataset does not exist, and vice versa.
Definition at line 520 of file Hdf5DataWriter.cpp.
References mIsInDefineMode.
Referenced by PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
|
private |
Opens an existing file or creates a new file, depending on mUseExistingFile.
This method sets mFileId.
Definition at line 285 of file Hdf5DataWriter.cpp.
References RelativeTo::Absolute, EXCEPTION, FileFinder::Exists(), FileFinder::GetAbsolutePath(), mAlignment, AbstractHdf5Access::mBaseName, mCleanDirectory, AbstractHdf5Access::mDatasetDims, AbstractHdf5Access::mDirectory, mEstimatedUnlimitedLength, mFileFixedDimensionSize, AbstractHdf5Access::mFileId, mUseExistingFile, mVariables, and AbstractHdf5Access::mVariablesDatasetId.
Referenced by Hdf5DataWriter(), and EndDefineMode().
void Hdf5DataWriter::PossiblyExtend | ( | ) |
Extend the dataset to the correct to the correct dimensions if needed.
Definition at line 1156 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::mDatasetDims, mNeedExtend, AbstractHdf5Access::mUnlimitedDatasetId, and AbstractHdf5Access::mVariablesDatasetId.
Referenced by EmptyDataset(), PutStripedVector(), PutUnlimitedVariable(), and PutVector().
void Hdf5DataWriter::PutStripedVector | ( | std::vector< int > | variableIDs, |
Vec | petscVector | ||
) |
Write data for two variables from a PETSc vector to the dataset.
variableIDs | vector of IDs of variables of the columns in the HDF5 file |
petscVector | the data |
Definition at line 842 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::DATASET_DIMS, PetscTools::Destroy(), EXCEPTION, mCurrentTimeStep, mDataCache, mDataFixedDimensionSize, AbstractHdf5Access::mDatasetDims, mDoublePermutation, mIncompletePermIndices, AbstractHdf5Access::mIsDataComplete, mIsInDefineMode, AbstractHdf5Access::mIsUnlimitedDimensionSet, mLo, mNumberOwned, mOffset, mUseCache, AbstractHdf5Access::mVariablesDatasetId, and PossiblyExtend().
Referenced by AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), and ExtendedBidomainProblem< DIM >::save().
void Hdf5DataWriter::PutUnlimitedVariable | ( | double | value | ) |
Write a single value for the unlimited variable (e.g. time) to the dataset.
value | the data |
Definition at line 1047 of file Hdf5DataWriter.cpp.
References PetscTools::AmMaster(), EXCEPTION, mCurrentTimeStep, mIsInDefineMode, AbstractHdf5Access::mIsUnlimitedDimensionSet, AbstractHdf5Access::mUnlimitedDatasetId, and PossiblyExtend().
Referenced by VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), ExtendedBidomainProblem< DIM >::save(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
void Hdf5DataWriter::PutVector | ( | int | variableID, |
Vec | petscVector | ||
) |
Write data for a given variable from a PETSc vector to the dataset.
variableID | the variable id of the column in the HDF5 file |
petscVector | the data |
Definition at line 722 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::DATASET_DIMS, PetscTools::Destroy(), EXCEPTION, mCurrentTimeStep, mDataCache, mDataFixedDimensionSize, AbstractHdf5Access::mDatasetDims, mIncompletePermIndices, AbstractHdf5Access::mIsDataComplete, mIsInDefineMode, AbstractHdf5Access::mIsUnlimitedDimensionSet, mLo, mNumberOwned, mOffset, mSinglePermutation, mUseCache, AbstractHdf5Access::mVariablesDatasetId, and PossiblyExtend().
Referenced by VoltageInterpolaterOntoMechanicsMesh< DIM >::VoltageInterpolaterOntoMechanicsMesh(), AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::save(), and PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
void Hdf5DataWriter::SetAlignment | ( | hsize_t | alignment | ) |
Set the alignment parameter to pass through to H5Pset_alignment. Every file object will be aligned on the disk to a multiple of this parameter. See the H5P docs for more information.
Especially useful with SetTargetChunkSize to ensure each chunk (each chunk is an 'file object') is aligned to a disk stripe on a striped file system with minimal wastage.
This method only has an effect when creating a NEW HDF5 FILE. Must be called in define mode with extendData set to False.
alignment | Alignment (bytes) |
Definition at line 1390 of file Hdf5DataWriter.cpp.
References EXCEPTION, mAlignment, mIsInDefineMode, and mUseExistingFile.
|
private |
This method sets the chunk size by building up in each dimension until a threshold is reached, unless user-specified values have been set using SetFixedChunkSize. By default, chunks of 128 K are used, which seems to be a good compromise. For large problems performance will usually improve by increasing this value (to e.g. 1 M).
Note: The public method for altering the algorithm's target chunk size is SetTargetChunkSize.
Definition at line 1332 of file Hdf5DataWriter.cpp.
References CalculateChunkDims(), CalculateNumberOfChunks(), AbstractHdf5Access::DATASET_DIMS, mChunkSize, mChunkTargetSize, mFixedChunkSize, mNumberOfChunks, and mUseOptimalChunkSizeAlgorithm.
Referenced by EndDefineMode().
void Hdf5DataWriter::SetFixedChunkSize | ( | const unsigned & | rTimestepsPerChunk, |
const unsigned & | rNodesPerChunk, | ||
const unsigned & | rVariablesPerChunk | ||
) |
Use a particular chunk size, ignoring the algorithm that figures out a sensible value.
This method may be useful in very specific circumstances, e.g. if you want chunks to align perfectly with stripes on a Lustre file system, or if you have a parallel problem where every process can be assigned the same size and shape hyperslab of the HDF5 file (thus getting rid of contention between processes when reading/writing).
USE WITH CAUTION - as it can degrade performance.
rTimestepsPerChunk | The number of unlimited dimension steps (usually time steps) per chunk. |
rNodesPerChunk | The number of objects (usually nodes) per chunk in the second dimension. |
rVariablesPerChunk | The number of objects (usually output variables) per chunk in the third dimension. |
Definition at line 1285 of file Hdf5DataWriter.cpp.
References mFixedChunkSize, mIsInDefineMode, and mUseOptimalChunkSizeAlgorithm.
void Hdf5DataWriter::SetTargetChunkSize | ( | hsize_t | targetSize | ) |
Adjust the target (max) chunk size in the chunking algorithm. Useful when one knows roughly how big a chunk should be but doesn't care about the exact dimensions or shape. Default is 128 K.
Especially useful with SetAlignment for ensuring each chunk gets its own stripe on striped file systems.
This method only has an effect when creating a NEW DATASET. Must be called in define mode.
targetSize | Max chunk size (bytes) |
Definition at line 1379 of file Hdf5DataWriter.cpp.
References EXCEPTION, mChunkTargetSize, and mIsInDefineMode.
Referenced by PostProcessingWriter< ELEMENT_DIM, SPACE_DIM >::WriteOutputDataToHdf5().
void Hdf5DataWriter::WriteCache | ( | ) |
Write the cache to disk.
Definition at line 996 of file Hdf5DataWriter.cpp.
References AbstractHdf5Access::DATASET_DIMS, mCacheFirstTimeStep, mCurrentTimeStep, mDataCache, AbstractHdf5Access::mDatasetDims, mNumberOwned, mOffset, AbstractHdf5Access::mVariablesDatasetId, and PetscTools::ReplicateBool().
Referenced by AdvanceAlongUnlimitedDimension(), and Close().
|
friend |
Definition at line 50 of file Hdf5DataWriter.hpp.
|
private |
User-provided alignment parameter
Definition at line 84 of file Hdf5DataWriter.hpp.
Referenced by OpenFile(), and SetAlignment().
|
private |
Coordinate to keep track of cache writes
Definition at line 87 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), and WriteCache().
|
private |
Stores chunk dimensions
Definition at line 79 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), AdvanceAlongUnlimitedDimension(), CalculateChunkDims(), CalculateNumberOfChunks(), EndDefineMode(), and SetChunkSize().
|
private |
User-provided target chunk size (for the algorithm)
Definition at line 82 of file Hdf5DataWriter.hpp.
Referenced by SetChunkSize(), and SetTargetChunkSize().
|
private |
Whether to wipe the output directory
Definition at line 56 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), and OpenFile().
|
private |
The current time step.
Definition at line 73 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), AdvanceAlongUnlimitedDimension(), EmptyDataset(), PutStripedVector(), PutUnlimitedVariable(), PutVector(), and WriteCache().
|
private |
Cache results here before writing
Definition at line 88 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), EndDefineMode(), PutStripedVector(), PutVector(), and WriteCache().
|
private |
The size of the fixed dimension (size of the vector of nodes)
Definition at line 63 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), ApplyPermutation(), DefineFixedDimension(), PutStripedVector(), and PutVector().
|
private |
Stores a permutation of a striped structure (u_0 v_0 u_1 v_1) as a matrix
Definition at line 76 of file Hdf5DataWriter.hpp.
Referenced by ~Hdf5DataWriter(), ApplyPermutation(), and PutStripedVector().
|
private |
An estimate of the unlimited dimension length for performance reasons.
Definition at line 61 of file Hdf5DataWriter.hpp.
Referenced by AdvanceAlongUnlimitedDimension(), DefineUnlimitedDimension(), EndDefineMode(), and OpenFile().
|
private |
The size of the fixed dimension (number of rows)
Definition at line 62 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), ApplyPermutation(), DefineFixedDimension(), DefineFixedDimension(), EndDefineMode(), and OpenFile().
|
private |
User-provided chunk size
Definition at line 81 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), SetChunkSize(), and SetFixedChunkSize().
|
private |
Local ownership of a PETSc vector of size mFileFixedDimensionSize
Definition at line 65 of file Hdf5DataWriter.hpp.
Referenced by ApplyPermutation(), ComputeIncompleteOffset(), and DefineFixedDimension().
|
private |
The actual runtime indices of the incomplete data nodes (used when running in parallel and a permutation has been applied)
Definition at line 68 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), ComputeIncompleteOffset(), DefineFixedDimension(), PutStripedVector(), and PutVector().
|
private |
Is the fixed dimension set
Definition at line 59 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), DefineFixedDimension(), and EndDefineMode().
|
private |
Is the DataWriter in define mode or not
Definition at line 58 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), ApplyPermutation(), Close(), DefineFixedDimension(), DefineUnlimitedDimension(), DefineVariable(), EndDefineMode(), IsInDefineMode(), PutStripedVector(), PutUnlimitedVariable(), PutVector(), SetAlignment(), SetFixedChunkSize(), and SetTargetChunkSize().
|
private |
Local ownership of a PETSc vector of size mFileFixedDimensionSize
Definition at line 64 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), ApplyPermutation(), ComputeIncompleteOffset(), DefineFixedDimension(), PutStripedVector(), and PutVector().
|
private |
Used so that the data set is only extended when data is written
Definition at line 69 of file Hdf5DataWriter.hpp.
Referenced by AdvanceAlongUnlimitedDimension(), EmptyDataset(), and PossiblyExtend().
|
private |
The total number of chunks in the dataset
Definition at line 80 of file Hdf5DataWriter.hpp.
Referenced by SetChunkSize().
|
private |
mNumberOwned=mHi-mLo; except with incomplete data
Definition at line 66 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), ComputeIncompleteOffset(), DefineFixedDimension(), EndDefineMode(), PutStripedVector(), PutVector(), and WriteCache().
|
private |
mOffset=mLo; except with incomplete data
Definition at line 67 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), ComputeIncompleteOffset(), DefineFixedDimension(), PutStripedVector(), PutVector(), and WriteCache().
|
private |
The factory to use in creating PETSc Vec and DistributedVector objects.
Definition at line 54 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), and DefineFixedDimension().
|
private |
Stores a permutation as a matrix
Definition at line 75 of file Hdf5DataWriter.hpp.
Referenced by ~Hdf5DataWriter(), ApplyPermutation(), and PutVector().
|
private |
Whether to use a cache
Definition at line 86 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), AdvanceAlongUnlimitedDimension(), Close(), EndDefineMode(), GetUsingCache(), PutStripedVector(), and PutVector().
|
private |
Whether we are using an existing file (for extending existing dataset, or adding a new one)
Definition at line 57 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), OpenFile(), and SetAlignment().
|
private |
Whether to use the built-in algorithm for optimal chunk size
Definition at line 78 of file Hdf5DataWriter.hpp.
Referenced by SetChunkSize(), and SetFixedChunkSize().
|
private |
The data variables
Definition at line 71 of file Hdf5DataWriter.hpp.
Referenced by Hdf5DataWriter(), DefineVariable(), EndDefineMode(), GetVariableByName(), and OpenFile().