ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | List of all members
MoleculeIdPool Class Reference

The MoleculeIdPool manages molecule ID handling. More...

#include <MoleculeIdPool.h>

Public Member Functions

 MoleculeIdPool (unsigned long poolsize, int numProcs, int myProcRank)
 
unsigned long getNewMoleculeId ()
 
int getOwnerRank (unsigned long id)
 
unsigned long localIdRangeSize ()
 

Detailed Description

The MoleculeIdPool manages molecule ID handling.

The MoleculeIdPool divides the available range of molecule IDs across processes. It keeps track of how many molecule IDs were obtained by the process.

Note
this is not a singleton and you have to ensure to use the same pool object yourself.
Todo:
this scheme can be used to improve the check for duplicate IDs after the run.

Member Function Documentation

◆ getNewMoleculeId()

unsigned long MoleculeIdPool::getNewMoleculeId ( )
inline

get a new, jet unused molecule ID

◆ getOwnerRank()

int MoleculeIdPool::getOwnerRank ( unsigned long  id)
inline

get the rank of the process belonging to molecule ID

◆ localIdRangeSize()

unsigned long MoleculeIdPool::localIdRangeSize ( )
inline

get the number of molecule IDs this process has been assigned


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