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

#include <location_manager.h>

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

Public Types

typedef api::communication::TypedMpi< DistributedIdIdMpi
 
typedef api::communication::TypedMpi< std::pair< DistributedId, int > > LocationMpi
 
- Public Types inherited from fpmas::api::graph::LocationManager< T >
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 NodeMapgetLocalNodes () const override
 
const NodeMapgetDistantNodes () 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 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::graph::LocationManager< T >

api::graph::LocationManager implementation.

Member Typedef Documentation

◆ IdMpi

template<typename T >
typedef api::communication::TypedMpi<DistributedId> fpmas::graph::LocationManager< T >::IdMpi

Type used to transmit DistributedId with MPI.

◆ LocationMpi

template<typename T >
typedef api::communication::TypedMpi<std::pair<DistributedId, int> > fpmas::graph::LocationManager< T >::LocationMpi

Type used to transmit node locations with MPI.

Constructor & Destructor Documentation

◆ LocationManager()

template<typename T >
fpmas::graph::LocationManager< T >::LocationManager ( api::communication::MpiCommunicator comm,
IdMpi id_mpi,
LocationMpi location_mpi 
)
inline

LocationManager constructor.

Parameters
commMPI communicator
id_mpiIdMpi instance
location_mpiLocationMpi instance

Member Function Documentation

◆ addManagedNode() [1/2]

template<typename T >
void fpmas::graph::LocationManager< T >::addManagedNode ( api::graph::DistributedNode< T > *  node,
int  initial_location 
)
inlineoverridevirtual
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

Implements fpmas::api::graph::LocationManager< T >.

◆ addManagedNode() [2/2]

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

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

Implements fpmas::api::graph::LocationManager< T >.

◆ removeManagedNode() [1/2]

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

Removes a previously managed node.

Parameters
nodenode to remove from managed nodes

Implements fpmas::api::graph::LocationManager< T >.

◆ removeManagedNode() [2/2]

template<typename T >
void fpmas::graph::LocationManager< T >::removeManagedNode ( DistributedId  id)
inlineoverridevirtual

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

Parameters
idid of the node to remove from managed nodes

Implements fpmas::api::graph::LocationManager< T >.

◆ setLocal()

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

Parameters
nodenode to set LOCAL

Implements fpmas::api::graph::LocationManager< T >.

◆ setDistant()

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

Parameters
nodenode to set DISTANT

Implements fpmas::api::graph::LocationManager< T >.

◆ remove()

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

Removes a LOCAL or DISTANT node.

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

Parameters
nodenode to remove

Implements fpmas::api::graph::LocationManager< T >.

◆ getLocalNodes()

template<typename T >
const NodeMap & fpmas::graph::LocationManager< T >::getLocalNodes ( ) const
inlineoverridevirtual

Returns a NodeMap containing DistributedNodes that are LOCAL.

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

Returns
LOCAL nodes map

Implements fpmas::api::graph::LocationManager< T >.

◆ getDistantNodes()

template<typename T >
const NodeMap & fpmas::graph::LocationManager< T >::getDistantNodes ( ) const
inlineoverridevirtual

Returns a NodeMap containing DistributedNodes that are DISTANT.

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

Returns
DISTANT nodes map

Implements fpmas::api::graph::LocationManager< T >.

◆ updateLocations()

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

◆ getCurrentLocations()

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

Returns the current location of nodes managed by this LocationManager.

Returns
managed nodes locations

Implements fpmas::api::graph::LocationManager< T >.


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