Gromacs  2026.0-dev-20241121-c76fa1e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions
gmx::AnalysisDataModuleManager Class Reference

#include <gromacs/analysisdata/datamodulemanager.h>

Description

Encapsulates handling of data modules attached to AbstractAnalysisData.

See IAnalysisDataModule and Parallelizable Handling of Output Data (analysisdata) for more details on the notifications and the order in which they should be raised.

Classes

class  Impl
 Private implementation class for AnalysisDataModuleManager. More...
 

Public Types

enum  DataProperty { eMultipleDataSets, eMultipleColumns, eMultipoint, eDataPropertyNR }
 Identifies data properties to check with data modules. More...
 

Public Member Functions

void dataPropertyAboutToChange (DataProperty property, bool bSet)
 Allows the manager to check modules for compatibility with the data. More...
 
bool hasSerialModules () const
 Whether there are modules that do not support parallel processing. More...
 
void addModule (AbstractAnalysisData *data, const AnalysisDataModulePointer &module)
 Adds a module to process the data. More...
 
void applyModule (AbstractAnalysisData *data, IAnalysisDataModule *module)
 Applies a module to process data that is ready. More...
 
void notifyDataStart (AbstractAnalysisData *data)
 Notifies attached modules of the start of serial data. More...
 
void notifyParallelDataStart (AbstractAnalysisData *data, const AnalysisDataParallelOptions &options)
 Notifies attached modules of the start of parallel data. More...
 
void notifyFrameStart (const AnalysisDataFrameHeader &header) const
 Notifies attached serial modules of the start of a frame. More...
 
void notifyParallelFrameStart (const AnalysisDataFrameHeader &header) const
 Notifies attached parallel modules of the start of a frame. More...
 
void notifyPointsAdd (const AnalysisDataPointSetRef &points) const
 Notifies attached serial modules of the addition of points to the current frame. More...
 
void notifyParallelPointsAdd (const AnalysisDataPointSetRef &points) const
 Notifies attached parallel modules of the addition of points to a frame. More...
 
void notifyFrameFinish (const AnalysisDataFrameHeader &header) const
 Notifies attached serial modules of the end of a frame. More...
 
void notifyParallelFrameFinish (const AnalysisDataFrameHeader &header) const
 Notifies attached parallel modules of the end of a frame. More...
 
void notifyDataFinish () const
 Notifies attached modules of the end of data. More...
 

Member Enumeration Documentation

Identifies data properties to check with data modules.

See Also
IAnalysisDataModule::Flag
Enumerator
eMultipleDataSets 

Data has multiple data sets.

eMultipleColumns 

Data has multiple columns.

eMultipoint 

Data is multipoint.

eDataPropertyNR 

Number of properties; for internal use only.

Member Function Documentation

void gmx::AnalysisDataModuleManager::addModule ( AbstractAnalysisData data,
const AnalysisDataModulePointer module 
)

Adds a module to process the data.

Parameters
dataData object to add the module to.
moduleModule to add.
Exceptions
std::bad_allocif out of memory.
APIErrorif
  • module is not compatible with the data object
  • data has already been added to the data object and everything is not available through getDataFrame().
unspecifiedAny exception thrown by module in its notification methods (if data has been added).
See Also
AbstractAnalysisData::addModule()
void gmx::AnalysisDataModuleManager::applyModule ( AbstractAnalysisData data,
IAnalysisDataModule module 
)

Applies a module to process data that is ready.

Parameters
dataData object to apply the module to.
moduleModule to apply.
Exceptions
APIErrorin same situations as addModule().
unspecifiedAny exception thrown by module in its notification methods.
See Also
AbstractAnalysisData::applyModule()
void gmx::AnalysisDataModuleManager::dataPropertyAboutToChange ( DataProperty  property,
bool  bSet 
)

Allows the manager to check modules for compatibility with the data.

Exceptions
APIErrorif any data module already added is not compatible with the new setting.

Does two things: checks any modules already attached to the data and throws if any of them is not compatible, and stores the property to check modules attached in the future.

Strong exception safety.

bool gmx::AnalysisDataModuleManager::hasSerialModules ( ) const

Whether there are modules that do not support parallel processing.

Must not be called before notifyDataStart()/notifyParallelDataStart(). If notifyDataStart() has been called, returns true if there are any modules (all modules are treated as serial).

