libSplash
Public Member Functions | List of all members
splash::DomainCollector Class Reference

#include <DomainCollector.hpp>

Inheritance diagram for splash::DomainCollector:
Inheritance graph
[legend]
Collaboration diagram for splash::DomainCollector:
Collaboration graph
[legend]

Public Member Functions

 DomainCollector (uint32_t maxFileHandles)
 
virtual ~DomainCollector ()
 
Domain getGlobalDomain (int32_t id, const char *name) throw (DCException)
 
Domain getLocalDomain (int32_t id, const char *name) throw (DCException)
 
DataContainerreadDomain (int32_t id, const char *name, Domain domain, DomDataClass *dataClass, bool lazyLoad=false) throw (DCException)
 
void readDomainLazy (DomainData *domainData) throw (DCException)
 
void writeDomain (int32_t id, const CollectionType &type, uint32_t ndims, const Selection select, const char *name, const Domain localDomain, const Domain globalDomain, DomDataClass dataClass, const void *buf) throw (DCException)
 
void appendDomain (int32_t id, const CollectionType &type, size_t count, const char *name, const Domain localDomain, const Domain globalDomain, const void *buf) throw (DCException)
 
void appendDomain (int32_t id, const CollectionType &type, size_t count, size_t offset, size_t striding, const char *name, const Domain localDomain, const Domain globalDomain, const void *buf) throw (DCException)
 
- Public Member Functions inherited from splash::SerialDataCollector
 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)
 
CollectionTypereadMeta (int32_t id, const char *name, const Dimensions dstBuffer, const Dimensions dstOffset, Dimensions &sizeRead) throw (DCException)
 
- Public Member Functions inherited from splash::DataCollector
virtual ~DataCollector ()
 

Additional Inherited Members

- Public Types inherited from splash::IDomainCollector
enum  DomDataClass { UndefinedType = 0, PolyType = 10, GridType = 20 }
 
- Public Types inherited from splash::DataCollector
enum  FileAccType { FAT_CREATE, FAT_READ, FAT_READ_MERGED, FAT_WRITE }
 
typedef struct splash::DataCollector::_FileCreationAttr FileCreationAttr
 
typedef struct splash::DataCollector::_DCEntry DCEntry
 
- Static Public Member Functions inherited from splash::DataCollector
static void initFileCreationAttr (FileCreationAttr &attr)
 

Detailed Description

DomainCollector extends SerialDataCollector with domain management features. A domain is a logical view to data in memory in or files, in contrast to the physical/memory view. DomainCollector allows to efficiently read subdomains (sub-partitions) from multi-process HDF5 files with entries annotated with domain information.

The following concept is used: Each process (of the MPI topology) annotates its local data with local and global domain information when writing. When reading from these files, data from all files can be accessed transparently as if in one single file. This global view uses the global domain information, created from all local subdomains.

domains_serial.jpg

Definition at line 51 of file DomainCollector.hpp.

Constructor & Destructor Documentation

◆ DomainCollector()

splash::DomainCollector::DomainCollector ( uint32_t  maxFileHandles)

Constructor

Parameters
maxFileHandlesMaximum number of concurrently opened file handles (0=unlimited).

Definition at line 38 of file DomainCollector.cpp.

◆ ~DomainCollector()

splash::DomainCollector::~DomainCollector ( )
virtual

Destructor

Definition at line 43 of file DomainCollector.cpp.

Member Function Documentation

◆ appendDomain() [1/2]

void splash::DomainCollector::appendDomain ( int32_t  id,
const CollectionType type,
size_t  count,
const char *  name,
const Domain  localDomain,
const Domain  globalDomain,
const void *  buf 
)
throw (DCException
)
virtual

Appends 1D data with annotated domain information.

Parameters
idID of iteration.
typeType information for data.
countNumber of elements to append.
nameName for the dataset to create/append.
localDomainLocal subdomain.
globalDomainLogical global domain.
bufBuffer with data.

Implements splash::IDomainCollector.

Definition at line 740 of file DomainCollector.cpp.

◆ appendDomain() [2/2]

void splash::DomainCollector::appendDomain ( int32_t  id,
const CollectionType type,
size_t  count,
size_t  offset,
size_t  striding,
const char *  name,
const Domain  localDomain,
const Domain  globalDomain,
const void *  buf 
)
throw (DCException
)
virtual

Appends 1D data with annotated domain information.

Parameters
idID of iteration.
typeType information for data.
countNumber of elements to append.
offsetOffset in elements to start reading from.
stridingStriding to be used for reading. Data must contain at least (striding * count) elements. 1 mean 'no striding'.
nameName for the dataset to create/append.
localDomainLocal subdomain.
globalDomainLogical global domain.
bufBuffer with data.

Implements splash::IDomainCollector.

Definition at line 752 of file DomainCollector.cpp.

Here is the call graph for this function:

◆ getGlobalDomain()

Domain splash::DomainCollector::getGlobalDomain ( int32_t  id,
const char *  name 
)
throw (DCException
)
virtual

Returns the global domain that is spanned by all local datasets (subdomains) of the currently accessed files. The user is responsible to guarantee that the actual subdomains form a line/rectangle/cuboid.

Parameters
idID of iteration.
nameName of the dataset.
Returns
Global domain spanned by all subdomains.

Implements splash::IDomainCollector.

Definition at line 47 of file DomainCollector.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLocalDomain()

Domain splash::DomainCollector::getLocalDomain ( int32_t  id,
const char *  name 
)
throw (DCException
)
virtual

Returns the local domain for a dataset in currently accessed file.

Parameters
idID of iteration.
nameName of the dataset.
Returns
Local sudomain.

Implements splash::IDomainCollector.

Definition at line 73 of file DomainCollector.cpp.

Here is the call graph for this function:

◆ readDomain()

DataContainer * splash::DomainCollector::readDomain ( int32_t  id,
const char *  name,
Domain  domain,
DomDataClass dataClass,
bool  lazyLoad = false 
)
throw (DCException
)
virtual

Efficiently reads domain-annotated data. In comparison to the standard read method, only data required for the requested partition is read. It passes back a DataContainer holding all subdomains or subdomain portions, respectively, which make up the requested partition. Data from the files is immediately copied to the DomainData objects in the container and DomainData buffers are dealloated when the DomainData object is deleted, which must be done by the user.

Parameters
idID of the iteration.
nameName of the dataset.
domainDomain for reading.
dataClassOptional domain type annotation, can be NULL.
lazyLoadSet to load only size information for each subdomain, data must be loaded later using IDomainCollector::readDomainLazy.
Returns
Returns a pointer to a newly allocated DataContainer holding all subdomains.

Implements splash::IDomainCollector.

Definition at line 452 of file DomainCollector.cpp.

Here is the call graph for this function:

◆ readDomainLazy()

void splash::DomainCollector::readDomainLazy ( DomainData domainData)
throw (DCException
)
virtual

Reads a subdomain which has been loaded using readDomain with lazyLoad activated. The DomainCollector instance must not have been closed in between. Currently only supported for domain annotated data of type DomDataClass::PolyType.

Parameters
domainDataPointer to subdomain loaded using lazyLoad == true.

Implements splash::IDomainCollector.

Definition at line 681 of file DomainCollector.cpp.

◆ writeDomain()

void splash::DomainCollector::writeDomain ( int32_t  id,
const CollectionType type,
uint32_t  ndims,
const Selection  select,
const char *  name,
const Domain  localDomain,
const Domain  globalDomain,
DomDataClass  dataClass,
const void *  buf 
)
throw (DCException
)
virtual

Writes data with annotated domain information.

Parameters
idID of the iteration for writing.
typeType information for data.
ndimsNumber of dimensions (1-3).
selectSelection in src buffer.
nameName for the dataset to create/append.
localDomainLocal subdomain.
globalDomainLogical global domain.
dataClassSubdomain type annotation.
bufBuffer with data.

Implements splash::IDomainCollector.

Definition at line 725 of file DomainCollector.cpp.

Here is the call graph for this function:

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