OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Poller Class Referenceabstract

#include <Poller.h>

Inheritance diagram for Poller:
Inheritance graph
[legend]

Public Member Functions

 Poller (MPI_Comm comm, double delay=0.1)
 
virtual ~Poller ()
 

Protected Member Functions

virtual bool onMessage (MPI_Status status, size_t recv_value)=0
 
virtual void onStop ()=0
 enable implementation to react to STOP tag More...
 
virtual void setupPoll ()=0
 executed before starting polling loop More...
 
virtual void prePoll ()=0
 executed before checking for new request More...
 
virtual void postPoll ()=0
 executed after handling (if any) new request More...
 
virtual void run ()
 

Protected Attributes

MPI_Comm comm_m
 communicator the poller listens to requests More...
 
bool is_running_
 
double last_polled_
 time of last MPI_Test More...
 
double poll_delay_
 delay in seconds between polls More...
 

Detailed Description

Definition at line 35 of file Poller.h.

Constructor & Destructor Documentation

◆ Poller()

Poller::Poller ( MPI_Comm  comm,
double  delay = 0.1 
)
inline

Definition at line 39 of file Poller.h.

References last_polled_.

◆ ~Poller()

virtual Poller::~Poller ( )
inlinevirtual

Definition at line 47 of file Poller.h.

Member Function Documentation

◆ onMessage()

virtual bool Poller::onMessage ( MPI_Status  status,
size_t  recv_value 
)
protectedpure virtual

◆ onStop()

virtual void Poller::onStop ( )
protectedpure virtual

◆ postPoll()

virtual void Poller::postPoll ( )
protectedpure virtual

◆ prePoll()

virtual void Poller::prePoll ( )
protectedpure virtual

◆ run()

virtual void Poller::run ( )
inlineprotectedvirtual

The poll loop stops when receiving a 'MPI_STOP_TAG' otherwise passes message to user.

Reimplemented in Pilot< Opt_t, Sim_t, SolPropagationGraph_t, Comm_t >.

Definition at line 79 of file Poller.h.

References comm_m, is_running_, last_polled_, MPI_STOP_TAG, onMessage(), onStop(), poll_delay_, postPoll(), prePoll(), and setupPoll().

Referenced by Sampler::initialize(), SampleWorker< Sim_t >::onMessage(), SampleWorker< Sim_t >::runSlave(), SampleWorker< Sim_t >::SampleWorker(), and Worker< Sim_t >::Worker().

Here is the call graph for this function:

◆ setupPoll()

virtual void Poller::setupPoll ( )
protectedpure virtual

Member Data Documentation

◆ comm_m

MPI_Comm Poller::comm_m
protected

◆ is_running_

bool Poller::is_running_
protected

Definition at line 54 of file Poller.h.

Referenced by run(), Worker< Sim_t >::runCoWorker(), and SampleWorker< Sim_t >::runSlave().

◆ last_polled_

double Poller::last_polled_
protected

time of last MPI_Test

Definition at line 57 of file Poller.h.

Referenced by Poller(), and run().

◆ poll_delay_

double Poller::poll_delay_
protected

delay in seconds between polls

Definition at line 59 of file Poller.h.

Referenced by run().


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