57 float * bufferToReuse)
58 :
BaseOutputStream(file, datasetName, sourceMatrix, reduceOp, bufferToReuse),
59 sensorMask(sensorMask),
174 #pragma omp parallel for 195 #pragma omp parallel for 198 mStoreBuffer[i] += (sourceData[sensorData[i]] * sourceData[sensorData[i]]);
205 #pragma omp parallel for 215 #pragma omp parallel for virtual void reopen()
Reopen the output stream after restart and reload data.
hid_t openDataset(const hid_t parentGroup, MatrixName &datasetName)
Open a dataset at a specified place in the file tree.
Calculate root mean square.
The class for real matrices.
virtual void freeMemory()
Free memory.
virtual void create()
Create a HDF5 stream and allocate data for it.
size_t getCompressionLevel() const
Get compression level.
std::string mRootObjectName
HDF5 group/dataset in the output file where to store data in.
hid_t getRootGroup() const
Get handle to the root group of the file.
size_t getNt() const
Get total number of time steps.
const IndexMatrix & sensorMask
Sensor mask to sample data.
hid_t mDataset
Handle to a HDF5 dataset.
size_t mSampledTimeStep
Time step to store (N/A for aggregated).
virtual ~IndexOutputStream()
Destructor.
const ReduceOperator mReduceOp
Reduction operator.
virtual void close()
Close stream (apply post-processing if necessary, flush data and close).
Class storing all parameters of the simulation.
virtual void allocateMemory()
Allocate memory using proper memory alignment.
virtual void postProcess()
Apply post-processing on the buffer and flush it to the file.
virtual size_t * getData()
Get raw data out of the class (for direct kernel access).
virtual void postProcess()
Apply post-processing on the buffer and flush it to the file.
Store actual data (time series).
virtual size_t size() const
Size of the matrix.
The header file containing the parameters of the simulation.
void writeMatrixDomainType(const hid_t parentGroup, MatrixName &datasetName, const MatrixDomainType &matrixDomainType)
Write matrix data type into the dataset at a specified place in the file tree.
void closeDataset(const hid_t dataset)
Close dataset.
virtual void sample()
Sample data into buffer, apply reduction or flush to disk - based on a sensor mask.
void writeMatrixDataType(const hid_t parentGroup, MatrixName &datasetName, const MatrixDataType &matrixDataType)
Write matrix data type into the dataset at a specified place in the file tree.
size_t getSamplingStartTimeIndex() const
Get start time index when sensor data collection begins.
Class wrapping the HDF5 routines.
IndexOutputStream()=delete
Default constructor not allowed.
size_t mBufferSize
Buffer size.
void writeHyperSlab(const hid_t dataset, const DimensionSizes &position, const DimensionSizes &size, const T *data)
Write a hyperslab into the dataset.
const std::string MatrixName
Datatype for matrix names.
Structure with 4D dimension sizes (3 in space and 1 in time).
The matrix is stored in floating point 32b wide format.
Hdf5File & mFile
Handle to HDF5 output file.
size_t getTimeIndex() const
Get actual simulation time step.
const RealMatrix & mSourceMatrix
Source matrix to be sampled.
float * mStoreBuffer
Temporary buffer for store - only if Buffer Reuse = false!
ReduceOperator
How to aggregate data.
virtual float * getData()
Get raw data out of the class (for direct kernel access).
void readCompleteDataset(const hid_t parentGroup, MatrixName &datasetName, const DimensionSizes &dimensionSizes, T *data)
Read data from the dataset at a specified place in the file tree.
static Parameters & getInstance()
Get instance of the singleton class.
virtual void checkpoint()
Checkpoint the stream.
The class for 64b unsigned integers (indices). It is used for linear and cuboid corners masks to get ...
hid_t createDataset(const hid_t parentGroup, MatrixName &datasetName, const DimensionSizes &dimensionSizes, const DimensionSizes &chunkSizes, const MatrixDataType matrixDataType, const size_t compressionLevel)
Create a float HDF5 dataset at a specified place in the file tree (3D/4D).
static constexpr size_t kChunkSize4MB
chunk size of 4MB in number of float elements.
Abstract base class for output data streams (sampled data).
The header file of the class saving data based on the index senor mask into the output HDF5 file...
The matrix is defined on real domain.
bool mBufferReuse
if true, the container reuses another matrix as scratch place, e.g. Temp_1_RS3D, Temp_2_RS3D, Temp_3_RS3D.
virtual void flushBufferToFile()
Flush the buffer to the file.