OpendTect-6_4  6.4
Classes | Macros
paralleltask.h File Reference
Include dependency graph for paralleltask.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ParallelTask
 Generalization of a task that can be run in parallel. More...
 

Macros

#define mDeclareParallelCalcStd(uimsg)
 
#define mDefParallelCalcNoPars(clss, uimsg)
 
#define mDefParallelCalc1Par(clss, uimsg, T1, v1)
 
#define mDefParallelCalc2Pars(clss, uimsg, T1, v1, T2, v2)
 
#define mDefParallelCalc3Pars(clss, uimsg, T1, v1, T2, v2, T3, v3)
 
#define mDefParallelCalc4Pars(clss, uimsg, T1, v1, T2, v2, T3, v3, T4, v4)
 
#define mDefParallelCalc5Pars(clss, uimsg, T1, v1, T2, v2, T3, v3, T4, v4, T5, v5)
 
#define mDefParallelCalc6Pars(clss, uimsg, T1, v1, T2, v2, T3, v3, T4, v4, T5, v5, T6, v6)
 
#define mDefParallelCalc7Pars(clss, uimsg, T1, v1, T2, v2, T3, v3, T4, v4, T5, v5, T6, v6, T7, v7)
 
#define mDefParallelCalcBody(preop, impl, postop)
 

Macro Definition Documentation

#define mDeclareParallelCalcStd (   uimsg)
Value:
od_int64 sz_; \
bool reportprogress_; \
void setReport(bool yn) { reportprogress_ = yn; } \
od_int64 nrIterations() const { return sz_; } \
uiString uiMessage() const { return uimsg; } \
uiString uiNrDoneText() const { return sPosFinished(); } \
#define od_int64
Definition: plftypes.h:36

Macros to define a class to exectute your loop in parallel.

The loop index is 'idx'.

Example:

The original loop was:

for ( int isamp=0; isamp<outnrsamples; isamp++ ) trc.set( isamp, storinterp_->get(blockbuf_,isamp), curcomp );

There are 4 parameters (trc, curcomp, blockbuf_ and storinterp_) to pass to the executing object. You also need to pass a uiString giving the uiMessage if the execution is done with a taskrunner, thus:

mDefParallelCalc4Pars( SEGYSampleInterpreter, od_static_tr("SEGYSampleInterpreter","Copying trace information"), SeisTrc&,trc, int,curcomp, unsigned char*,blockbuf, const TraceDataInterpreter*,storinterp) mDefParallelCalcBody( * No initializations *\, trc_.set( idx, storinterp_->get(blockbuf_,idx), curcomp_ ); , * No post-operations *)

SEGYSampleInterpreter interp( trc.size(), trc, curcomp, blockbuf_, storinterp_); interp.execute();

#define mDefParallelCalc1Par (   clss,
  uimsg,
  T1,
  v1 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
T1 v1##_; \
clss( od_int64 _sz_, T1 _##v1##_ ) \
: sz_(_sz_), reportprogress_(true), v1##_(_##v1##_) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mDefParallelCalc2Pars (   clss,
  uimsg,
  T1,
  v1,
  T2,
  v2 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
T1 v1##_; T2 v2##_; \
clss( od_int64 _sz_, T1 _##v1##_, T2 _##v2##_ ) \
: sz_(_sz_), reportprogress_(true) \
, v1##_(_##v1##_), v2##_(_##v2##_) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mDefParallelCalc3Pars (   clss,
  uimsg,
  T1,
  v1,
  T2,
  v2,
  T3,
  v3 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
T1 v1##_; T2 v2##_; T3 v3##_; \
clss( od_int64 _sz_, \
T1 _##v1##_, T2 _##v2##_, T3 _##v3##_ ) \
: sz_(_sz_), reportprogress_(true) \
, v1##_(_##v1##_), v2##_(_##v2##_) , v3##_(_##v3##_) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mDefParallelCalc4Pars (   clss,
  uimsg,
  T1,
  v1,
  T2,
  v2,
  T3,
  v3,
  T4,
  v4 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
T1 v1##_; T2 v2##_; T3 v3##_; T4 v4##_; \
clss( od_int64 _sz_, \
T1 _##v1##_, T2 _##v2##_, T3 _##v3##_, T4 _##v4##_ ) \
: sz_(_sz_), reportprogress_(true) \
, v1##_(_##v1##_), v2##_(_##v2##_) \
, v3##_(_##v3##_), v4##_(_##v4##_) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mDefParallelCalc5Pars (   clss,
  uimsg,
  T1,
  v1,
  T2,
  v2,
  T3,
  v3,
  T4,
  v4,
  T5,
  v5 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
T1 v1##_; T2 v2##_; T3 v3##_; T4 v4##_; T5 v5##_;\
clss( od_int64 _sz_, T1 _##v1##_, T2 _##v2##_, T3 _##v3##_, \
T4 _##v4##_, T5 _##v5##_ ) \
: sz_(_sz_), reportprogress_(true) \
, v1##_(_##v1##_), v2##_(_##v2##_) \
, v3##_(_##v3##_), v4##_(_##v4##_), v5##_(_##v5##_) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mDefParallelCalc6Pars (   clss,
  uimsg,
  T1,
  v1,
  T2,
  v2,
  T3,
  v3,
  T4,
  v4,
  T5,
  v5,
  T6,
  v6 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
T1 v1##_; T2 v2##_; T3 v3##_; T4 v4##_; T5 v5##_; T6 v6##_;\
clss( od_int64 _sz_, T1 _##v1##_, T2 _##v2##_, T3 _##v3##_, \
T4 _##v4##_, T5 _##v5##_, T6 _##v6##_ ) \
: sz_(_sz_), reportprogress_(true) \
, v1##_(_##v1##_), v2##_(_##v2##_) \
, v3##_(_##v3##_), v4##_(_##v4##_) \
, v5##_(_##v5##_), v6##_(_##v6##_) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mDefParallelCalc7Pars (   clss,
  uimsg,
  T1,
  v1,
  T2,
  v2,
  T3,
  v3,
  T4,
  v4,
  T5,
  v5,
  T6,
  v6,
  T7,
  v7 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
T1 v1##_; T2 v2##_; T3 v3##_; T4 v4##_; \
T5 v5##_; T6 v6##_; T7 v7##_; \
clss( od_int64 _sz_, T1 _##v1##_, T2 _##v2##_, T3 _##v3##_, \
T4 _##v4##_, T5 _##v5##_, T6 _##v6##_, T7 _##v7##_ ) \
: sz_(_sz_), reportprogress_(true) \
, v1##_(_##v1##_), v2##_(_##v2##_) \
, v3##_(_##v3##_), v4##_(_##v4##_) \
, v5##_(_##v5##_), v6##_(_##v6##_), v7##_(_##v7##_) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
#define mDefParallelCalcBody (   preop,
  impl,
  postop 
)
Value:
bool doWork( od_int64 start, od_int64 stop, int ) \
{ \
preop; \
for ( od_int64 idx=start; idx<=stop; idx++ ) \
{ impl; if ( reportprogress_ ) quickAddToNrDone(idx); } \
postop; \
return true; \
} \
};
#define od_int64
Definition: plftypes.h:36
#define mDefParallelCalcNoPars (   clss,
  uimsg 
)
Value:
class clss : public ParallelTask \
public: \
mDeclareParallelCalcStd(uimsg); \
clss( od_int64 _sz_ ) : sz_(_sz_), reportprogress_(true) {} \
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
#define od_int64
Definition: plftypes.h:36
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019