![]() |
fpmas 1.6
|
#include <termination.h>
Public Member Functions | |
TerminationAlgorithm (fpmas::api::communication::MpiCommunicator &comm, fpmas::api::communication::TypedMpi< Color > &color_mpi) | |
void | terminate (api::Server &server) override |
virtual void | terminate (Server &server)=0 |
api::TerminationAlgorithm implementation.
More precisely, this class implements the Dijkstra-Feijen-Gasteren algorithm to establish the termination of the provided api::Server.
|
inline |
TerminationAlgorithm constructor.
comm | MPI communicator used to exchange termination messages |
color_mpi | Typed MPI instance used to transmit Color |
|
overridevirtual |
Apply the termination algorithm to the provided server.
Termination is determined when all the processes have entered this function and no more request is pending in the global process. In consequence, the argument server must still be able to respond to requests from processes that have not terminated yet while the termination algorithm is applied to ensure progress. This can be performed in practice by the termination algorithm using the Server::handleIncomingRequests() method.
Moreover, the termination algorithm must toggle the Server Epoch once termination has been detected.
server | server to terminate |
Implements fpmas::synchro::hard::api::TerminationAlgorithm.