GEOSX
Public Member Functions | Protected Member Functions | List of all members
geosx::HDFHistIO Class Reference

Perform buffered history I/O for a single type(really just output) on using HDF5. More...

#include <TimeHistHDF.hpp>

Inheritance diagram for geosx::HDFHistIO:
Inheritance graph
[legend]

Public Member Functions

 HDFHistIO (string const &filename, localIndex rank, std::vector< localIndex > const &dims, string const &name, std::type_index typeId, localIndex writeHead=0, localIndex initAlloc=2, localIndex overallocMultiple=2, MPI_Comm comm=MPI_COMM_GEOSX)
 Constructor. More...
 
 HDFHistIO (string const &filename, const HistoryMetadata &spec, localIndex writeHead=0, localIndex initAlloc=2, localIndex overallocMultiple=2, MPI_Comm comm=MPI_COMM_GEOSX)
 Constructor. More...
 
virtual ~HDFHistIO ()
 Destructor.
 
virtual void init (bool existsOkay) override
 Perform and intialization needed for time-history output. More...
 
virtual void write () override
 Write the buffered history data to the output target. More...
 
virtual void compressInFile () override
 Ensure the repressentation of the data in the output target is dense and terse. More...
 
void resizeFileIfNeeded (localIndex bufferedCount)
 Resize the dataspace in the target file if needed to perform the current write of buffered states. More...
 
- Public Member Functions inherited from geosx::BufferedHistoryIO
 BufferedHistoryIO ()
 Constructor.
 
virtual ~BufferedHistoryIO ()
 Destructor.
 
buffer_unit_typegetBufferHead ()
 Get the head of the internal history storage buffer. More...
 
localIndex getBufferedCount ()
 Query the number of history states currently stored in the internal buffer. More...
 

Protected Member Functions

virtual void resizeBuffer () override
 Resize the buffer to accomodate additional history collection.
 
- Protected Member Functions inherited from geosx::BufferedHistoryIO
void emptyBuffer ()
 Empty the history collection buffer.
 

Additional Inherited Members

- Protected Attributes inherited from geosx::BufferedHistoryIO
localIndex m_bufferedCount
 The current number of records in the buffer.
 
buffer_unit_typem_bufferHead
 The write head of the buffer.
 
buffer_type m_dataBuffer
 The data buffer containing the history info.
 

Detailed Description

Perform buffered history I/O for a single type(really just output) on using HDF5.

Definition at line 107 of file TimeHistHDF.hpp.

Constructor & Destructor Documentation

◆ HDFHistIO() [1/2]

geosx::HDFHistIO::HDFHistIO ( string const &  filename,
localIndex  rank,
std::vector< localIndex > const &  dims,
string const &  name,
std::type_index  typeId,
localIndex  writeHead = 0,
localIndex  initAlloc = 2,
localIndex  overallocMultiple = 2,
MPI_Comm  comm = MPI_COMM_GEOSX 
)

Constructor.

Parameters
filenameThe filename to perform history output to.
rankThe rank of the history data being collected.
dimsThe dimensional extent for each dimension of the history data being collected.
nameThe name to use to create/modify the dataset for the history data.
typeIdThe std::type_index(typeid(T)) of the underlying data type.
writeHeadHow many time history states have been written to the file (used on restart and to compress data on exit).
initAllocHow many states to preallocate the internal buffer to hold.
overallocMultipleInteger to scale the internal buffer when we fill the existing space.
commA communicator where every rank will participate in writting to the output file.

◆ HDFHistIO() [2/2]

geosx::HDFHistIO::HDFHistIO ( string const &  filename,
const HistoryMetadata spec,
localIndex  writeHead = 0,
localIndex  initAlloc = 2,
localIndex  overallocMultiple = 2,
MPI_Comm  comm = MPI_COMM_GEOSX 
)
inline

Constructor.

Parameters
filenameThe filename to perform history output to.
specHistoryMetadata to use to call the other constructor.
writeHeadHow many time states have been written to the file (used on restart and to compress data on exit).
initAllocHow many states to preallocate the internal buffer to hold.
overallocMultipleInteger to scale the internal buffer when we fill the existing space.
commA communicator where every rank will participate in writing to the output file.

Definition at line 141 of file TimeHistHDF.hpp.

Member Function Documentation

◆ compressInFile()

virtual void geosx::HDFHistIO::compressInFile ( )
overridevirtual

Ensure the repressentation of the data in the output target is dense and terse.

Note
Typically the file will be oversized to receive data writes without constant resizing.

Implements geosx::BufferedHistoryIO.

◆ init()

virtual void geosx::HDFHistIO::init ( bool  existsOkay)
overridevirtual

Perform and intialization needed for time-history output.

Parameters
existsOkayWhether it is acceptable for the intended output target to already exist ( false on start from scratch, true on restart ). data).

Implements geosx::BufferedHistoryIO.

◆ resizeFileIfNeeded()

void geosx::HDFHistIO::resizeFileIfNeeded ( localIndex  bufferedCount)
inline

Resize the dataspace in the target file if needed to perform the current write of buffered states.

Parameters
bufferedCountThe number of buffered states to use to determine if the file needs to be resized.

◆ write()

virtual void geosx::HDFHistIO::write ( )
overridevirtual

Write the buffered history data to the output target.

Implements geosx::BufferedHistoryIO.


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