Does not throw.

void gmx::AnalysisDataModuleManager::notifyDataFinish ( ) const

Notifies attached modules of the end of data.

Exceptions
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::dataFinished().

Should be called once, after all the other notification calls.

void gmx::AnalysisDataModuleManager::notifyDataStart ( AbstractAnalysisData data)

Notifies attached modules of the start of serial data.

Parameters
dataData object that is starting.
Exceptions
APIErrorif any attached data module is not compatible.
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::dataStarted().

Should be called once, after data properties have been set with the methods in AbstractAnalysisData, and before any other notification methods. The caller should be prepared for requestStorage() calls to data from the attached modules.

data should typically be this when calling from a class derived from AbstractAnalysisData.

This method initializes all modules for serial processing by calling IAnalysisDataModule::dataStarted().

void gmx::AnalysisDataModuleManager::notifyFrameFinish ( const AnalysisDataFrameHeader header) const

Notifies attached serial modules of the end of a frame.

Parameters
[in]headerHeader information for the frame that is ending.
Exceptions
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::frameFinished().

Should be called once for each call of notifyFrameStart(), after any notifyPointsAdd() calls for the frame. header should be identical to that used in the corresponding notifyFrameStart() call.

This method also notifies parallel modules about serial end of frame.

void gmx::AnalysisDataModuleManager::notifyFrameStart ( const AnalysisDataFrameHeader header) const

Notifies attached serial modules of the start of a frame.

Parameters
[in]headerHeader information for the frame that is starting.
Exceptions
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::frameStarted().

Should be called once for each frame, before notifyPointsAdd() calls for that frame.

void gmx::AnalysisDataModuleManager::notifyParallelDataStart ( AbstractAnalysisData data,
const AnalysisDataParallelOptions options 
)

Notifies attached modules of the start of parallel data.

Parameters
dataData object that is starting.
[in]optionsParallelization properties of the input data.
Exceptions
APIErrorif any attached data module is not compatible.
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::parallelDataStarted().

Can be called instead of notifyDataStart() if data supports non-sequential creation of frames. Works as notifyDataStart(), but instead calls IAnalysisDataModule::parallelDataStarted() and records whether the module supports the parallel mode. Subsequent notification calls then notify the modules according to the mode they accept.

See notifyDataStart() for general constraints.

void gmx::AnalysisDataModuleManager::notifyParallelFrameFinish ( const AnalysisDataFrameHeader header) const

Notifies attached parallel modules of the end of a frame.

Parameters
[in]headerHeader information for the frame that is ending.
Exceptions
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::frameFinished().

Should be called once for each call of notifyParallelFrameStart(), after any notifyParallelPointsAdd() calls for the frame. header should be identical to that used in the corresponding notifyParallelFrameStart() call.

void gmx::AnalysisDataModuleManager::notifyParallelFrameStart ( const AnalysisDataFrameHeader header) const

Notifies attached parallel modules of the start of a frame.

Parameters
[in]headerHeader information for the frame that is starting.
Exceptions
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::frameStarted().

If notifyParallelDataStart() has been called, should be called once for each frame, before notifyParallelPointsAdd() calls for that frame. It is allowed to call this method in any order for the frames, but should be called exactly once for each frame.

void gmx::AnalysisDataModuleManager::notifyParallelPointsAdd ( const AnalysisDataPointSetRef points) const

Notifies attached parallel modules of the addition of points to a frame.

Parameters
[in]pointsSet of points added (also provides access to frame-level data).
Exceptions
APIErrorif any attached data module is not compatible.
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::pointsAdded().

See notifyPointsAdd() for information on the structure of the point sets.

void gmx::AnalysisDataModuleManager::notifyPointsAdd ( const AnalysisDataPointSetRef points) const

Notifies attached serial modules of the addition of points to the current frame.

Parameters
[in]pointsSet of points added (also provides access to frame-level data).
Exceptions
APIErrorif any attached data module is not compatible.
unspecifiedAny exception thrown by attached data modules in IAnalysisDataModule::pointsAdded().

Can be called zero or more times for each frame. The caller should ensure that any column occurs at most once in the calls, unless the data is multipoint. For efficiency reasons, calls to this method should be aggregated whenever possible, i.e., it's better to handle multiple columns or even the whole frame in a single call rather than calling the method for each column separately.


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