JANA2
JScheduler Class Reference

Scheduler assigns Arrows to Workers in a first-come-first-serve manner, not unlike OpenMP's schedule dynamic. More...

#include <JScheduler.h>

Collaboration diagram for JScheduler:

Public Member Functions

 JScheduler (const std::vector< JArrow * > &arrows)
 Constructor. Note that a Scheduler operates on a vector of Arrow*s.
 
JArrownext_assignment (uint32_t worker_id, JArrow *assignment, JArrowMetrics::Status result)
 Lets a Worker ask the Scheduler for another assignment. More...
 
void last_assignment (uint32_t worker_id, JArrow *assignment, JArrowMetrics::Status result)
 Lets a Worker tell the scheduler that he is shutting down and won't be working on his assignment any more. More...
 

Public Attributes

JLogger logger
 Logger is public so that somebody else can configure it.
 

Detailed Description

Scheduler assigns Arrows to Workers in a first-come-first-serve manner, not unlike OpenMP's schedule dynamic.

Member Function Documentation

void JScheduler::last_assignment ( uint32_t  worker_id,
JArrow assignment,
JArrowMetrics::Status  result 
)

Lets a Worker tell the scheduler that he is shutting down and won't be working on his assignment any more.

The scheduler is thus free to reassign the arrow to one of the remaining workers.

References logger.

Referenced by JWorker::loop().

Here is the caller graph for this function:

JArrow * JScheduler::next_assignment ( uint32_t  worker_id,
JArrow assignment,
JArrowMetrics::Status  result 
)

Lets a Worker ask the Scheduler for another assignment.

If no assignments make sense, Scheduler returns nullptr, which tells that Worker to idle until his next checkin. If next_assignment() makes any changes to internal Scheduler state or to any of its arrows, it must be synchronized.

References logger.

Referenced by JWorker::loop().

Here is the caller graph for this function:


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