36 m_procIds({owner}), m_isShared(
false)
45 return m_isShared or m_procIds.size()>1;
58 if (m_procIds.size() == 0)
61 m_procIds.at (0) = pid;
68 return m_procIds.at(0);
75 "can not set as halo for the processus \"" << pid <<
"\", because it is the owner"
85 return (m_procIds[0] == pid ?
false :
ceps::contains(m_procIds,pid));
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::vector< _Type, _Alloc > CepsVector
C++ vector.
CepsUInt CepsProcId
For CPU indices.
CepsBool isHaloFor(const CepsProcId &pid) const
Detect if this entity is in the halo of.
const CepsProcId & getOwner() const
Get owner (processus id) of this entity.
void setShared(CepsBool flag)
Tells if there are halo CPUs.
CepsBool isShared() const
Tells if there are halo CPUs.
void setAsHaloFor(const CepsProcId &pid)
Adds pid to the set of halo CPUs
HoldsProcIds()=default
Default constructor.
void setOwner(const CepsProcId &pid)
Set shared between several processes ?
void reset()
Gives ownership to rank(), removes halos.
CepsBool contains(const CepsVector< _Type, _Alloc > &vec, const _Type &item)
Tells if vectors contains a given item.
CepsUInt getRank()
Returns current processor rank.
void insertUnique(CepsVector< _Type, _Alloc > &vec, InputIt first, InputIt last)
Set behaviour: insert if elements does not exist in vector.