seapodym-parallel
Fish dynamics models with parameter estimations
Loading...
Searching...
No Matches
TaskStepWorker Class Reference

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

Detailed Description

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.

See also
TaskStepManager

Constructor & Destructor Documentation

◆ TaskStepWorker()

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

Parameters
commMPI communicator
taskFunctask 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);
stepBegMapmap of task Id to first step index
stepEndMapmap of task Id to last step index + 1

Member Function Documentation

◆ run()

void TaskStepWorker::run ( ) const

Run the tasks assigned by the TaskManager


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