#include <distributed_id.h>
Distributed IdType
implementation, used by any DistributedGraph.
The id is represented by a pair constituted by:
- The rank on which the item where created
- An incrementing local id of type FPMAS_ID_TYPE
◆ DistributedId() [1/4]
fpmas::api::graph::DistributedId::DistributedId |
( |
const MpiDistributedId & |
mpi_id | ) |
|
|
inlineexplicit |
Converts an MpiDistributedId instance into a DistributedId.
- Parameters
-
mpi_id | MpiDistributedId to convert |
◆ DistributedId() [2/4]
fpmas::api::graph::DistributedId::DistributedId |
( |
| ) |
|
|
inline |
◆ DistributedId() [3/4]
fpmas::api::graph::DistributedId::DistributedId |
( |
int |
rank | ) |
|
|
inlineexplicit |
Initializes a DistributedId instance for the specified proc.
Local id starts from 0.
- Parameters
-
◆ DistributedId() [4/4]
fpmas::api::graph::DistributedId::DistributedId |
( |
int |
rank, |
|
|
FPMAS_ID_TYPE |
id |
|
) |
| |
|
inline |
Initializes a DistributedId instance from the specified rank and id.
- Parameters
-
rank | MPI rank |
id | initial local id value |
◆ rank()
int fpmas::api::graph::DistributedId::rank |
( |
| ) |
const |
|
inline |
◆ id()
Current local id.
- Returns
- local id
◆ operator++()
DistributedId fpmas::api::graph::DistributedId::operator++ |
( |
int |
| ) |
|
|
inline |
Returns the current DistributedId value and increments its local id.
◆ operator<()
bool fpmas::api::graph::DistributedId::operator< |
( |
const DistributedId & |
other | ) |
const |
|
inline |
Comparison function that allows DistributedId usage in std::set.
First, perform a comparison on the rank
of the two instances, and return the result if one is less or greater than the other.
If the two ranks are equal, return the result of the comparison of the local ids.
◆ operator<=()
bool fpmas::api::graph::DistributedId::operator<= |
( |
const DistributedId & |
other | ) |
const |
|
inline |
◆ operator==()
bool fpmas::api::graph::DistributedId::operator== |
( |
const DistributedId & |
other | ) |
const |
|
inline |
Two DistributedId instances are equal iff their ranks and their ids are equal.
- Returns
- comparison result
◆ operator!=()
bool fpmas::api::graph::DistributedId::operator!= |
( |
const DistributedId & |
other | ) |
const |
|
inline |
Two DistributedId instances are not equal iff their ranks or their ids are different.
- Returns
- comparison result
◆ operator std::string()
fpmas::api::graph::DistributedId::operator std::string |
( |
| ) |
const |
|
inline |
◆ hash()
std::size_t fpmas::api::graph::DistributedId::hash |
( |
| ) |
const |
|
inline |
◆ max_rank
int fpmas::DistributedId::max_rank = std::numeric_limits<int>::max() |
|
static |
The maximum rank that can be represented.
◆ max_id
The maximum id that can be represented.
This can be controlled defining a custom FPMAS_ID_TYPE.
Overflows, that might occur if the FPMAS_ID_TYPE is not large enough to represent ids of all DistributedNodes and DistributedEdges created during a single simulation, will produce unexpected behaviors.
◆ mpiDistributedIdType
MPI_Datatype fpmas::api::graph::DistributedId::mpiDistributedIdType |
|
static |
MPI_Datatype used to send and receive DistributedIds.
Should be initialized with fpmas::communication::createMpiTypes and freed with fpmas::communication::freeMpiTypes
The documentation for this class was generated from the following files: