ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
The interface of the MPI callback mechanism. More...
#include <MpiCallbacks.hpp>
Classes | |
class | CallbackHandle |
RAII handle for a callback. More... | |
Public Member Functions | |
MpiCallbacks (MpiCallbacks const &)=delete | |
MpiCallbacks & | operator= (MpiCallbacks const &)=delete |
MpiCallbacks (boost::mpi::communicator comm, std::shared_ptr< boost::mpi::environment > mpi_env) | |
~MpiCallbacks () | |
template<class... Args> | |
void | add (void(*fp)(Args...)) |
Add a new callback. | |
template<class... Args, class... ArgRef> | |
auto | call (void(*fp)(Args...), ArgRef &&...args) const -> std::enable_if_t< std::is_void_v< decltype(fp(args...))> > |
Call a callback on worker nodes. | |
template<class... Args, class... ArgRef> | |
auto | call_all (void(*fp)(Args...), ArgRef &&...args) const -> std::enable_if_t< std::is_void_v< decltype(fp(args...))> > |
Call a callback on all nodes. | |
void | loop () const |
Start the MPI loop. | |
void | abort_loop () |
Abort the MPI loop. | |
boost::mpi::communicator const & | comm () const |
The boost mpi communicator used by this instance. | |
std::shared_ptr< boost::mpi::environment > | share_mpi_env () const |
Static Public Member Functions | |
template<class... Args> | |
static void | add_static (void(*fp)(Args...)) |
Add a new callback. | |
The interface of the MPI callback mechanism.
Definition at line 186 of file MpiCallbacks.hpp.
|
delete |
|
inline |
Definition at line 257 of file MpiCallbacks.hpp.
|
inline |
Definition at line 268 of file MpiCallbacks.hpp.
References abort_loop().
|
inline |
Abort the MPI loop.
Make the worker nodes exit the MPI loop.
Definition at line 439 of file MpiCallbacks.hpp.
Referenced by ~MpiCallbacks().
|
inline |
Add a new callback.
Add a new callback to the system. This is a collective function that must be run on all nodes.
fp | Pointer to the static callback function to add. |
Definition at line 304 of file MpiCallbacks.hpp.
|
inlinestatic |
Add a new callback.
Add a new callback to the system. This is a collective function that must be run on all nodes.
fp | Pointer to the static callback function to add. |
Definition at line 318 of file MpiCallbacks.hpp.
Referenced by Communication::RegisterCallback::RegisterCallback().
|
inline |
Call a callback on worker nodes.
The callback is not called on the head node.
This method can only be called on the head node.
fp | Pointer to the function to call. |
args | Arguments for the callback. |
Definition at line 382 of file MpiCallbacks.hpp.
|
inline |
Call a callback on all nodes.
This calls a callback on all nodes, including the head node.
This method can only be called on the head node.
fp | Pointer to the function to call. |
args | Arguments for the callback. |
Definition at line 401 of file MpiCallbacks.hpp.
Referenced by get_particle_data(), and mpi_call_all().
|
inline |
The boost mpi communicator used by this instance.
Definition at line 444 of file MpiCallbacks.hpp.
|
inline |
Start the MPI loop.
This is the callback loop for the worker nodes. They block on the MPI call and wait for a new callback request coming from the head node. This should be run on the worker nodes and must be running so that the head node can issue call().
Definition at line 417 of file MpiCallbacks.hpp.
Referenced by mpi_loop().
|
delete |
|
inline |
Definition at line 446 of file MpiCallbacks.hpp.