seapodym-parallel
Fish dynamics models with parameter estimations
|
The TaskStepWorker gets tasks assigned from the TaskStepManager and executes them. More...
#include <TaskStepWorker.h>
Public Member Functions | |
TaskStepWorker (MPI_Comm comm, std::function< void(int, int, int, MPI_Comm)> taskFunc, const std::map< int, int > &stepBegMap, const std::map< int, int > &stepEndMap) | |
void | run () const |
The TaskStepWorker gets tasks assigned from the TaskStepManager and executes them.
Class TaskStepWorker
A task involves running multiple steps and the worker will inform the manager after each step is complete.
TaskStepWorker::TaskStepWorker | ( | MPI_Comm | comm, |
std::function< void(int, int, int, MPI_Comm)> | taskFunc, | ||
const std::map< int, int > & | stepBegMap, | ||
const std::map< int, int > & | stepEndMap ) |
Constructor
comm | MPI communicator |
taskFunc | task function takes task_id, stepBeg, stepEnd and the MPI communicator as input arguments. This function should include a call notifying the manager at the end of each step, ie MPI_Send({task_id, step, result}, 3, MPI_INT, managerRank, END_TASK_TAG, comm); |
stepBegMap | map of task Id to first step index |
stepEndMap | map of task Id to last step index + 1 |
void TaskStepWorker::run | ( | ) | const |
Run the tasks assigned by the TaskManager