22 Poller(MPI_Comm comm,
double delay = 0.1)
48 virtual bool onMessage(MPI_Status status,
size_t recv_value) = 0;
65 size_t recv_value = 0;
70 MPI_Irecv(&recv_value, 1, MPI_UNSIGNED_LONG, MPI_ANY_SOURCE, MPI_ANY_TAG,
78 double tnow = MPI_Wtime();
86 if(req != MPI_REQUEST_NULL) {
87 MPI_Test(&req, &flag, &status);
95 MPI_Irecv(&recv_value, 1, MPI_UNSIGNED_LONG, MPI_ANY_SOURCE,
96 MPI_ANY_TAG,
comm_m, &req);
double last_polled_
time of last MPI_Test
virtual void postPoll()=0
executed after handling (if any) new request
double poll_delay_
delay in seconds between polls
virtual void prePoll()=0
executed before checking for new request
virtual void setupPoll()=0
executed before starting polling loop
virtual bool onMessage(MPI_Status status, size_t recv_value)=0
Poller(MPI_Comm comm, double delay=0.1)
virtual void onStop()=0
enable implementation to react to STOP tag
An interface implementing the basics of a poll loop, posting an MPI_Irecv and waiting for new request...
MPI_Comm comm_m
communicator the poller listens to requests
#define MPI_STOP_TAG
global stop tag to exit poll loop (