GEOSX
Public Member Functions | List of all members
geos::HDFHistoryIO Class Reference

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

#include <HDFHistoryIO.hpp>

Inheritance diagram for geos::HDFHistoryIO:
Inheritance graph
[legend]

Public Member Functions

 HDFHistoryIO (string const &filename, localIndex rank, std::vector< localIndex > const &dims, string const &name, std::type_index typeId, localIndex writeHead=0, localIndex initAlloc=1, localIndex overallocMultiple=2, MPI_Comm comm=MPI_COMM_GEOSX)
 Constructor. More...
 
 HDFHistoryIO (string const &filename, const HistoryMetadata &spec, localIndex writeHead=0, localIndex initAlloc=1, localIndex overallocMultiple=2, MPI_Comm comm=MPI_COMM_GEOSX)
 Constructor. More...
 
virtual ~HDFHistoryIO ()
 Destructor.
 
virtual buffer_unit_typegetBufferHead () override
 Get the head of the internal history storage buffer. More...
 
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...
 
virtual void updateCollectingCount (localIndex count) override
 Update the number of items being stored for IO in this object. More...
 
localIndex getBufferedCount () override
 Query the number of history states currently stored in the internal buffer. More...
 
- Public Member Functions inherited from geos::BufferedHistoryIO
virtual ~BufferedHistoryIO ()
 Destructor.
 

Detailed Description

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

Definition at line 32 of file HDFHistoryIO.hpp.

Constructor & Destructor Documentation

◆ HDFHistoryIO() [1/2]

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

Constructor.

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

◆ HDFHistoryIO() [2/2]

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

Constructor.

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

Definition at line 66 of file HDFHistoryIO.hpp.

Member Function Documentation

◆ compressInFile()

virtual void geos::HDFHistoryIO::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 geos::BufferedHistoryIO.

◆ getBufferedCount()

localIndex geos::HDFHistoryIO::getBufferedCount ( )
inlineoverridevirtual

Query the number of history states currently stored in the internal buffer.

Returns
The number of discrete time history records buffered to be written.
Note
Since the size of each discrete time history can change, this should not be used to calculate size, but is useful to check for consistency between collectors that should be operating at the same cadence (ie the time collector and the data collector).
Deprecated:
Also, note that this member function is related to restarting HDF5 files. Which means that getting this information popping through the abstract interface is a shortcut that should eventually be fixed by keeping this information in the HDF5 buffer.

Implements geos::BufferedHistoryIO.

Definition at line 100 of file HDFHistoryIO.hpp.

◆ getBufferHead()

virtual buffer_unit_type* geos::HDFHistoryIO::getBufferHead ( )
overridevirtual

Get the head of the internal history storage buffer.

Returns
The head of the internal history storage buffer to be written to.

Implements geos::BufferedHistoryIO.

◆ init()

virtual void geos::HDFHistoryIO::init ( bool  existsOkay)
overridevirtual

Perform and intialization needed for time-history output.

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

Implements geos::BufferedHistoryIO.

◆ updateCollectingCount()

virtual void geos::HDFHistoryIO::updateCollectingCount ( localIndex  count)
overridevirtual

Update the number of items being stored for IO in this object.

Parameters
count[in] The new number of items being collected

Implements geos::BufferedHistoryIO.

◆ write()

virtual void geos::HDFHistoryIO::write ( )
overridevirtual

Write the buffered history data to the output target.

Implements geos::BufferedHistoryIO.


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