fpmas 1.6
Public Types | Public Member Functions | List of all members
fpmas::api::graph::LocationManager< T > Class Template Referenceabstract

#include <location_manager.h>

Inheritance diagram for fpmas::api::graph::LocationManager< T >:
Inheritance graph
[legend]

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 NodeMapgetLocalNodes () const =0
 
virtual const NodeMapgetDistantNodes () 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
 

Detailed Description

template<typename T>
class fpmas::api::graph::LocationManager< T >

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.

Member Typedef Documentation

◆ NodeMap

template<typename T >
typedef fpmas::api::graph::Graph<DistributedNode<T>,DistributedEdge<T>>::NodeMap fpmas::api::graph::LocationManager< T >::NodeMap

Node map type.

Member Function Documentation

◆ addManagedNode() [1/2]

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::addManagedNode ( DistributedNode< T > *  node,
int  initial_location 
)
pure virtual
Deprecated:
Use addManagedNode(DistributedId, int) instead.

Sets up the specified node to be managed by the LocationManager.

Parameters
nodenode to manage
initial_locationinitial rank of the node

Implemented in fpmas::graph::LocationManager< T >.

◆ addManagedNode() [2/2]

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::addManagedNode ( DistributedId  id,
int  initial_location 
)
pure virtual

Sets up the node corresponding to the specified id to be managed by the LocationManager.

Parameters
idid of the node to manage
initial_locationinitial rank of the node

Implemented in fpmas::graph::LocationManager< T >.

◆ removeManagedNode() [1/2]

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::removeManagedNode ( DistributedNode< T > *  node)
pure virtual
Deprecated:
Use removeManagedNode(DistributedId) instead.

Removes a previously managed node.

Parameters
nodenode to remove from managed nodes

Implemented in fpmas::graph::LocationManager< T >.

◆ removeManagedNode() [2/2]

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::removeManagedNode ( DistributedId  id)
pure virtual

Removes the node corresponding to the specified id from the set of managed nodes.

Parameters
idid of the node to remove from managed nodes

Implemented in fpmas::graph::LocationManager< T >.

◆ getCurrentLocations()

template<typename T >
virtual std::unordered_map< DistributedId, int > fpmas::api::graph::LocationManager< T >::getCurrentLocations ( ) const
pure virtual

Returns the current location of nodes managed by this LocationManager.

Returns
managed nodes locations

Implemented in fpmas::graph::LocationManager< T >.

◆ getLocalNodes()

template<typename T >
virtual const NodeMap & fpmas::api::graph::LocationManager< T >::getLocalNodes ( ) const
pure virtual

Returns a NodeMap containing DistributedNodes that are LOCAL.

More precisely, returns nodes whose last location update was performed with setLocal().

Returns
LOCAL nodes map

Implemented in fpmas::graph::LocationManager< T >.

◆ getDistantNodes()

template<typename T >
virtual const NodeMap & fpmas::api::graph::LocationManager< T >::getDistantNodes ( ) const
pure virtual

Returns a NodeMap containing DistributedNodes that are DISTANT.

More precisely, returns nodes whose last location update was performed with setDistant().

Returns
DISTANT nodes map

Implemented in fpmas::graph::LocationManager< T >.

◆ setLocal()

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::setLocal ( DistributedNode< T > *  node)
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().

Parameters
nodenode to set LOCAL

Implemented in fpmas::graph::LocationManager< T >.

◆ setDistant()

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::setDistant ( DistributedNode< T > *  node)
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().

Parameters
nodenode to set DISTANT

Implemented in fpmas::graph::LocationManager< T >.

◆ remove()

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::remove ( DistributedNode< T > *  node)
pure virtual

Removes a LOCAL or DISTANT node.

Upon return, the node is neither returned by getLocalNodes() or getDistantNodes().

Parameters
nodenode to remove

Implemented in fpmas::graph::LocationManager< T >.

◆ updateLocations()

template<typename T >
virtual void fpmas::api::graph::LocationManager< T >::updateLocations ( )
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 >.


The documentation for this class was generated from the following file: