Simpatico
v1.10
|
Provides methods for MPI-aware loading of data from input archive.
Each MpiLoader is associated with an IArchive input archive, and with a MpiFileIo, which are passed as arguments to the constructor. The MpiFileIo argument is often a ParamComposite, which is derived from MpiFileIo.
The "load" function templates all load data from the archive and (if appropriate) broadcast data among processors. If MPI is not enabled (i.e., if UTIL_MPI is not defined), then the data is simply loaded from the archive. If MPI is enabled and a parameter communicator is set, data is loaded from the archive by the ioProcessor and then broadcast to all other processors in the IO communicator. If MPI is enabled but no parameter communicator is set, every processor loads data independently.
Definition at line 43 of file MpiLoader.h.
#include <MpiLoader.h>
Public Member Functions | |
MpiLoader (MpiFileIo &mpiFileIo, IArchive &archive) | |
Constructor. More... | |
template<typename Data > | |
void | load (Data &value) |
Load and broadcast a single Data value. More... | |
template<typename Data > | |
void | load (Data *value, int n) |
Load and broadcast a C array. More... | |
template<typename Data > | |
void | load (DArray< Data > &array, int n) |
Load and broadcast a DArray < Data > container. More... | |
template<typename Data , int N> | |
void | load (FArray< Data, N > &array) |
Load and broadcast an FArray <Data , N > object. More... | |
template<typename Data > | |
void | load (Data *value, int m, int n, int np) |
Load and broadcast a 2D CArray of Data objects. More... | |
template<typename Data > | |
void | load (DMatrix< Data > &matrix, int m, int n) |
Load and broadcast a DMatrix<Data> object. More... | |
Util::MpiLoader< IArchive >::MpiLoader | ( | MpiFileIo & | mpiFileIo, |
IArchive & | archive | ||
) |
Constructor.
mpiFileIo | associated MpiFileIo object |
archive | input archive from which data will be loaded |
Definition at line 127 of file MpiLoader.h.
void Util::MpiLoader< IArchive >::load | ( | Data & | value | ) |
Load and broadcast a single Data value.
value | reference to a Data |
Definition at line 137 of file MpiLoader.h.
References Util::MpiFileIo::hasIoCommunicator(), Util::MpiFileIo::ioCommunicator(), and Util::MpiFileIo::isIoProcessor().
Referenced by DdMd::NvtIntegrator::loadParameters(), DdMd::NphIntegrator::loadParameters(), DdMd::NptIntegrator::loadParameters(), DdMd::OutputStressTensor::loadParameters(), DdMd::OutputEnergy::loadParameters(), DdMd::OutputTemperature::loadParameters(), DdMd::OutputBoxdim::loadParameters(), DdMd::OutputPressure::loadParameters(), DdMd::VirialStressTensor::loadParameters(), DdMd::LogEnergy::loadParameters(), DdMd::ConfigWriter::loadParameters(), DdMd::GroupStorage< N >::loadParameters(), and Tools::TrajectoryWriter::readParameters().
void Util::MpiLoader< IArchive >::load | ( | Data * | value, |
int | n | ||
) |
Load and broadcast a C array.
value | pointer to array |
n | number of elements |
Definition at line 154 of file MpiLoader.h.
References Util::MpiFileIo::hasIoCommunicator(), Util::MpiFileIo::ioCommunicator(), and Util::MpiFileIo::isIoProcessor().
void Util::MpiLoader< IArchive >::load | ( | DArray< Data > & | array, |
int | n | ||
) |
Load and broadcast a DArray < Data > container.
array | DArray object |
n | number of elements |
Definition at line 174 of file MpiLoader.h.
References Util::MpiFileIo::hasIoCommunicator(), Util::MpiFileIo::ioCommunicator(), Util::MpiFileIo::isIoProcessor(), and UTIL_THROW.
void Util::MpiLoader< IArchive >::load | ( | FArray< Data, N > & | array | ) |
Load and broadcast an FArray <Data , N > object.
array | FArray object to be loaded |
Definition at line 194 of file MpiLoader.h.
References Util::MpiFileIo::hasIoCommunicator(), Util::MpiFileIo::ioCommunicator(), and Util::MpiFileIo::isIoProcessor().
void Util::MpiLoader< IArchive >::load | ( | Data * | value, |
int | m, | ||
int | n, | ||
int | np | ||
) |
Load and broadcast a 2D CArray of Data objects.
Loads m rows of n elements into array declared as Data array[][np].
value | pointer to first element or row in array |
m | logical number of rows (1st dimension) |
n | logical number of columns (2nd dimension) |
np | physcial number of columns (elements allocated per row) |
Definition at line 214 of file MpiLoader.h.
References Util::MpiFileIo::hasIoCommunicator(), Util::MpiFileIo::ioCommunicator(), and Util::MpiFileIo::isIoProcessor().
void Util::MpiLoader< IArchive >::load | ( | DMatrix< Data > & | matrix, |
int | m, | ||
int | n | ||
) |
Load and broadcast a DMatrix<Data> object.
matrix | DMatrix object |
m | number of rows (1st dimension) |
n | number of columns (2nd dimension) |
Definition at line 237 of file MpiLoader.h.
References Util::MpiFileIo::hasIoCommunicator(), Util::MpiFileIo::ioCommunicator(), and Util::MpiFileIo::isIoProcessor().