![]() |
fpmas 1.6
|
#include <hard_sync_linker.h>
Public Types | |
typedef fpmas::api::graph::DistributedEdge< T > | EdgeApi |
typedef fpmas::api::graph::DistributedNode< T > | NodeApi |
typedef fpmas::api::communication::TypedMpi< graph::EdgePtrWrapper< T > > | EdgeMpi |
typedef fpmas::api::communication::TypedMpi< DistributedId > | IdMpi |
Public Member Functions | |
LinkClient (fpmas::api::communication::MpiCommunicator &comm, IdMpi &id_mpi, EdgeMpi &edge_mpi, ServerPackBase &server_pack) | |
void | link (const EdgeApi *) override |
void | unlink (const EdgeApi *) override |
void | removeNode (const NodeApi *) override |
virtual void | link (const fpmas::api::graph::DistributedEdge< T > *edge)=0 |
virtual void | unlink (const fpmas::api::graph::DistributedEdge< T > *edge)=0 |
virtual void | removeNode (const fpmas::api::graph::DistributedNode< T > *node)=0 |
api::LinkClient implementation.
typedef fpmas::api::graph::DistributedEdge<T> fpmas::synchro::hard::hard_link::LinkClient< T >::EdgeApi |
DistributedEdge API.
typedef fpmas::api::graph::DistributedNode<T> fpmas::synchro::hard::hard_link::LinkClient< T >::NodeApi |
DistributedNode API.
typedef fpmas::api::communication::TypedMpi<graph::EdgePtrWrapper<T> > fpmas::synchro::hard::hard_link::LinkClient< T >::EdgeMpi |
TypedMpi used to transmit Edges with MPI.
typedef fpmas::api::communication::TypedMpi<DistributedId> fpmas::synchro::hard::hard_link::LinkClient< T >::IdMpi |
TypedMpi used to transmit DistributedIds with MPI.
|
inline |
LinkClient constructor.
comm | MPI communicator |
id_mpi | Typed MPI used to transmit DistributedId |
edge_mpi | Typed MPI used to transmit edges |
server_pack | associated ServerPack. The ServerPack is used to handle incoming requests (see ServerPack::waitSendRequest()) while the client is waiting for requests to be sent, in order to avoid deadlocks. |
|
overridevirtual |
Transmits a link request for the specified edge
.
The provided edge is assumed to be DISTANT, behavior is undefined otherwise.
The request is then transmitted to two other processes if source and target nodes are DISTANT and located on different processes, or to one process if they are located on the same process.
In any case, it is guaranteed that the edge is properly linked on any process involved upon return.
Notice that the api::graph::DistributedGraph implementation ensures that source and target nodes are share locked when this method is called.
edge | edge to link |
Implements fpmas::synchro::hard::api::LinkClient< T >.
|
overridevirtual |
Transmits an unlink request for the specified edge
.
The provided edge is assumed to be DISTANT, behavior is undefined otherwise.
The request is then transmitted to two other processes if source and target nodes are DISTANT and located on different processes, or to one process if they are located on the same process.
In any case, it is guaranteed that the edge is properly unlinked on any process involved upon return.
Notice that the api::graph::DistributedGraph implementation ensures that source and target nodes are share locked when this method is called.
edge | edge to unlink |
Implements fpmas::synchro::hard::api::LinkClient< T >.
|
overridevirtual |
Transmits a remove node request for the specified node
.
The provided edge is assumed to be DISTANT, behavior is undefined otherwise.
The request is transmitted to the process which own the node
. It is then the role of the owner to globally unlink the node from the graph.
Upon return, it is guaranteed that the node
is globally unlinked from the graph.
However, the node might be erased only when fpmas::api::graph::DistributedGraph::synchronize() is called. The reason for that is that in HardSyncMode, even if the node is unlinked by this method, mutex requests for this node that were send before the node was unlinked might be received after it was unlinked, until the termination algorithm is applied. Because we need to handle those requests, the node can't be erased until the termination algorithm is applied.
However, after this method has returned, it is guaranteed that no process can perform mutex requests to this node since it's globally unlinked from the graph.
node | DISTANT node to remove |
Implements fpmas::synchro::hard::api::LinkClient< T >.