libSplash
|
Classes | |
struct | _DCEntry |
struct | _FileCreationAttr |
Public Types | |
enum | FileAccType { FAT_CREATE, FAT_READ, FAT_READ_MERGED, FAT_WRITE } |
typedef struct splash::DataCollector::_FileCreationAttr | FileCreationAttr |
typedef struct splash::DataCollector::_DCEntry | DCEntry |
Public Member Functions | |
virtual | ~DataCollector () |
virtual void | open (const char *filename, FileCreationAttr &attr)=0 |
virtual void | close ()=0 |
virtual int32_t | getMaxID ()=0 |
virtual void | getMPISize (Dimensions &mpiSize)=0 |
virtual void | getEntryIDs (int32_t *ids, size_t *count)=0 |
virtual void | getEntriesForID (int32_t id, DCEntry *entries, size_t *count)=0 |
virtual void | write (int32_t id, const CollectionType &type, uint32_t ndims, const Selection select, const char *name, const void *buf)=0 |
virtual void | append (int32_t id, const CollectionType &type, size_t count, const char *name, const void *buf)=0 |
virtual void | append (int32_t id, const CollectionType &type, size_t count, size_t offset, size_t stride, const char *name, const void *buf)=0 |
virtual void | remove (int32_t id)=0 |
virtual void | remove (int32_t id, const char *name)=0 |
virtual void | createReference (int32_t srcID, const char *srcName, int32_t dstID, const char *dstName)=0 |
virtual void | createReference (int32_t srcID, const char *srcName, int32_t dstID, const char *dstName, Dimensions count, Dimensions offset, Dimensions stride)=0 |
virtual AttributeInfo | readGlobalAttributeInfo (int32_t id, const char *name, Dimensions *mpiPosition=NULL)=0 |
virtual void | readGlobalAttribute (const char *name, void *buf, Dimensions *mpiPosition=NULL)=0 |
virtual void | writeGlobalAttribute (const CollectionType &type, const char *name, const void *buf)=0 |
virtual void | writeGlobalAttribute (const CollectionType &type, const char *name, uint32_t ndims, const Dimensions dims, const void *buf)=0 |
virtual AttributeInfo | readAttributeInfo (int32_t id, const char *dataName, const char *attrName, Dimensions *mpiPosition=NULL)=0 |
virtual void | readAttribute (int32_t id, const char *dataName, const char *attrName, void *buf, Dimensions *mpiPosition=NULL)=0 |
virtual void | writeAttribute (int32_t id, const CollectionType &type, const char *dataName, const char *attrName, const void *buf)=0 |
virtual void | writeAttribute (int32_t id, const CollectionType &type, const char *dataName, const char *attrName, uint32_t ndims, const Dimensions dims, const void *buf)=0 |
virtual void | read (int32_t id, const char *name, Dimensions &sizeRead, void *buf)=0 |
virtual void | read (int32_t id, const char *name, const Dimensions dstBuffer, const Dimensions dstOffset, Dimensions &sizeRead, void *buf)=0 |
virtual CollectionType * | readMeta (int32_t id, const char *name, const Dimensions dstBuffer, const Dimensions dstOffset, Dimensions &sizeRead)=0 |
Static Public Member Functions | |
static void | initFileCreationAttr (FileCreationAttr &attr) |
Definition at line 61 of file DataCollector.hpp.
typedef struct splash::DataCollector::_DCEntry splash::DataCollector::DCEntry |
Information on a specific dataset in a HDF5 file.
Attributes passed when calling DataCollector#open
flags for opening files
Definition at line 68 of file DataCollector.hpp.
|
inlinevirtual |
Destructor
Definition at line 141 of file DataCollector.hpp.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::IParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::IParallelDataCollector.
|
pure virtual |
Closes open files and releases internal buffers.
Must be called by user when finished writing/reading data.
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure virtual |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure virtual |
Returns the MPI topology used for creating files.
mpiSize | Contains MPI topology. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
inlinestatic |
Initializes FileCreationAttr with default values. (compression = false, access type = FAT_CREATE, position = (0, 0, 0), size = (1, 1, 1))
attr | file attributes to initialize |
Definition at line 130 of file DataCollector.hpp.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::IParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure virtual |
Removes a simulation iteration from the HDF5 file.
Recursively removes all datasets and attributes within the iteration.
id | ID to remove. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure virtual |
Removes a dataset from a HDF5 file.
id | ID holding the dataset to be removed. |
name | Name of the dataset to be removed. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, splash::ParallelDataCollector, and splash::IParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::ParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::IParallelDataCollector.
|
pure 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. |
Implemented in splash::SerialDataCollector, and splash::IParallelDataCollector.