IBAMR  IBAMR version 0.19.
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SAMRAI::tbox::JobRelauncher Class Reference

Manages an algorithm consisting of multiple relaunchable jobs. More...

#include <tbox/JobRelauncher.h>

Public Member Functions

 JobRelauncher ()
 
void runAlgorithm (RelaunchableJob *initial_job)
 Begin the algorithm. More...
 
void setAlgorithmAdvanceMode (const std::string &algo_advance_mode)
 Set the mode for advancing the asynchronous implementation. More...
 
AsyncCommStagegetCommStage ()
 Return the communication stage managing jobs that are waiting for communication to finish. More...
 
List< RelaunchableJob * > & getRelaunchQueue ()
 Return the queue of jobs waiting for non-communications work. More...
 

Private Types

enum  AlgoAdvanceMode { ROUND_ROBIN, ADVANCE_ANY, ADVANCE_SOME, SYNCHRONOUS }
 Method for advancing the algorithm. More...
 

Private Member Functions

void runAlgorithm_synchronous (RelaunchableJob *initial_job)
 Version of runAlgorithm() that waits for each communication stage to complete before moving on, thus resulting in synchronous execution. More...
 
void runAlgorithm_round_robin (RelaunchableJob *initial_job)
 Version of runAlgorithm() checking communication stages in round-robin fashion instead of using AsyncCommStage. More...
 
void runAlgorithm_advance_any (RelaunchableJob *initial_job)
 Version of runAlgorithm() that advances an execution node through its communication stage by using AsyncCommStage::advanceAny(). More...
 
void runAlgorithm_advance_some (RelaunchableJob *initial_job)
 Version of runAlgorithm() that advances an execution node through its communication stage by using AsyncCommStage::advanceSome(). More...
 

Static Private Member Functions

static void freeTimers ()
 

Private Attributes

List< RelaunchableJob * > d_relaunch_queue
 Queue on which to append jobs to be launched or relaunched. More...
 
AsyncCommStage d_comm_stage
 Stage handling multiple asynchronous communication groups. More...
 
AlgoAdvanceMode d_algo_advance_mode
 

Static Private Attributes

static Pointer< Timert_compute
 Compute timer. More...
 
static Pointer< Timert_commwait
 Communication-wait timer for all modes. More...
 
static Pointer< Timert_commwait_any
 Communication-wait timer for ADVANCE_ANY mode. More...
 
static Pointer< Timert_commwait_some
 Communication-wait timer for ADVANCE_SOME mode. More...
 
static Pointer< Timert_commwait_sync
 Communication-wait timer for SYNCHRONOUS mode. More...
 

Detailed Description

The jobs, defined by the RelaunchableJob base class, may be paused to wait for communication or non-communication to finish and then be restarted.

Member Enumeration Documentation

◆ AlgoAdvanceMode

Each corresponds to a choice permitted by setAlgorithmAdvanceMode().

Enumerator
ROUND_ROBIN 
ADVANCE_ANY 
ADVANCE_SOME 
SYNCHRONOUS 

Constructor & Destructor Documentation

◆ JobRelauncher()

SAMRAI::tbox::JobRelauncher::JobRelauncher ( )

Member Function Documentation

◆ runAlgorithm()

void SAMRAI::tbox::JobRelauncher::runAlgorithm ( RelaunchableJob initial_job)

The algorithm begins with the job given. It may add more jobs to the relaunch queue as it progresses. See getRelaunchQueue().

Parameters
initial_jobThe initial job in the algorithm.

◆ setAlgorithmAdvanceMode()

void SAMRAI::tbox::JobRelauncher::setAlgorithmAdvanceMode ( const std::string &  algo_advance_mode)

Choices are:

  • "SYNCHRONOUS" -> wait for each communication stage to complete before moving on, thus resulting in synchronous execution.
  • "ROUND_ROBIN" -> check for completed communication stages in round-robin fashion instead of waiting for a specific one.
  • "ADVANCE_ANY" -> advance an execution node through its communication stage by using AsyncCommStage::advanceAny().
  • "ADVANCE_SOME" -> advance an execution node through its communication stage by using AsyncCommStage::advanceSome().

The default is "ADVANCE_SOME". This generally is fastest, but the other modes may be better for debugging.

Asynchronous modes are NOT guaranteed to compute the output graph nodes in any particular order. The order depends on the ordering of message completion, which is not deterministic. If you require consistent outputs, we suggest you have a scheme for reordering your output.

◆ getCommStage()

AsyncCommStage& SAMRAI::tbox::JobRelauncher::getCommStage ( )

◆ getRelaunchQueue()

List<RelaunchableJob*>& SAMRAI::tbox::JobRelauncher::getRelaunchQueue ( )

◆ runAlgorithm_synchronous()

void SAMRAI::tbox::JobRelauncher::runAlgorithm_synchronous ( RelaunchableJob initial_job)
private

◆ runAlgorithm_round_robin()

void SAMRAI::tbox::JobRelauncher::runAlgorithm_round_robin ( RelaunchableJob initial_job)
private

◆ runAlgorithm_advance_any()

void SAMRAI::tbox::JobRelauncher::runAlgorithm_advance_any ( RelaunchableJob initial_job)
private

◆ runAlgorithm_advance_some()

void SAMRAI::tbox::JobRelauncher::runAlgorithm_advance_some ( RelaunchableJob initial_job)
private

◆ freeTimers()

static void SAMRAI::tbox::JobRelauncher::freeTimers ( )
staticprivate

Free static timers.

To be called by shutdown registry to make sure memory for timers does not leak.

Member Data Documentation

◆ d_relaunch_queue

List<RelaunchableJob*> SAMRAI::tbox::JobRelauncher::d_relaunch_queue
private

What is placed on the queue depends on the version of runAlgorithm_...() used.

◆ d_comm_stage

AsyncCommStage SAMRAI::tbox::JobRelauncher::d_comm_stage
private

◆ d_algo_advance_mode

AlgoAdvanceMode SAMRAI::tbox::JobRelauncher::d_algo_advance_mode
private

◆ t_compute

Pointer<Timer> SAMRAI::tbox::JobRelauncher::t_compute
staticprivate

◆ t_commwait

Pointer<Timer> SAMRAI::tbox::JobRelauncher::t_commwait
staticprivate

◆ t_commwait_any

Pointer<Timer> SAMRAI::tbox::JobRelauncher::t_commwait_any
staticprivate

◆ t_commwait_some

Pointer<Timer> SAMRAI::tbox::JobRelauncher::t_commwait_some
staticprivate

◆ t_commwait_sync

Pointer<Timer> SAMRAI::tbox::JobRelauncher::t_commwait_sync
staticprivate

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