![]() |
fpmas 1.6
|
#include <location_manager.h>
Public Types | |
typedef api::communication::TypedMpi< DistributedId > | IdMpi |
typedef api::communication::TypedMpi< std::pair< DistributedId, int > > | LocationMpi |
![]() | |
typedef fpmas::api::graph::Graph< DistributedNode< T >, DistributedEdge< T > >::NodeMap | NodeMap |
Public Member Functions | |
LocationManager (api::communication::MpiCommunicator &comm, IdMpi &id_mpi, LocationMpi &location_mpi) | |
void | addManagedNode (api::graph::DistributedNode< T > *node, int initial_location) override |
void | addManagedNode (DistributedId id, int initial_location) override |
void | removeManagedNode (api::graph::DistributedNode< T > *node) override |
void | removeManagedNode (DistributedId id) override |
void | setLocal (api::graph::DistributedNode< T > *) override |
void | setDistant (api::graph::DistributedNode< T > *) override |
void | remove (api::graph::DistributedNode< T > *) override |
const NodeMap & | getLocalNodes () const override |
const NodeMap & | getDistantNodes () const override |
void | updateLocations () override |
std::unordered_map< DistributedId, int > | getCurrentLocations () const override |
virtual void | addManagedNode (DistributedNode< T > *node, int initial_location)=0 |
virtual void | addManagedNode (DistributedId id, int initial_location)=0 |
virtual void | removeManagedNode (DistributedNode< T > *node)=0 |
virtual void | removeManagedNode (DistributedId id)=0 |
virtual std::unordered_map< DistributedId, int > | getCurrentLocations () const =0 |
virtual const NodeMap & | getLocalNodes () const =0 |
virtual const NodeMap & | getDistantNodes () const =0 |
virtual void | setLocal (DistributedNode< T > *node)=0 |
virtual void | setDistant (DistributedNode< T > *node)=0 |
virtual void | remove (DistributedNode< T > *node)=0 |
virtual void | updateLocations ()=0 |
api::graph::LocationManager implementation.
typedef api::communication::TypedMpi<DistributedId> fpmas::graph::LocationManager< T >::IdMpi |
Type used to transmit DistributedId with MPI.
typedef api::communication::TypedMpi<std::pair<DistributedId, int> > fpmas::graph::LocationManager< T >::LocationMpi |
Type used to transmit node locations with MPI.
|
inline |
LocationManager constructor.
comm | MPI communicator |
id_mpi | IdMpi instance |
location_mpi | LocationMpi instance |
|
inlineoverridevirtual |
Sets up the specified node to be managed by the LocationManager.
node | node to manage |
initial_location | initial rank of the node |
Implements fpmas::api::graph::LocationManager< T >.
|
inlineoverridevirtual |
Sets up the node corresponding to the specified id
to be managed by the LocationManager.
id | id of the node to manage |
initial_location | initial rank of the node |
Implements fpmas::api::graph::LocationManager< T >.
|
inlineoverridevirtual |
Removes a previously managed node.
node | node to remove from managed nodes |
Implements fpmas::api::graph::LocationManager< T >.
|
inlineoverridevirtual |
Removes the node corresponding to the specified id
from the set of managed nodes.
id | id of the node to remove from managed nodes |
Implements fpmas::api::graph::LocationManager< T >.
|
overridevirtual |
Update the state of a node to local.
Upon return, the state of the DistributedNode is set to LOCAL and its location is set to the current process rank.
Moreover, the node will be returned by getLocalNodes().
node | node to set LOCAL |
Implements fpmas::api::graph::LocationManager< T >.
|
overridevirtual |
Update the state of a node to distant.
Upon return, the state of the DistributedNode is set to DISTANT. The location of the node is undefined until it is updated by the next call to updateLocations().
Moreover, the node will be returned by getDistantNodes().
node | node to set DISTANT |
Implements fpmas::api::graph::LocationManager< T >.
|
overridevirtual |
Removes a LOCAL or DISTANT node.
Upon return, the node is neither returned by getLocalNodes() or getDistantNodes().
node | node to remove |
Implements fpmas::api::graph::LocationManager< T >.
|
inlineoverridevirtual |
Returns a NodeMap containing DistributedNodes that are LOCAL.
More precisely, returns nodes whose last location update was performed with setLocal().
Implements fpmas::api::graph::LocationManager< T >.
|
inlineoverridevirtual |
Returns a NodeMap containing DistributedNodes that are DISTANT.
More precisely, returns nodes whose last location update was performed with setDistant().
Implements fpmas::api::graph::LocationManager< T >.
|
overridevirtual |
Updates nodes locations.
This functions is synchronous : it blocks until all LocationManager instances on each process call this function.
Upon return, DistributedNode::getLocation() is assumed to return an updated value for all the nodes that where registered using setLocal() or setDistant().
Implements fpmas::api::graph::LocationManager< T >.
|
inlineoverridevirtual |
Returns the current location of nodes managed by this LocationManager.
Implements fpmas::api::graph::LocationManager< T >.