EvolvingObjects
eo::mpi::ParallelApplyData< EOT > Struct Template Reference

Data useful for a parallel apply (map). More...

#include <eoParallelApply.h>

List of all members.

Public Member Functions

 ParallelApplyData (eoUF< EOT &, void > &_proc, int _masterRank, int _packetSize, std::vector< EOT > *table=0)
 Ctor for Parallel apply (map) data.
void init (std::vector< EOT > &table)
 Reinitializes the data for a new table to evaluate.
std::vector< EOT > & table ()

Public Attributes

std::vector< EOT > * _table
eoUF< EOT &, void > & func
int index
int size
std::map< int,
ParallelApplyAssignment
assignedTasks
int packetSize
std::vector< EOT > tempArray
int masterRank
bmpi::communicator & comm

Detailed Description

template<class EOT>
struct eo::mpi::ParallelApplyData< EOT >

Data useful for a parallel apply (map).

A parallel apply needs at least the functor to apply to every element of the table, and the table itself, whereas it can be set later with the function init(). Master rank is also needed, to send it informations and receive informations from it, inside the functors (the job knows these values, but the functors don't). The size of a packet can be tuned here.

Internal attributes contain:

  • (useful for master) the index of the next element to be evaluated.
  • (useful for master) a map containing links between MPI ranks and slices of the table which the worker with this rank has evaluated. Without this map, when receiving results from a worker, the master couldn't be able to replace the right elements in the table.

Definition at line 84 of file eoParallelApply.h.


Constructor & Destructor Documentation

template<class EOT >
eo::mpi::ParallelApplyData< EOT >::ParallelApplyData ( eoUF< EOT &, void > &  _proc,
int  _masterRank,
int  _packetSize,
std::vector< EOT > *  table = 0 
) [inline]

Ctor for Parallel apply (map) data.

Parameters:
_procThe functor to apply on each element in the table
_masterRankThe MPI rank of the master
_packetSizeThe number of elements on which the function will be applied by the worker, at a time.
tableThe table to apply. If this value is NULL, user will have to call init() before launching the job.

Definition at line 95 of file eoParallelApply.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends