![]() |
fpmas 1.6
|
#include <location_manager.h>
Public Types | |
typedef fpmas::api::graph::Graph< DistributedNode< T >, DistributedEdge< T > >::NodeMap | NodeMap |
Public Member Functions | |
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 |
LocationManager API.
The purpose of the LocationManager is to provide an easy access to LOCAL and DISTANT Nodes within a local DistributedGraph, and to update DISTANT nodes locations so that DistributedNode::getLocation() always returns an updated value.
Moreover, each LocationManager is assumed to maintain a "managed nodes" collection. When a node is "managed" by a LocationManager, other processes (and, more particularly, other LocationManager instances) can ask this LocationManager for the current location of the node. Notice that the fact that a node is managed by the LocationManager does not mean that the node is located on the same process than this LocationManager. It only means that this LocationManager knows where the node is currently located.
Each DistributedNode in the DistributedGraph is assumed to be managed by exactly one LocationManager in the global execution.
typedef fpmas::api::graph::Graph<DistributedNode<T>,DistributedEdge<T>>::NodeMap fpmas::api::graph::LocationManager< T >::NodeMap |
Node map type.
|
pure virtual |
Sets up the specified node to be managed by the LocationManager.
node | node to manage |
initial_location | initial rank of the node |
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
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 |
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
Removes a previously managed node.
node | node to remove from managed nodes |
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
Removes the node corresponding to the specified id
from the set of managed nodes.
id | id of the node to remove from managed nodes |
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
Returns the current location of nodes managed by this LocationManager.
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
Returns a NodeMap containing DistributedNodes that are LOCAL.
More precisely, returns nodes whose last location update was performed with setLocal().
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
Returns a NodeMap containing DistributedNodes that are DISTANT.
More precisely, returns nodes whose last location update was performed with setDistant().
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
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 |
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
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 |
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
Removes a LOCAL or DISTANT node.
Upon return, the node is neither returned by getLocalNodes() or getDistantNodes().
node | node to remove |
Implemented in fpmas::graph::LocationManager< T >.
|
pure virtual |
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().
Implemented in fpmas::graph::LocationManager< T >.