| kspaceFirstOrder3D-CUDA 1.1 The CUDA/C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TWholeDomainOutputHDF5Stream Class Reference

Output stream for quantities sampled in the whole domain. More...

`#include <WholeDomainOutputHDF5Stream.h>`

Inheritance diagram for TWholeDomainOutputHDF5Stream:
[legend]
Collaboration diagram for TWholeDomainOutputHDF5Stream:
[legend]

## Public Member Functions
| TWholeDomainOutputHDF5Stream (THDF5_File &file, TMatrixName &datasetName, TRealMatrix &sourceMatrix, const TReduceOperator reduceOp)
| Constructor. More...
virtual | ~TWholeDomainOutputHDF5Stream ()
| Destructor. More...
virtual void | Create ()
| Create a HDF5 stream and allocate data for it. More...
virtual void | Reopen ()
| Reopen the output stream after restart and reload data. More...
virtual void | Sample ()
| Sample data (copy from GPU memory and then flush - no overlapping implemented!) More...
virtual void | FlushRaw ()
| Flush data to disk (from raw streams only) - empty routine (no overlapping implemented)
virtual void | PostProcess ()
| Apply post-processing on the buffer and flush it to the file. More...
virtual void | Checkpoint ()
virtual void | Close ()
| Close stream (apply post-processing if necessary, flush data and close). More...
Public Member Functions inherited from TBaseOutputHDF5Stream
| TBaseOutputHDF5Stream (THDF5_File &file, TMatrixName &rootObjectName, const TRealMatrix &sourceMatrix, const TReduceOperator reduceOp)
| Constructor. More...
virtual | ~TBaseOutputHDF5Stream ()
| Destructor.

## Protected Member Functions
virtual void | FlushBufferToFile ()
| Flush the buffer to the file. More...
Protected Member Functions inherited from TBaseOutputHDF5Stream
| TBaseOutputHDF5Stream ()
| Default constructor not allowed.
| TBaseOutputHDF5Stream (const TBaseOutputHDF5Stream &src)
| Copy constructor not allowed.
TBaseOutputHDF5Stream & | operator= (const TBaseOutputHDF5Stream &src)
| Operator = not allowed (we don't want any data movements).
virtual void | AllocateMemory ()
| A generic function to allocate memory - not used in the base class. More...
virtual void | FreeMemory ()
| A generic function to free memory - not used in the base class. More...
virtual void | CopyDataToDevice ()
| Copy data hostBuffer-> deviceBuffer. More...
virtual void | CopyDataFromDevice ()
| Copy data deviceBuffer -> hostBuffer. More...

## Protected Attributes
hid_t | dataset
| Handle to a HDF5 dataset.
size_t | sampledTimeStep
| Time step to store (N/A for aggregated).
Protected Attributes inherited from TBaseOutputHDF5Stream
THDF5_File & | file
| HDF5 file handle.
std::string | rootObjectName
| Dataset name.
const TRealMatrix & | sourceMatrix
| Source matrix to be sampled.
hid_t | dataset
| HDF5 dataset handle.
const TReduceOperator | reduceOp
| Reduce operator.
TDimensionSizes | position
| Position in the dataset.
size_t | bufferSize
| Buffer size.
float * | hostBuffer
| Temporary buffer for store on the GPU side.
float * | deviceBuffer
| Temporary buffer on the GPU side - only for aggregated quantities.

## Additional Inherited Members
Public Types inherited from TBaseOutputHDF5Stream
enum | TReduceOperator { NONE, RMS, MAX, MIN }
| How to aggregate data. More...
Static Protected Attributes inherited from TBaseOutputHDF5Stream
static const size_t | CHUNK_SIZE_4MB = 1048576
| chunk size of 4MB in number of float elements
static const size_t | MIN_GRIDPOINTS_TO_SAMPLE_IN_PARALLEL = 1048576
| The minimum number of elements to start sampling in parallel (4MB)

## Detailed Description

Output stream for quantities sampled in the whole domain. The data is stored in a single dataset (aggregated quantities only).

Definition at line 44 of file WholeDomainOutputHDF5Stream.h.

## Constructor & Destructor Documentation

TWholeDomainOutputHDF5Stream::TWholeDomainOutputHDF5Stream | ( | THDF5_File & | file,
|  | TMatrixName & | datasetName,
|  | TRealMatrix & | sourceMatrix,
|  | const TReduceOperator | reduceOp
| ) |  |

Constructor - links the HDF5 dataset and SourceMatrix

Parameters

  [in] | file | - HDF5 file to write the output to
  [in] | datasetName | - The name of the HDF5 group containing datasets for particular cuboids
  [in] | sourceMatrix | - Source matrix to be sampled
  [in] | reduceOp | - Reduce operator

Definition at line 53 of file WholeDomainOutputHDF5Stream.cpp.

TWholeDomainOutputHDF5Stream::~TWholeDomainOutputHDF5Stream | ( |  | ) |
| virtual

Destructor. If the file is still opened, it applies the post processing and flush the data. Then, the object memory is freed and the object destroyed.

Definition at line 71 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

## Member Function Documentation

void TWholeDomainOutputHDF5Stream::Checkpoint | ( |  | ) |
| virtual

Checkpoint the stream.

Implements TBaseOutputHDF5Stream.

Definition at line 237 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::Close | ( |  | ) |
| virtual

Close stream (apply post-processing if necessary, flush data and close).

Implements TBaseOutputHDF5Stream.

Definition at line 250 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TWholeDomainOutputHDF5Stream::Create | ( |  | ) |
| virtual

Create a HDF5 stream for the whole domain and allocate data for it.

Implements TBaseOutputHDF5Stream.

Definition at line 84 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::FlushBufferToFile | ( |  | ) |
| protected virtual

Flush the buffer down to the file at the actual position.

Definition at line 271 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void TWholeDomainOutputHDF5Stream::PostProcess | ( |  | ) |
| virtual

Apply post-processing on the buffer and flush it to the file.

Reimplemented from TBaseOutputHDF5Stream.

Definition at line 217 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::Reopen | ( |  | ) |
| virtual

Reopen the output stream after restart and reload data

Implements TBaseOutputHDF5Stream.

Definition at line 113 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

void TWholeDomainOutputHDF5Stream::Sample | ( |  | ) |
| virtual

Sample all grid points, line them up in the buffer an flush to the disk unless a reduce operator is applied

Implements TBaseOutputHDF5Stream.

Definition at line 154 of file WholeDomainOutputHDF5Stream.cpp.

Here is the call graph for this function:

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

- OutputHDF5Streams/WholeDomainOutputHDF5Stream.h
- OutputHDF5Streams/WholeDomainOutputHDF5Stream.cpp