libSplash
|
#include <SerialDataCollector.hpp>
Public Member Functions | |
SerialDataCollector (uint32_t maxFileHandles) | |
virtual | ~SerialDataCollector () |
void | open (const char *filename, FileCreationAttr &attr) throw (DCException) |
void | close () |
int32_t | getMaxID () |
void | getMPISize (Dimensions &mpiSize) |
void | getEntryIDs (int32_t *ids, size_t *count) throw (DCException) |
void | getEntriesForID (int32_t id, DCEntry *entries, size_t *count) throw (DCException) |
void | write (int32_t id, const CollectionType &type, uint32_t ndims, const Selection select, const char *name, const void *data) throw (DCException) |
void | append (int32_t id, const CollectionType &type, size_t count, const char *name, const void *data) throw (DCException) |
void | append (int32_t id, const CollectionType &type, size_t count, size_t offset, size_t striding, const char *name, const void *data) throw (DCException) |
void | remove (int32_t id) throw (DCException) |
void | remove (int32_t id, const char *name) throw (DCException) |
void | createReference (int32_t srcID, const char *srcName, int32_t dstID, const char *dstName) throw (DCException) |
void | createReference (int32_t srcID, const char *srcName, int32_t dstID, const char *dstName, Dimensions count, Dimensions offset, Dimensions stride) throw (DCException) |
AttributeInfo | readGlobalAttributeInfo (int32_t id, const char *name, Dimensions *mpiPosition=NULL) throw (DCException) |
void | readGlobalAttribute (const char *name, void *data, Dimensions *mpiPosition=NULL) throw (DCException) |
void | writeGlobalAttribute (const CollectionType &type, const char *name, const void *data) throw (DCException) |
void | writeGlobalAttribute (const CollectionType &type, const char *name, uint32_t ndims, const Dimensions dims, const void *data) throw (DCException) |
AttributeInfo | readAttributeInfo (int32_t id, const char *dataName, const char *attrName, Dimensions *mpiPosition=NULL) throw (DCException) |
void | readAttribute (int32_t id, const char *dataName, const char *attrName, void *data, Dimensions *mpiPosition=NULL) throw (DCException) |
void | writeAttribute (int32_t id, const CollectionType &type, const char *dataName, const char *attrName, const void *data) throw (DCException) |
void | writeAttribute (int32_t id, const CollectionType &type, const char *dataName, const char *attrName, uint32_t ndims, const Dimensions dims, const void *data) throw (DCException) |
void | read (int32_t id, const char *name, Dimensions &sizeRead, void *data) throw (DCException) |
void | read (int32_t id, const char *name, const Dimensions dstBuffer, const Dimensions dstOffset, Dimensions &sizeRead, void *data) throw (DCException) |
CollectionType * | readMeta (int32_t id, const char *name, const Dimensions dstBuffer, const Dimensions dstOffset, Dimensions &sizeRead) throw (DCException) |
![]() | |
virtual | ~DataCollector () |
Additional Inherited Members | |
![]() | |
enum | FileAccType { FAT_CREATE, FAT_READ, FAT_READ_MERGED, FAT_WRITE } |
typedef struct splash::DataCollector::_FileCreationAttr | FileCreationAttr |
typedef struct splash::DataCollector::_DCEntry | DCEntry |
![]() | |
static void | initFileCreationAttr (FileCreationAttr &attr) |
Realizes a DataCollector which creates an HDF5 file for each MPI process.
See DataCollector interface for function documentation.
Definition at line 45 of file SerialDataCollector.hpp.
splash::SerialDataCollector::SerialDataCollector | ( | uint32_t | maxFileHandles | ) |
Constructor
maxFileHandles | Maximum number of concurrently opened file handles (0=unlimited). |
Definition at line 107 of file SerialDataCollector.cpp.
|
virtual |
Destructor
Definition at line 134 of file SerialDataCollector.cpp.
|
virtual |
Appends 1-dimensional data in a HDF5 file.
The target dataset is created if necessary. If it already exists, data is appended to the end.
id | ID for iteration. |
type | Type information for data. |
count | Number of elements to append. |
name | Name for the dataset to create/append. |
buf | Buffer to append. |
Implements splash::DataCollector.
Definition at line 552 of file SerialDataCollector.cpp.
|
virtual |
Appends 1-dimensional data in a HDF5 file using striding.
The target dataset is created if necessary. If it already exists, data is appended to the end. The data is read using striding from source buffer buf
.
id | id for fileentry. e.g. iteration |
type | Type information for data. |
count | Number of elements to append. |
offset | Offset in elements to start reading from in buf . |
stride | Striding to be used for reading from buf , 1 means 'no striding'. buf must contain at least (striding * count) elements. |
name | Name for the dataset to create/append. |
buf | Buffer to append. |
Implements splash::DataCollector.
Definition at line 559 of file SerialDataCollector.cpp.
|
virtual |
Closes open files and releases internal buffers.
Must be called by user when finished writing/reading data.
Implements splash::DataCollector.
Definition at line 167 of file SerialDataCollector.cpp.
|
virtual |
Creates an object reference to an existing dataset in the same HDF5 file.
srcID | ID of the iteration holding the source dataset. |
srcName | Name of the existing source dataset. |
dstID | ID of the simulation iteration holding the created reference dataset. If this group does not exist, it is created. |
dstName | Name of the created reference. |
Implements splash::DataCollector.
Definition at line 642 of file SerialDataCollector.cpp.
|
virtual |
Creates a dataset region reference to an existing dataset in the same HDF5 file.
srcID | ID of the iteration holding the source dataset. |
srcName | Name of the existing source dataset. |
dstID | ID of the simulation iteration holding the created reference dataset. If this group does not exist, it is created. |
dstName | Name of the created reference. |
count | Number of elements referenced from the source dataset. |
offset | Offset in elements in the source dataset. |
stride | Striding in elements in the source dataset. |
Implements splash::DataCollector.
Definition at line 692 of file SerialDataCollector.cpp.
|
virtual |
Returns all datasets for an ID. The caller must ensure that there is enough space in entries
to hold count
elements.
id | ID for iteration. |
entries | Pointer to an array with at least count elements, can be NULL. |
count | Returns the number of elements in entries , can be NULL. |
Implements splash::DataCollector.
Definition at line 791 of file SerialDataCollector.cpp.
|
virtual |
Returns all IDs in an opened file. The caller must ensure that there is enough space in ids
to hold count
elements.
ids | Pointer to an array with at least count entries, can be NULL. |
count | Returns the number of entries in ids , can be NULL. |
Implements splash::DataCollector.
Definition at line 755 of file SerialDataCollector.cpp.
|
virtual |
Implements splash::DataCollector.
Definition at line 745 of file SerialDataCollector.cpp.
|
virtual |
Returns the MPI topology used for creating files.
mpiSize | Contains MPI topology. |
Implements splash::DataCollector.
Definition at line 750 of file SerialDataCollector.cpp.
|
virtual |
Opens one or multiple files.
filename | Name of the file(s) to open (the common part without index identifiers). |
attr | Struct passing several parameters on how to access files. |
Implements splash::DataCollector.
Definition at line 139 of file SerialDataCollector.cpp.
|
virtual |
Reads data from HDF5 file. If data is to be read (instead of only its size in the file), the destination buffer (buf
) must be allocated already.
id | ID for iteration. |
name | Name for the dataset. |
sizeRead | Returns the size of the data in the file. |
buf | Buffer to read from file, can be NULL. |
Implements splash::DataCollector.
Definition at line 480 of file SerialDataCollector.cpp.
|
virtual |
Reads data from HDF5 file. If data is to be read (instead of only its size in the file), the destination buffer (buf
) must be allocated already.
id | ID for iteration. |
name | Name for the dataset. |
dstBuffer | Size of the buffer buf to read to. |
dstOffset | Offset in destination buffer to read to. |
sizeRead | Returns the size of the data in the file. |
buf | Buffer to read from file, can be NULL. |
Implements splash::DataCollector.
Definition at line 489 of file SerialDataCollector.cpp.
|
virtual |
Reads an attribute from a single dataset.
id | ID for iteration. |
dataName | Name of the dataset in group id to read attribute from. If dataName is NULL, the attribute is read from the iteration group. |
attrName | Name of the attribute. |
buf | Buffer to read attribute to. |
mpiPosition | Pointer to Dimensions class. Identifies MPI-position-specific file while in FAT_READ_MERGED mode. Use NULL to read from default file index. |
Implements splash::DataCollector.
Definition at line 370 of file SerialDataCollector.cpp.
|
virtual |
Reads attribute meta data from a single dataset.
id | ID for iteration. |
dataName | Name of the dataset in group id to read attribute from. If dataName is NULL, the attribute is read from the iteration group. |
attrName | Name of the attribute. |
mpiPosition | Pointer to Dimensions class. Identifies MPI-position-specific file while in FAT_READ_MERGED mode. Use NULL to read from default file index. |
Implements splash::DataCollector.
Definition at line 347 of file SerialDataCollector.cpp.
|
virtual |
Reads global attribute from HDF5 file.
name | Name for the attribute. |
buf | Buffer to read attribute to. |
mpiPosition | Pointer to Dimensions class. Identifies MPI-position-specific custom group. Use NULL to read from default group. |
Implements splash::DataCollector.
Definition at line 287 of file SerialDataCollector.cpp.
|
virtual |
Reads global attribute meta information from HDF5 file.
id | ID for iteration. |
name | Name for the attribute. |
mpiPosition | Pointer to Dimensions class. Identifies MPI-position-specific custom group. Use NULL to read from default group. |
Implements splash::DataCollector.
Definition at line 271 of file SerialDataCollector.cpp.
|
virtual |
Reads meta data from HDF5 file.
id | ID of iteration. |
name | Name of the dataset. |
dstBuffer | Size of the dataset. |
dstOffset | Offset in destination dataset. |
sizeRead | Returns the size of the data in the file. |
Implements splash::DataCollector.
Definition at line 505 of file SerialDataCollector.cpp.
|
virtual |
Removes a simulation iteration from the HDF5 file.
Recursively removes all datasets and attributes within the iteration.
id | ID to remove. |
Implements splash::DataCollector.
Definition at line 589 of file SerialDataCollector.cpp.
|
virtual |
Removes a dataset from a HDF5 file.
id | ID holding the dataset to be removed. |
name | Name of the dataset to be removed. |
Implements splash::DataCollector.
Definition at line 618 of file SerialDataCollector.cpp.
|
virtual |
Writes data to HDF5 file.
id | ID for iteration. |
type | Type information for data. |
ndims | Number of dimensions (1-3). |
select | Selection in src buffer |
name | Name for the dataset. |
buf | Buffer for writing. |
Implements splash::DataCollector.
Definition at line 520 of file SerialDataCollector.cpp.
|
virtual |
Writes an attribute to a single dataset.
id | ID for iteration. |
type | Type information for data. |
dataName | Name of the dataset in group id to write attribute to. If dataName is NULL, the attribute is written for the iteration group. If the path dataName does not yet exist, missing groups will be created. |
attrName | Name of the attribute. |
buf | Buffer to be written as attribute. |
Implements splash::DataCollector.
Definition at line 394 of file SerialDataCollector.cpp.
|
virtual |
Writes an attribute to a single dataset.
id | ID for iteration. |
type | Type information for data. |
dataName | Name of the dataset in group id to write attribute to. If dataName is NULL, the attribute is written for the iteration group. |
attrName | Name of the attribute. |
ndims | Number of dimensions (1-3) |
dims | Number of elements |
buf | Buffer to be written as attribute. |
Implements splash::DataCollector.
Definition at line 406 of file SerialDataCollector.cpp.
|
virtual |
Writes global attribute to HDF5 file (default group).
type | Type information for data. |
name | Name of the attribute. |
buf | Buffer to be written as attribute. |
Implements splash::DataCollector.
Definition at line 309 of file SerialDataCollector.cpp.
|
virtual |
Writes global attribute to HDF5 file (default group).
type | Type information for data. |
name | Name of the attribute. |
ndims | Number of dimensions (1-3) |
dims | Number of elements |
buf | Buffer to be written as attribute. |
Implements splash::DataCollector.
Definition at line 318 of file SerialDataCollector.cpp.