MPI job functors have to be created with new, so as to be deleted by delete, because of Composite / Decorator pattern.
This commit is contained in:
parent
008f2571b2
commit
472b86bc68
3 changed files with 12 additions and 45 deletions
|
|
@ -119,6 +119,7 @@ namespace eo
|
|||
template< typename JobData >
|
||||
struct JobStore
|
||||
{
|
||||
// TODO commentaire: ces pointeurs devraient être alloués avec new pour éviter segfault on quit.
|
||||
JobStore(
|
||||
SendTaskFunction<JobData>* stf,
|
||||
HandleResponseFunction<JobData>* hrf,
|
||||
|
|
@ -135,6 +136,16 @@ namespace eo
|
|||
// empty
|
||||
}
|
||||
|
||||
~JobStore()
|
||||
{
|
||||
// TODO commentaire: Composition Pattern => délégation de la destruction => destruction homogène => new
|
||||
// et delete partout.
|
||||
delete _stf;
|
||||
delete _hrf;
|
||||
delete _ptf;
|
||||
delete _iff;
|
||||
}
|
||||
|
||||
SendTaskFunction<JobData> & sendTask() { return *_stf; }
|
||||
HandleResponseFunction<JobData> & handleResponse() { return *_hrf; }
|
||||
ProcessTaskFunction<JobData> & processTask() { return *_ptf; }
|
||||
|
|
@ -377,7 +388,7 @@ namespace eo
|
|||
|
||||
AssignmentAlgorithm& assignmentAlgo;
|
||||
int masterRank;
|
||||
const int workerStopCondition;
|
||||
const int workerStopCondition; // TODO commentaire: message signifiant l'arrêt pour un worker
|
||||
bmpi::communicator& comm;
|
||||
|
||||
SendTaskFunction<JobData> & sendTask;
|
||||
|
|
|
|||
Reference in a new issue