EvolvingObjects
|
Contains informations on the available workers and allows to find assignees for jobs. More...
#include <eoMpiAssignmentAlgorithm.h>
Public Member Functions | |
virtual int | get ()=0 |
Gets the rank of an available worker, so as to send it a task. | |
virtual int | availableWorkers ()=0 |
Gets the number of total available workers. | |
virtual void | confirm (int wrkRank)=0 |
Reinject the worker of indicated rank in the available state. | |
virtual std::vector< int > | idles ()=0 |
Indicates who are the workers which do nothing. | |
virtual void | reinit (int runs)=0 |
Reinitializes the assignment algorithm with the right number of runs. |
Contains informations on the available workers and allows to find assignees for jobs.
Available workers are workers who aren't processing anything. When they've received an order, workers switch from the state "available" to the state "busy", and the master has to wait for their response for considering them available again.
Definition at line 49 of file eoMpiAssignmentAlgorithm.h.
virtual int eo::mpi::AssignmentAlgorithm::get | ( | ) | [pure virtual] |
Gets the rank of an available worker, so as to send it a task.
Implemented in eo::mpi::StaticAssignmentAlgorithm, and eo::mpi::DynamicAssignmentAlgorithm.
Referenced by eo::mpi::Job< void >::master().
virtual int eo::mpi::AssignmentAlgorithm::availableWorkers | ( | ) | [pure virtual] |
Gets the number of total available workers.
Before the first call, it is equal to the total number of present workers, as specified in the specific assignment algorithm constructor. It allows the Job class to know when all the responses have been received, by comparing this number to the total number of workers.
Implemented in eo::mpi::StaticAssignmentAlgorithm, and eo::mpi::DynamicAssignmentAlgorithm.
Referenced by eo::mpi::Job< void >::master().
virtual void eo::mpi::AssignmentAlgorithm::confirm | ( | int | wrkRank | ) | [pure virtual] |
Reinject the worker of indicated rank in the available state.
wrkRank | The MPI rank of the worker who has finished its job. |
Implemented in eo::mpi::StaticAssignmentAlgorithm, and eo::mpi::DynamicAssignmentAlgorithm.
Referenced by eo::mpi::Job< void >::master().
virtual std::vector<int> eo::mpi::AssignmentAlgorithm::idles | ( | ) | [pure virtual] |
Indicates who are the workers which do nothing.
At the end of the algorithm, the master has to warn all the workers that it's done. All the workers mean, the workers which are currently processing data, and the other ones who could be waiting : the idles. This function indicates to the master which worker aren't doing anything.
Implemented in eo::mpi::StaticAssignmentAlgorithm, and eo::mpi::DynamicAssignmentAlgorithm.
virtual void eo::mpi::AssignmentAlgorithm::reinit | ( | int | runs | ) | [pure virtual] |
Reinitializes the assignment algorithm with the right number of runs.
In fact, this is only useful for static assignment algorithm, which has to be reinitialized every time it's used, in the case of a Multi Job. It's the user's responsability to call this function.
Implemented in eo::mpi::StaticAssignmentAlgorithm, and eo::mpi::DynamicAssignmentAlgorithm.