GEOSX
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
geosx::PackCollection Class Reference

#include <PackCollection.hpp>

Inheritance diagram for geosx::PackCollection:
Inheritance graph
[legend]

Public Member Functions

 PackCollection (string const &name, Group *parent)
 Constructor. More...
 
virtual void initializePostSubGroups () override
 
virtual HistoryMetadata getMetadata (DomainPartition const &domain, localIndex collectionIdx) override
 Get the metadata for what this collector collects. More...
 
virtual const stringgetTargetName () const override
 Get the name of the object being targeted for collection. More...
 
virtual void updateSetsIndices (DomainPartition &domain) override final
 Update the indices related to the sets being collected. More...
 
virtual localIndex getNumMetaCollectors () const override final
 Get the number of collectors of meta-information (set indices, etc) writing time-independent information during initialization. More...
 
- Public Member Functions inherited from geosx::HistoryCollection
 HistoryCollection (string const &name, Group *parent)
 Constructor. More...
 
void initializePostSubGroups () override
 
virtual localIndex getCollectionCount () const
 Get the number of discrete collection operations this collector conducts. More...
 
virtual bool execute (real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
 Collects history data. More...
 
void registerBufferCall (localIndex collectionIdx, std::function< buffer_unit_type *() > bufferCall)
 Register a callback that gives the current head of the time history data buffer. More...
 
HistoryMetadata getTimeMetadata () const
 Get a metadata object relating the the Time variable itself. More...
 
void registerTimeBufferCall (std::function< buffer_unit_type *() > timeBufferCall)
 Register a callback that gives the current head of the time data buffer. More...
 
virtual HistoryCollectiongetMetaCollector (localIndex metaIdx)
 Get a pointer to a collector of meta-information for this collector. More...
 

Static Public Member Functions

static string catalogName ()
 Catalog name interface. More...
 

Protected Member Functions

void buildMetaCollectors ()
 Construct the metadata collectors for this collector.
 
void disableCoordCollection ()
 
virtual void collect (DomainPartition &domain, real64 const time_n, real64 const dt, localIndex const collectionIdx, buffer_unit_type *&buffer) override
 Collect history information into the provided buffer. Typically called from HistoryCollection::execute . More...
 
- Protected Member Functions inherited from geosx::HistoryCollection
dataRepository::Group const * getTargetObject (DomainPartition const &domain, string const &objectPath)
 Retrieve the target object from the data repository. More...
 

Additional Inherited Members

- Protected Attributes inherited from geosx::HistoryCollection
bool m_targetIsMeshObject
 whether the target object is associated with mesh entities (fields, etc)
 
localIndex m_collectionCount
 The number of discrete collection operations described by metadata this collection collects.
 
std::function< buffer_unit_type *() > m_timeBufferCall
 Callbacks to get the current time buffer head to write time data into.
 
std::vector< std::function< buffer_unit_type *() > > m_bufferCalls
 Callbacks to get the current buffer head to write history data into.
 
std::vector< std::unique_ptr< HistoryCollection > > m_metaCollectors
 

Detailed Description

A task class for serializing history information using the MPI communication packing routines.

Definition at line 34 of file PackCollection.hpp.

Constructor & Destructor Documentation

◆ PackCollection()

geosx::PackCollection::PackCollection ( string const &  name,
Group parent 
)

Constructor.

Parameters
nameThe name of this Group.
parentThe parent Group.

Member Function Documentation

◆ catalogName()

static string geosx::PackCollection::catalogName ( )
inlinestatic

Catalog name interface.

Returns
This type's catalog name

Definition at line 47 of file PackCollection.hpp.

◆ collect()

virtual void geosx::PackCollection::collect ( DomainPartition domain,
real64 const  time_n,
real64 const  dt,
localIndex const  collectionIdx,
buffer_unit_type *&  buffer 
)
overrideprotectedvirtual

Collect history information into the provided buffer. Typically called from HistoryCollection::execute .

Parameters
domainThe DomainPartition to collect time history on.
time_nThe current simulation time.
dtThe current simulation time delta.
collectionIdxThe index of the collection operation to collect from the targeted collection event.
bufferA properly-sized buffer to serialize history data into.

Implements geosx::HistoryCollection.

◆ disableCoordCollection()

void geosx::PackCollection::disableCoordCollection ( )
inlineprotected

Do not construct metadata collectors to collect coordinate information. ( Prevents reccuring initialization of coordinate collection for coordinate collectors ).

Definition at line 95 of file PackCollection.hpp.

◆ getMetadata()

virtual HistoryMetadata geosx::PackCollection::getMetadata ( DomainPartition const &  domain,
localIndex  collectionIdx 
)
overridevirtual

Get the metadata for what this collector collects.

Parameters
domainThe DomainPartition.
collectionIdxWhich collected item to get metadata for.
Returns
A HistoryMetadata object describing the history data being collected by this collector.

Reimplemented from geosx::HistoryCollection.

◆ getNumMetaCollectors()

virtual localIndex geosx::PackCollection::getNumMetaCollectors ( ) const
finaloverridevirtual

Get the number of collectors of meta-information (set indices, etc) writing time-independent information during initialization.

Returns
The number of collectors of meta-information for this collector.

Reimplemented from geosx::HistoryCollection.

◆ getTargetName()

virtual const string& geosx::PackCollection::getTargetName ( ) const
inlineoverridevirtual

Get the name of the object being targeted for collection.

Returns
The collection target's name

Implements geosx::HistoryCollection.

Definition at line 55 of file PackCollection.hpp.

◆ updateSetsIndices()

virtual void geosx::PackCollection::updateSetsIndices ( DomainPartition domain)
finaloverridevirtual

Update the indices related to the sets being collected.

Parameters
domainThe domain partition.
Note
This is only required because we don't want to copy/move the indices each collection execution, because that causes data movement when collecting data from the device.
Refactoring the packing functions to allow direct usage of set indices from SortedArrayView instead of only ArrayViews will remove this duplication.

Implements geosx::HistoryCollection.


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