CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
A class that manages data that is distributed between processors, not only real values (as in DistributedVector or DistributedMatrix)
Definition at line 55 of file DistributedInfos.hpp.
#include <DistributedInfos.hpp>
Public Member Functions | |
DistributedInfos () | |
Constructor. More... | |
DistributedInfos (const DistributedInfos &) | |
Default copy constructor. More... | |
DistributedInfos & | operator= (const DistributedInfos &) |
Default assignment operator. More... | |
~DistributedInfos () | |
Destructor. More... | |
LocalGlobalMapping< _Type, _Hash > * | getOwnedMapping () |
Mapping between global and local index of owned data. More... | |
LocalGlobalMapping< _Type, _Hash > * | getHaloMapping () |
Mapping between global and local index of halo data. More... | |
CepsBool | hasHash (const _Hash &hashValue, const CepsUInt &pId) const |
Check if container has data with given hash. More... | |
_Type & | atHash (const _Hash &hashValue, const CepsUInt &pId, const _Type &def) |
Access with given hash. More... | |
const _Type & | atHash (const _Hash &hashValue, const CepsUInt &pId, const _Type &def) const |
const access with given hash More... | |
CepsBool | hasLocal (const CepsLocalIndex &localId, const CepsUInt &pId) const |
Check if container has data with given local ID. More... | |
_Type & | atLocal (const CepsLocalIndex &localId, const CepsUInt &pId, const _Type &def) |
Access with given local ID. More... | |
const _Type & | atLocal (const CepsLocalIndex &localId, const CepsUInt &pId, const _Type &def) const |
const access with given local ID More... | |
CepsBool | hasGlobal (const CepsGlobalIndex &globalId, const CepsUInt &pId) const |
Check if container has data with given global ID. More... | |
_Type & | atGlobal (const CepsGlobalIndex &globalId, const CepsUInt &pId) |
Access with given global ID. More... | |
const _Type & | atGlobal (const CepsGlobalIndex &globalId, const CepsUInt &pId) const |
Access with given global ID. More... | |
_Type & | atGlobal (const CepsGlobalIndex &globalId, const CepsUInt &pId, const _Type &def) |
Access with given global ID. More... | |
const _Type & | atGlobal (const CepsGlobalIndex &globalId, const CepsUInt &pId, const _Type &def) const |
const access with given global ID More... | |
const CepsVector< _Type > & | getOwned () const |
Get data owned by the processor, const. More... | |
CepsVector< _Type > & | getOwned () |
Get data owned by the processor. More... | |
const _Type & | getOwned (CepsUInt i) const |
Get data owned by the processor with id i, const. More... | |
_Type & | getOwned (CepsUInt i) |
Get data owned by the processor with id i. More... | |
const CepsVector< _Type > & | getHalo () const |
Get halo data owned by neighbor processor, const. More... | |
CepsVector< _Type > & | getHalo () |
Get halo data owned by neighbor processor, const. More... | |
const _Type & | getHalo (CepsUInt i) const |
Get halo data owned by neighbor processor with ID i, const. More... | |
_Type & | getHalo (CepsUInt i) |
Get halo data owned by neighbor processor with ID i, const. More... | |
void | add (const _Type &x, const _Hash &hashValue, const CepsGlobalIndex &globalId, const CepsUInt &pId) |
Add entry with global ID to the container, hash must be provided, pId selects owned or halo. More... | |
void | addOwned (const _Type &x, const _Hash &hashValue, const CepsGlobalIndex &globalId) |
Add entry with global ID to the container, owned data, hash must be provided. More... | |
void | addHalo (const _Type &x, const _Hash &hashValue, const CepsGlobalIndex &globalId, const CepsUInt &fromProcId) |
Add entry with global ID to the container, halo data, hash must be provided. More... | |
void | add (const _Type &x, const _Hash &hashValue, const CepsUInt &pId) |
Add an entry to the container, hash must be provided. More... | |
void | addOwned (const _Type &x, const _Hash &hashValue) |
Add an entry to the container, hash must be provided, owned data. More... | |
void | addHalo (const _Type &x, const _Hash &hashValue, const CepsUInt &fromProcId) |
Add an entry to the container, hash must be provided, halo data. More... | |
void | destroyObjects () |
Clears the contents, keeps structure. More... | |
void | reset () |
Clears the container. More... | |
void | synchronize (CepsBool setGlobalIndicesFromLocals, std::function< void(_Type &, CepsGlobalIndex)> update=nullptr) |
Recomputes global indices from all local indices, build correct halo global indices. More... | |
void | synchronizeTotalSize () |
Compute the total number of owned elements. More... | |
CepsUInt | getNumberOfOwned () const |
Number of owned data stored. More... | |
CepsUInt | getNumberOfHalo () const |
Number of shared data from other process stored. More... | |
CepsUInt | getTotalNumberOfEntities () const |
Total number of distributed data amongst all process. More... | |
CepsUInt | getGlobalIndexOffset (CepsProcId pId) const |
Return the number of elements on the processes before pId This supposes that synchronizeTotalSize has been called beforehand. Use at your own risk. More... | |
Protected Attributes | |
LocalGlobalMapping< _Type, _Hash > * | m_owned = nullptr |
Proc owned _Type object. More... | |
LocalGlobalMapping< _Type, _Hash > * | m_halo = nullptr |
Proc halo _Type object. More... | |
CepsVector< CepsVector< _Hash > > | m_toReceiveFrom = {} |
Local Halo hash to receive, grouped by origin processor. More... | |
CepsUInt | m_nbGlobalOwned = 0U |
sum of size(m_owned) on whole communicator More... | |
CepsUInt | m_nbGlobalHalo = 0U |
sum of size(m_halo) on whole communicator More... | |
CepsVector< CepsUInt > | m_elementsOffset |
sum of size(m_owned) on processes before owner More... | |
DistributedInfos< _Type, _Hash >::DistributedInfos | ( | ) |
Constructor.
DistributedInfos< _Type, _Hash >::DistributedInfos | ( | const DistributedInfos< _Type, _Hash > & | ) |
Default copy constructor.
DistributedInfos< _Type, _Hash >::~DistributedInfos | ( | ) |
Destructor.
void DistributedInfos< _Type, _Hash >::add | ( | const _Type & | x, |
const _Hash & | hashValue, | ||
const CepsGlobalIndex & | globalId, | ||
const CepsUInt & | pId | ||
) |
Add entry with global ID to the container, hash must be provided, pId selects owned or halo.
void DistributedInfos< _Type, _Hash >::add | ( | const _Type & | x, |
const _Hash & | hashValue, | ||
const CepsUInt & | pId | ||
) |
Add an entry to the container, hash must be provided.
void DistributedInfos< _Type, _Hash >::addHalo | ( | const _Type & | x, |
const _Hash & | hashValue, | ||
const CepsGlobalIndex & | globalId, | ||
const CepsUInt & | fromProcId | ||
) |
Add entry with global ID to the container, halo data, hash must be provided.
void DistributedInfos< _Type, _Hash >::addHalo | ( | const _Type & | x, |
const _Hash & | hashValue, | ||
const CepsUInt & | fromProcId | ||
) |
Add an entry to the container, hash must be provided, halo data.
void DistributedInfos< _Type, _Hash >::addOwned | ( | const _Type & | x, |
const _Hash & | hashValue | ||
) |
Add an entry to the container, hash must be provided, owned data.
void DistributedInfos< _Type, _Hash >::addOwned | ( | const _Type & | x, |
const _Hash & | hashValue, | ||
const CepsGlobalIndex & | globalId | ||
) |
Add entry with global ID to the container, owned data, hash must be provided.
_Type& DistributedInfos< _Type, _Hash >::atGlobal | ( | const CepsGlobalIndex & | globalId, |
const CepsUInt & | pId | ||
) |
Access with given global ID.
const _Type& DistributedInfos< _Type, _Hash >::atGlobal | ( | const CepsGlobalIndex & | globalId, |
const CepsUInt & | pId | ||
) | const |
Access with given global ID.
_Type& DistributedInfos< _Type, _Hash >::atGlobal | ( | const CepsGlobalIndex & | globalId, |
const CepsUInt & | pId, | ||
const _Type & | def | ||
) |
Access with given global ID.
const _Type& DistributedInfos< _Type, _Hash >::atGlobal | ( | const CepsGlobalIndex & | globalId, |
const CepsUInt & | pId, | ||
const _Type & | def | ||
) | const |
const access with given global ID
_Type& DistributedInfos< _Type, _Hash >::atHash | ( | const _Hash & | hashValue, |
const CepsUInt & | pId, | ||
const _Type & | def | ||
) |
Access with given hash.
const _Type& DistributedInfos< _Type, _Hash >::atHash | ( | const _Hash & | hashValue, |
const CepsUInt & | pId, | ||
const _Type & | def | ||
) | const |
const access with given hash
_Type& DistributedInfos< _Type, _Hash >::atLocal | ( | const CepsLocalIndex & | localId, |
const CepsUInt & | pId, | ||
const _Type & | def | ||
) |
Access with given local ID.
const _Type& DistributedInfos< _Type, _Hash >::atLocal | ( | const CepsLocalIndex & | localId, |
const CepsUInt & | pId, | ||
const _Type & | def | ||
) | const |
const access with given local ID
void DistributedInfos< _Type, _Hash >::destroyObjects | ( | ) |
Clears the contents, keeps structure.
CepsUInt DistributedInfos< _Type, _Hash >::getGlobalIndexOffset | ( | CepsProcId | pId | ) | const |
Return the number of elements on the processes before pId This supposes that synchronizeTotalSize has been called beforehand. Use at your own risk.
CepsVector<_Type>& DistributedInfos< _Type, _Hash >::getHalo | ( | ) |
Get halo data owned by neighbor processor, const.
const CepsVector<_Type>& DistributedInfos< _Type, _Hash >::getHalo | ( | ) | const |
Get halo data owned by neighbor processor, const.
_Type& DistributedInfos< _Type, _Hash >::getHalo | ( | CepsUInt | i | ) |
Get halo data owned by neighbor processor with ID i, const.
const _Type& DistributedInfos< _Type, _Hash >::getHalo | ( | CepsUInt | i | ) | const |
Get halo data owned by neighbor processor with ID i, const.
LocalGlobalMapping<_Type,_Hash>* DistributedInfos< _Type, _Hash >::getHaloMapping | ( | ) |
Mapping between global and local index of halo data.
CepsUInt DistributedInfos< _Type, _Hash >::getNumberOfHalo | ( | ) | const |
Number of shared data from other process stored.
CepsUInt DistributedInfos< _Type, _Hash >::getNumberOfOwned | ( | ) | const |
Number of owned data stored.
CepsVector<_Type>& DistributedInfos< _Type, _Hash >::getOwned | ( | ) |
Get data owned by the processor.
const CepsVector<_Type>& DistributedInfos< _Type, _Hash >::getOwned | ( | ) | const |
Get data owned by the processor, const.
_Type& DistributedInfos< _Type, _Hash >::getOwned | ( | CepsUInt | i | ) |
Get data owned by the processor with id i.
const _Type& DistributedInfos< _Type, _Hash >::getOwned | ( | CepsUInt | i | ) | const |
Get data owned by the processor with id i, const.
LocalGlobalMapping<_Type,_Hash>* DistributedInfos< _Type, _Hash >::getOwnedMapping | ( | ) |
Mapping between global and local index of owned data.
CepsUInt DistributedInfos< _Type, _Hash >::getTotalNumberOfEntities | ( | ) | const |
Total number of distributed data amongst all process.
CepsBool DistributedInfos< _Type, _Hash >::hasGlobal | ( | const CepsGlobalIndex & | globalId, |
const CepsUInt & | pId | ||
) | const |
Check if container has data with given global ID.
CepsBool DistributedInfos< _Type, _Hash >::hasHash | ( | const _Hash & | hashValue, |
const CepsUInt & | pId | ||
) | const |
Check if container has data with given hash.
CepsBool DistributedInfos< _Type, _Hash >::hasLocal | ( | const CepsLocalIndex & | localId, |
const CepsUInt & | pId | ||
) | const |
Check if container has data with given local ID.
DistributedInfos& DistributedInfos< _Type, _Hash >::operator= | ( | const DistributedInfos< _Type, _Hash > & | ) |
Default assignment operator.
void DistributedInfos< _Type, _Hash >::reset | ( | ) |
Clears the container.
void DistributedInfos< _Type, _Hash >::synchronize | ( | CepsBool | setGlobalIndicesFromLocals, |
std::function< void(_Type &, CepsGlobalIndex)> | update = nullptr |
||
) |
Recomputes global indices from all local indices, build correct halo global indices.
void DistributedInfos< _Type, _Hash >::synchronizeTotalSize | ( | ) |
Compute the total number of owned elements.
|
protected |
sum of size(m_owned) on processes before owner
Definition at line 242 of file DistributedInfos.hpp.
|
protected |
Proc halo _Type object.
Definition at line 238 of file DistributedInfos.hpp.
|
protected |
sum of size(m_halo) on whole communicator
Definition at line 241 of file DistributedInfos.hpp.
|
protected |
sum of size(m_owned) on whole communicator
Definition at line 240 of file DistributedInfos.hpp.
|
protected |
Proc owned _Type object.
Definition at line 237 of file DistributedInfos.hpp.
|
protected |
Local Halo hash to receive, grouped by origin processor.
Definition at line 239 of file DistributedInfos.hpp.