Simpatico
v1.10
|
A container for all the Group<N> objects on this processor.
Definition at line 21 of file GroupCollector.h.
#include <GroupStorage.h>
Public Member Functions | |
GroupStorage () | |
Default constructor. More... | |
~GroupStorage () | |
Destructor. More... | |
Initialization | |
void | associate (Domain &domain, AtomStorage &atomStorage, Buffer &buffer) |
Create associations for distributor and collector members. More... | |
void | initialize (int capacity, int totalCapacity) |
Set parameters, allocate memory and initialize. More... | |
virtual void | readParameters (std::istream &in) |
Read parameters, allocate memory and initialize. More... | |
virtual void | loadParameters (Serializable::IArchive &ar) |
Load internal state from an archive. More... | |
virtual void | save (Serializable::OArchive &ar) |
Save internal state to an archive. More... | |
Group Management | |
Group< N > * | newPtr () |
Returns an address available for addition of a new Group. More... | |
void | add () |
Complete addition of a new Group. More... | |
Group< N > * | add (int id) |
Add a new Group with a specified id, in a single step. More... | |
void | returnPtr () |
Reverts a transaction begun by the newPtr() function. More... | |
void | remove (Group< N > *groupPtr) |
Remove a specific Group. More... | |
void | clearGroups () |
Remove all groups. More... | |
int | size () const |
Return current number of groups on this processor. More... | |
int | capacity () const |
Return capacity for groups on this processor. More... | |
Iteration and Search | |
void | begin (GroupIterator< N > &iterator) |
Set iterator to beginning of the set of groups. More... | |
void | begin (ConstGroupIterator< N > &iterator) const |
Set iterator to beginning of the set of groups. More... | |
Group< N > * | find (int id) const |
Find local Group<N> indexed by global id. More... | |
Global Group Counting | |
int | totalCapacity () const |
Return maximum allowed number of groups on all processors. More... | |
void | computeNTotal (MPI::Intracomm &communicator) |
Compute and store the number of distinct groups on all processors. More... | |
int | nTotal () const |
Return total number of distinct groups on all processors. More... | |
void | unsetNTotal () |
Mark nTotal as unknown. More... | |
GroupExchanger Interface (Interprocessor Communication) | |
virtual void | markSpanningGroups (FMatrix< double, Dimension, 2 > &bound, FMatrix< double, Dimension, 2 > &inner, FMatrix< double, Dimension, 2 > &outer, IntVector &gridFlags) |
Find and mark groups that span boundaries. More... | |
virtual void | pack (int i, int j, Buffer &buffer) |
Pack groups for exchange. More... | |
virtual void | unpack (Buffer &buffer, AtomStorage &atomStorage) |
Unpack groups from buffer and locate available atoms. More... | |
virtual void | markGhosts (AtomStorage &atomStorage, FMatrix< GPArray< Atom >, Dimension, 2 > &sendArray, IntVector &gridFlags) |
Set ghost communication flags for all atoms in incomplete groups. More... | |
virtual void | findGhosts (AtomStorage &atomStorage) |
Find all ghost members of groups. More... | |
virtual bool | isValid (AtomStorage &atomStorage, MPI::Intracomm &communicator, bool hasGhosts) |
Return true if the container is valid, or throw an Exception. More... | |
Statistics | |
virtual void | computeStatistics (MPI::Intracomm &communicator) |
Compute statistics (reduce from all processors). More... | |
void | clearStatistics () |
Clear statistical accumulators (call on all processors). More... | |
void | outputStatistics (std::ostream &out) |
Output statistics. More... | |
int | maxNGroup () const |
Get the maximum number of primary atoms encountered thus far. More... | |
Miscellaneous Accessors | |
GroupDistributor< N > & | distributor () |
Get the GroupDistributor by reference. More... | |
GroupCollector< N > & | collector () |
Get the GroupCollector by reference. More... | |
bool | isValid () |
Return true if the container is valid, or throw an Exception. More... | |
![]() | |
ParamComposite () | |
Constructor. More... | |
ParamComposite (const ParamComposite &other) | |
Copy constructor. More... | |
ParamComposite (int capacity) | |
Constructor. More... | |
virtual | ~ParamComposite () |
Virtual destructor. More... | |
void | resetParam () |
Resets ParamComposite to its empty state. More... | |
virtual void | readParam (std::istream &in) |
Read the parameter file block. More... | |
virtual void | readParamOptional (std::istream &in) |
Read optional parameter file block. More... | |
virtual void | writeParam (std::ostream &out) |
Write all parameters to an output stream. More... | |
virtual void | load (Serializable::IArchive &ar) |
Load all parameters from an input archive. More... | |
virtual void | loadOptional (Serializable::IArchive &ar) |
Load an optional ParamComposite. More... | |
void | saveOptional (Serializable::OArchive &ar) |
Saves isActive flag, and then calls save() iff isActive is true. More... | |
void | readParamComposite (std::istream &in, ParamComposite &child, bool next=true) |
Add and read a required child ParamComposite. More... | |
void | readParamCompositeOptional (std::istream &in, ParamComposite &child, bool next=true) |
Add and attempt to read an optional child ParamComposite. More... | |
template<typename Type > | |
ScalarParam< Type > & | read (std::istream &in, const char *label, Type &value) |
Add and read a new required ScalarParam < Type > object. More... | |
template<typename Type > | |
ScalarParam< Type > & | readOptional (std::istream &in, const char *label, Type &value) |
Add and read a new optional ScalarParam < Type > object. More... | |
template<typename Type > | |
CArrayParam< Type > & | readCArray (std::istream &in, const char *label, Type *value, int n) |
Add and read a required C array parameter. More... | |
template<typename Type > | |
CArrayParam< Type > & | readOptionalCArray (std::istream &in, const char *label, Type *value, int n) |
Add and read an optional C array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | readDArray (std::istream &in, const char *label, DArray< Type > &array, int n) |
Add and read a required DArray < Type > parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | readOptionalDArray (std::istream &in, const char *label, DArray< Type > &array, int n) |
Add and read an optional DArray < Type > parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | readFArray (std::istream &in, const char *label, FArray< Type, N > &array) |
Add and read a required FArray < Type, N > array parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | readOptionalFArray (std::istream &in, const char *label, FArray< Type, N > &array) |
Add and read an optional FArray < Type, N > array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | readCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np) |
Add and read a required CArray2DParam < Type > 2D C-array. More... | |
template<typename Type > | |
CArray2DParam< Type > & | readOptionalCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np) |
Add and read an optional CArray2DParam < Type > 2D C-array parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | readDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n) |
Add and read a required DMatrix < Type > matrix parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | readOptionalDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n) |
Add and read an optional DMatrix < Type > matrix parameter. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | readDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n) |
Add and read a required symmetrix DMatrix. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | readOptionalDSymmMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int n) |
Add and read an optional DMatrix matrix parameter. More... | |
Begin & | readBegin (std::istream &in, const char *label, bool isRequired=true) |
Add and read a class label and opening bracket. More... | |
End & | readEnd (std::istream &in) |
Add and read the closing bracket. More... | |
Blank & | readBlank (std::istream &in) |
Add and read a new Blank object, representing a blank line. More... | |
void | loadParamComposite (Serializable::IArchive &ar, ParamComposite &child, bool next=true) |
Add and load a required child ParamComposite. More... | |
void | loadParamCompositeOptional (Serializable::IArchive &ar, ParamComposite &child, bool next=true) |
Add and load an optional child ParamComposite if isActive. More... | |
template<typename Type > | |
ScalarParam< Type > & | loadParameter (Serializable::IArchive &ar, const char *label, Type &value, bool isRequired) |
Add and load a new ScalarParam < Type > object. More... | |
template<typename Type > | |
ScalarParam< Type > & | loadParameter (Serializable::IArchive &ar, const char *label, Type &value) |
Add and load new required ScalarParam < Type > object. More... | |
template<typename Type > | |
CArrayParam< Type > & | loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n, bool isRequired) |
Add a C array parameter and load its elements. More... | |
template<typename Type > | |
CArrayParam< Type > & | loadCArray (Serializable::IArchive &ar, const char *label, Type *value, int n) |
Add and load a required CArrayParam< Type > array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n, bool isRequired) |
Add an load a DArray < Type > array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | loadDArray (Serializable::IArchive &ar, const char *label, DArray< Type > &array, int n) |
Add and load a required DArray< Type > array parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array, bool isRequired) |
Add and load an FArray < Type, N > fixed-size array parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | loadFArray (Serializable::IArchive &ar, const char *label, FArray< Type, N > &array) |
Add and load a required FArray < Type > array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np, bool isRequired) |
Add and load a CArray2DParam < Type > C 2D array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | loadCArray2D (Serializable::IArchive &ar, const char *label, Type *value, int m, int n, int np) |
Add and load a required < Type > matrix parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired) |
Add and load a DMatrixParam < Type > matrix parameter. More... | |
template<typename Type > | |
DMatrixParam< Type > & | loadDMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int m, int n) |
Add and load a required DMatrixParam < Type > matrix parameter. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n, bool isRequired) |
Add and load a symmetric DSymmMatrixParam < Type > matrix parameter. More... | |
template<typename Type > | |
DSymmMatrixParam< Type > & | loadDSymmMatrix (Serializable::IArchive &ar, const char *label, DMatrix< Type > &matrix, int n) |
Add and load a required DSymmMatrixParam < Type > matrix parameter. More... | |
void | addParamComposite (ParamComposite &child, bool next=true) |
Add a child ParamComposite object to the format array. More... | |
Begin & | addBegin (const char *label) |
Add a Begin object representing a class name and bracket. More... | |
End & | addEnd () |
Add a closing bracket. More... | |
Blank & | addBlank () |
Create and add a new Blank object, representing a blank line. More... | |
std::string | className () const |
Get class name string. More... | |
bool | isRequired () const |
Is this ParamComposite required in the input file? More... | |
bool | isActive () const |
Is this parameter active? More... | |
![]() | |
virtual | ~ParamComponent () |
Destructor. More... | |
void | setIndent (const ParamComponent &parent, bool next=true) |
Set indent level. More... | |
std::string | indent () const |
Return indent string for this object (string of spaces). More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize this ParamComponent as a string. More... | |
![]() | |
virtual | ~Serializable () |
Destructor. More... | |
![]() | |
MpiFileIo () | |
Constructor. More... | |
MpiFileIo (const MpiFileIo &other) | |
Copy constructor. More... | |
bool | isIoProcessor () const |
Can this processor do file I/O ? More... | |
void | setIoCommunicator (MPI::Intracomm &communicator) |
Set the communicator. More... | |
void | clearCommunicator () |
Clear (nullify) the communicator. More... | |
bool | hasIoCommunicator () const |
Does this object have an associated MPI communicator? More... | |
MPI::Intracomm & | ioCommunicator () const |
Get the MPI communicator by reference. More... | |
![]() | |
GroupExchanger () | |
Default constructor. More... | |
virtual | ~GroupExchanger () |
Destructor. More... | |
Additional Inherited Members | |
![]() | |
typedef BinaryFileOArchive | OArchive |
Type of output archive used by save method. More... | |
typedef BinaryFileIArchive | IArchive |
Type of input archive used by load method. More... | |
![]() | |
static void | initStatic () |
Initialize static echo member to false. More... | |
static void | setEcho (bool echo=true) |
Enable or disable echoing for all subclasses of ParamComponent. More... | |
static bool | echo () |
Get echo parameter. More... | |
![]() | |
void | setClassName (const char *className) |
Set class name string. More... | |
void | setIsRequired (bool isRequired) |
Set or unset the isActive flag. More... | |
void | setIsActive (bool isActive) |
Set or unset the isActive flag. More... | |
void | setParent (ParamComponent ¶m, bool next=true) |
Set this to the parent of a child component. More... | |
void | addComponent (ParamComponent ¶m, bool isLeaf=true) |
Add a new ParamComponent object to the format array. More... | |
template<typename Type > | |
ScalarParam< Type > & | add (std::istream &in, const char *label, Type &value, bool isRequired=true) |
Add a new required ScalarParam < Type > object. More... | |
template<typename Type > | |
CArrayParam< Type > & | addCArray (std::istream &in, const char *label, Type *value, int n, bool isRequired=true) |
Add (but do not read) a required C array parameter. More... | |
template<typename Type > | |
DArrayParam< Type > & | addDArray (std::istream &in, const char *label, DArray< Type > &array, int n, bool isRequired=true) |
Add (but do not read) a DArray < Type > parameter. More... | |
template<typename Type , int N> | |
FArrayParam< Type, N > & | addFArray (std::istream &in, const char *label, FArray< Type, N > &array, bool isRequired=true) |
Add (but do not read) a FArray < Type, N > array parameter. More... | |
template<typename Type > | |
CArray2DParam< Type > & | addCArray2D (std::istream &in, const char *label, Type *value, int m, int n, int np, bool isRequired=true) |
Add (but do not read) a CArray2DParam < Type > 2D C-array. More... | |
template<typename Type > | |
DMatrixParam< Type > & | addDMatrix (std::istream &in, const char *label, DMatrix< Type > &matrix, int m, int n, bool isRequired=true) |
Add and read a required DMatrix < Type > matrix parameter. More... | |
![]() | |
ParamComponent () | |
Constructor. More... | |
ParamComponent (const ParamComponent &other) | |
Copy constructor. More... | |
DdMd::GroupStorage< N >::GroupStorage | ( | ) |
Default constructor.
Definition at line 29 of file GroupStorage.tpp.
DdMd::GroupStorage< N >::~GroupStorage | ( | ) |
Destructor.
Definition at line 45 of file GroupStorage.tpp.
void DdMd::GroupStorage< N >::associate | ( | Domain & | domain, |
AtomStorage & | atomStorage, | ||
Buffer & | buffer | ||
) |
Create associations for distributor and collector members.
domain | Domain object (defines processor grid) |
atomStorage | AtomStorage object |
buffer | Buffer object (holds memory for communication) |
Definition at line 52 of file GroupStorage.tpp.
void DdMd::GroupStorage< N >::initialize | ( | int | capacity, |
int | totalCapacity | ||
) |
Set parameters, allocate memory and initialize.
Call on all processors. Call either this or initialize, but not both. The initialize function is provided for unit testing.
capacity | max number of groups owned by processor. |
totalCapacity | max number of groups on all processors. |
Definition at line 63 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::capacity(), and DdMd::GroupStorage< N >::totalCapacity().
|
virtual |
Read parameters, allocate memory and initialize.
Call on all processors. Call either this or initialize, but not both.
Parameter file format:
in | input stream from which to read parameters. |
Reimplemented from Util::ParamComposite.
Reimplemented in DdMd::DihedralStorage, DdMd::AngleStorage, and DdMd::BondStorage.
Definition at line 74 of file GroupStorage.tpp.
Referenced by DdMd::AngleStorage::readParameters(), DdMd::BondStorage::readParameters(), and DdMd::DihedralStorage::readParameters().
|
virtual |
Load internal state from an archive.
Call on all processors.
ar | input/loading archive |
Reimplemented from Util::ParamComposite.
Definition at line 85 of file GroupStorage.tpp.
References Util::MpiLoader< IArchive >::load(), and Util::Setable< T >::set().
|
virtual |
Save internal state to an archive.
Call only on ioProcessor (master).
ar | output/saving archive |
Reimplemented from Util::ParamComposite.
Definition at line 100 of file GroupStorage.tpp.
References Util::Setable< T >::value().
Group< N > * DdMd::GroupStorage< N >::newPtr | ( | ) |
Returns an address available for addition of a new Group.
This function begins a transaction that adds a new Group<N> object by returning the address of a currently unused Group<N> object. The address of this new object is popped off the reservoir of unused objects and assigned to an internal "new" pointer (newPtr_) before the function returns. This function does not modify the object id or add the Group to the set of local Group<N> objects. It must thus be followed by either a call to add(), which completes the transaction by adding the object to the local set, or by a call to returnPtr(), which reverts the transaction and pushes the new pointer back onto the reservoir.
Definition at line 137 of file GroupStorage.tpp.
References UTIL_THROW.
Referenced by DdMd::GroupStorage< N >::add(), and DdMd::GroupStorage< N >::unpack().
void DdMd::GroupStorage< N >::add | ( | ) |
Complete addition of a new Group.
This function completes the transaction begun by a previous call to newPtr() by adding the new Group whose address was returned by newPtr() to the set of local groups and nullifying the new Ptr. The invoking function must assign the new group a valid, previously unused global group id before calling the add() function.
Usage:
The group id must be set before calling add(), but other properties may be set either before or after calling add().
Preconditions: 1) newPtr() must have been called since the last add(). 2) The new Group must have been a assigned a valid global group id. 3) A Group with the specified id may not already be in the set.
Definition at line 165 of file GroupStorage.tpp.
References Util::Log::file(), and UTIL_THROW.
Referenced by DdMd::GroupStorage< N >::add(), and DdMd::GroupStorage< N >::unpack().
Group< N > * DdMd::GroupStorage< N >::add | ( | int | id | ) |
Add a new Group with a specified id, in a single step.
Adds a new Group<N> to the set owned by this function, with a specified global id, and returns a pointer to the new Group. Internally, this function calls newPtr(), and sets the id of the new group, and calls add(). Other member variables must be set after calling this function, using the returned pointer.
id | global id for the new Group. |
Definition at line 198 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::add(), DdMd::GroupStorage< N >::newPtr(), and DdMd::Group< N >::setId().
void DdMd::GroupStorage< N >::returnPtr | ( | ) |
Reverts a transaction begun by the newPtr() function.
This function pushes the pointer returned by a previous call to newPtr() back onto the reservoir of unused objects, without adding it to the local group set, and the nullifies the "new" pointer.
Definition at line 151 of file GroupStorage.tpp.
References UTIL_THROW.
Referenced by DdMd::GroupStorage< N >::unpack().
void DdMd::GroupStorage< N >::remove | ( | Group< N > * | groupPtr | ) |
Remove a specific Group.
Exception | if groupPtr is not address of a Group. |
groupPtr | pointer to the group to be removed |
Definition at line 210 of file GroupStorage.tpp.
References Util::Log::file(), DdMd::Group< N >::id(), DdMd::Group< N >::setId(), and UTIL_THROW.
void DdMd::GroupStorage< N >::clearGroups | ( | ) |
Remove all groups.
This function resets the GroupStorage to an empty state by pushing the addresses of existing groups onto the reservoir and then clearing the set of groups.
Definition at line 229 of file GroupStorage.tpp.
References DdMd::Group< N >::id(), DdMd::Group< N >::setId(), and UTIL_THROW.
|
inline |
Return current number of groups on this processor.
Definition at line 486 of file ddMd/storage/GroupStorage.h.
Referenced by DdMd::GroupStorage< N >::isValid().
|
inline |
Return capacity for groups on this processor.
Definition at line 490 of file ddMd/storage/GroupStorage.h.
Referenced by DdMd::GroupStorage< N >::initialize(), DdMd::SerializeConfigIo::saveConfig(), DdMd::DdMdConfigIo::writeConfig(), DdMd::LammpsConfigIo::writeConfig(), and DdMd::DdMdOrderedConfigIo::writeConfig().
|
inline |
Set iterator to beginning of the set of groups.
iterator | iterator for all groups. |
Definition at line 512 of file ddMd/storage/GroupStorage.h.
Referenced by DdMd::BondTensorAutoCorr::computeData(), DdMd::AnglePotentialImpl< Interaction >::computeEnergy(), DdMd::BondPotentialImpl< Interaction >::computeEnergy(), DdMd::AnglePotentialImpl< Interaction >::computeForces(), DdMd::BondPotentialImpl< Interaction >::computeForces(), DdMd::BondPotentialImpl< Interaction >::computeForcesAndStress(), DdMd::GroupStorage< N >::computeNTotal(), DdMd::AnglePotentialImpl< Interaction >::computeStress(), DdMd::BondPotentialImpl< Interaction >::computeStress(), DdMd::GroupStorage< N >::findGhosts(), DdMd::GroupStorage< N >::isValid(), DdMd::GroupStorage< N >::markGhosts(), DdMd::GroupStorage< N >::markSpanningGroups(), DdMd::GroupStorage< N >::pack(), and DdMd::ConfigIo::setAtomMasks().
|
inline |
Set iterator to beginning of the set of groups.
iterator | iterator for all groups. |
Definition at line 520 of file ddMd/storage/GroupStorage.h.
|
inline |
Find local Group<N> indexed by global id.
Definition at line 505 of file ddMd/storage/GroupStorage.h.
Referenced by DdMd::GroupStorage< N >::isValid(), and DdMd::GroupStorage< N >::unpack().
|
inline |
Return maximum allowed number of groups on all processors.
The return value is one greater than the maximum allowed value for an integer group id, i.e., group ids must be in the range 0 <= id <= totalCapacity - 1.
Definition at line 494 of file ddMd/storage/GroupStorage.h.
Referenced by DdMd::GroupStorage< N >::initialize().
void DdMd::GroupStorage< N >::computeNTotal | ( | MPI::Intracomm & | communicator | ) |
Compute and store the number of distinct groups on all processors.
Compute and store total number of atoms on all processors.
This is an MPI reduce operation, and so must be invoked on all processors. The resulting sum is stored only on the rank 0 processor.
Algorithm: For purposes of counting, each group is assigned to the processor that owns its first atom (index 0), and then values from different processors are summed and stored on the master.
communicator | MPI communicator for this system. |
Definition at line 296 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::begin(), DdMd::Atom::isGhost(), Util::Setable< T >::isSet(), Util::PArrayIterator< Group< N > >::notEnd(), and Util::Setable< T >::set().
Referenced by DdMd::ConfigIo::associate(), DdMd::GroupStorage< N >::isValid(), DdMd::SerializeConfigIo::loadConfig(), DdMd::DdMdConfigIo::readConfig(), DdMd::LammpsConfigIo::readConfig(), DdMd::DdMdOrderedConfigIo::readConfig(), and DdMd::LammpsConfigIo::writeConfig().
|
inline |
Return total number of distinct groups on all processors.
This function should be called only on the master (rank 0) processor, after calling computeNTotal() on all processors.
Definition at line 498 of file ddMd/storage/GroupStorage.h.
Referenced by DdMd::ConfigIo::associate(), DdMd::GroupStorage< N >::isValid(), DdMd::SerializeConfigIo::loadConfig(), DdMd::DdMdConfigIo::readConfig(), DdMd::LammpsConfigIo::readConfig(), DdMd::DdMdOrderedConfigIo::readConfig(), and DdMd::LammpsConfigIo::writeConfig().
void DdMd::GroupStorage< N >::unsetNTotal | ( | ) |
Mark nTotal as unknown.
Call on all processors.
Definition at line 475 of file GroupStorage.tpp.
References Util::Setable< T >::unset().
Referenced by DdMd::GroupStorage< N >::isValid().
|
virtual |
Find and mark groups that span boundaries.
bound | boundaries of domain for this processor |
inner | inner slab boundaries (extended domain of neighbors) |
outer | outer slab boundaries (extended domain of this processor) |
gridFlags | element i is 0 iff gridDimension[i] == 1, 1 otherwise |
Implements DdMd::GroupExchanger.
Definition at line 501 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::begin(), Util::Dimension, DdMd::Plan::exchange(), Util::Log::file(), DdMd::Atom::isGhost(), Util::PArrayIterator< Group< N > >::notEnd(), DdMd::Atom::plan(), DdMd::Atom::position(), and UTIL_THROW.
|
virtual |
Pack groups for exchange.
Usage: This is called after atom exchange plans are set, but before atoms makred for exchange in direction i, j have been cleared or removed from the atomStorage.
i | index of Cartesian communication direction |
j | index for sign of direction |
buffer | Buffer object into which groups are packed |
Implements DdMd::GroupExchanger.
Definition at line 640 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::begin(), DdMd::Buffer::beginSendBlock(), DdMd::Buffer::endSendBlock(), DdMd::Plan::exchange(), Util::PArrayIterator< Group< N > >::notEnd(), and DdMd::Atom::plan().
|
virtual |
Unpack groups from buffer and locate available atoms.
buffer | Buffer object from which groups are unpacked |
atomStorage | AtomStorage used to find atoms pointers |
Implements DdMd::GroupExchanger.
Definition at line 685 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::add(), DdMd::Buffer::beginRecvBlock(), DdMd::Buffer::endRecvBlock(), DdMd::GroupStorage< N >::find(), DdMd::AtomMap::findGroupLocalAtoms(), DdMd::Group< N >::id(), DdMd::AtomStorage::map(), DdMd::GroupStorage< N >::newPtr(), DdMd::Buffer::recvSize(), DdMd::GroupStorage< N >::returnPtr(), and DdMd::Group< N >::unpack().
|
virtual |
Set ghost communication flags for all atoms in incomplete groups.
Usage: This is called after exchanging all atoms and groups between processors, but before exchanging ghosts. At this point, atom ownership is finalized, but there are no ghosts.
atomStorage | AtomStorage object |
sendArray | Matrix of arrays of pointers to ghosts to send |
gridFlags | element i is 0 iff gridDimension[i] == 1, 1 otherwise |
Implements DdMd::GroupExchanger.
Definition at line 732 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::begin(), Util::Dimension, DdMd::AtomMap::find(), DdMd::Atom::isGhost(), DdMd::AtomStorage::map(), Util::PArrayIterator< Group< N > >::notEnd(), DdMd::Atom::plan(), DdMd::Plan::setGhost(), and UTIL_THROW.
|
virtual |
Find all ghost members of groups.
Usage: This called after all ghosts have been exchanged.
atomStorage | AtomStorage object used to find atom pointers |
Implements DdMd::GroupExchanger.
Definition at line 810 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::begin(), DdMd::AtomMap::findGroupGhostAtoms(), DdMd::AtomStorage::map(), Util::PArrayIterator< Group< N > >::notEnd(), and UTIL_THROW.
|
virtual |
Return true if the container is valid, or throw an Exception.
This calls the overloaded isValid() function and then checks consistency of atom pointers in all groups with those in an asociated AtomStorage. If hasGhosts is false, the function requires that no group contain a pointer to a ghost atom. If hasGhosts is true, it requires that every Group be complete.
atomStorage | associated AtomStorage object |
hasGhosts | true if the atomStorage has ghosts, false otherwise |
communicator | domain communicator |
Implements DdMd::GroupExchanger.
Definition at line 384 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::begin(), DdMd::GroupStorage< N >::computeNTotal(), Util::Log::file(), DdMd::AtomMap::find(), DdMd::Atom::isGhost(), Util::Setable< T >::isSet(), DdMd::GroupStorage< N >::isValid(), DdMd::AtomStorage::map(), Util::ConstPArrayIterator< Group< N > >::notEnd(), DdMd::GroupStorage< N >::nTotal(), DdMd::AtomStorage::totalAtomCapacity(), DdMd::GroupStorage< N >::unsetNTotal(), and UTIL_THROW.
Referenced by DdMd::SerializeConfigIo::loadConfig(), DdMd::DdMdConfigIo::readConfig(), DdMd::LammpsConfigIo::readConfig(), and DdMd::DdMdOrderedConfigIo::readConfig().
|
virtual |
Compute statistics (reduce from all processors).
Call on all processors.
Definition at line 338 of file GroupStorage.tpp.
References Util::Setable< T >::set().
void DdMd::GroupStorage< N >::clearStatistics | ( | ) |
Clear statistical accumulators (call on all processors).
Definition at line 358 of file GroupStorage.tpp.
References Util::Setable< T >::unset().
Referenced by DdMd::Integrator::clear().
void DdMd::GroupStorage< N >::outputStatistics | ( | std::ostream & | out | ) |
Output statistics.
Call on master, after calling computeStatistics on all procs.
out | output stream |
Definition at line 368 of file GroupStorage.tpp.
References Util::Setable< T >::value().
int DdMd::GroupStorage< N >::maxNGroup | ( | ) | const |
Get the maximum number of primary atoms encountered thus far.
Call only on master.
|
inline |
Get the GroupDistributor by reference.
Definition at line 524 of file ddMd/storage/GroupStorage.h.
|
inline |
Get the GroupCollector by reference.
Definition at line 528 of file ddMd/storage/GroupStorage.h.
bool DdMd::GroupStorage< N >::isValid | ( | ) |
Return true if the container is valid, or throw an Exception.
Definition at line 254 of file GroupStorage.tpp.
References DdMd::GroupStorage< N >::begin(), DdMd::GroupStorage< N >::find(), Util::PArrayIterator< Group< N > >::get(), DdMd::Group< N >::id(), Util::PArrayIterator< Group< N > >::notEnd(), DdMd::GroupStorage< N >::size(), and UTIL_THROW.
Referenced by DdMd::GroupStorage< N >::isValid().