OpendTect-6_4  6.4
volprocchainexec.h
Go to the documentation of this file.
1 #ifndef volprocchainexec_h
2 #define volprocchainexec_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl
9  Date: October 2006
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 
14 -*/
15 
16 #include "volumeprocessingmod.h"
17 #include "volprocchain.h"
18 #include "executor.h"
19 
20 class JobCommunic;
21 
22 namespace VolProc
23 {
24 
27 mExpClass(VolumeProcessing) ChainExecutor : public Executor
29 public:
31  ~ChainExecutor();
32 
39  bool setCalculationScope(const TrcKeySampling&,
40  const StepInterval<float>&,
41  od_uint64& maxmemusage,
42  int* nrchunks=0);
43 
46  mDeprecated int nrChunks(const TrcKeySampling&,
47  const StepInterval<int>&,
48  int extranroutcomps=0);
49  mDeprecated od_int64 computeMaximumMemoryUsage(const TrcKeySampling&,
50  const StepInterval<int>&);
51  //Will be removed after 6.2
52 
53  uiString errMsg() const;
54  uiString uiNrDoneText() const;
55 
56  mDeprecated bool setCalculationScope(const TrcKeySampling&,
57  const StepInterval<int>&);
58  mDeprecated void setOutputZSampling(const StepInterval<float>&);
59 
60  const RegularSeisDataPack* getOutput() const;
61  virtual int nextStep();
62  virtual od_int64 nrDone() const;
63  virtual od_int64 totalNr() const;
64  virtual uiString uiMessage() const;
65  static uiString sGetStepErrMsg();
66 
67  bool areSamplesIndependent() const;
68  bool needsFullVolume() const;
69 
70  void controlWork(Task::Control);
71  void setJobCommunicator(JobCommunic*);
72 
73 private:
74 
75  class Epoch
76  {
77  public:
78  Epoch(const ChainExecutor&);
79  ~Epoch() { delete &taskgroup_; }
80 
81  void addStep(Step* s) { steps_ += s; }
82  const ObjectSet<Step>& getSteps() const { return steps_; }
83  BufferString errMsg() const { return errmsg_; }
84 
85  bool updateInputs();
86  bool doPrepare(ProgressMeter* progmeter=0);
87  void releaseData();
88  Task& getTask() { return taskgroup_; }
89 
90  bool needsStepOutput(Step::ID) const;
91  const RegularSeisDataPack* getOutput() const;
92 
93  private:
94 
99  };
100 
101  bool scheduleWork();
102  void updateScheduledStepsSampling(
103  const TrcKeySampling&,
104  const StepInterval<float>&);
105  int nrChunks(const TrcKeySampling&,
106  const StepInterval<float>&,
107  od_uint64& memusage);
108  od_uint64 calculateMaximumMemoryUsage(
109  const TrcKeySampling&,
110  const StepInterval<float>&);
111 
112  void releaseMemory();
113  int computeLatestEpoch(Step::ID) const;
114  mDeprecated void computeComputationScope(Step::ID stepid,
115  TrcKeySampling& stepoutputhrg,
116  StepInterval<int>& stepoutputzrg ) const;
117  bool getCalculationScope(Step::ID stepid,
118  TrcKeyZSampling&) const;
119  mDeprecated float getSampleShift(float) const;
120  int getStepEpochIndex(Step::ID) const;
121  mDeprecated od_int64 getStepOutputMemory(Step::ID,int nr,
122  const TypeSet<TrcKeySampling>& epochstks,
123  const TypeSet<StepInterval<int> >&) const;
124  void adjustStepsNrComponents(bool is2d);
125  bool needSplit(od_int64 usage,od_int64& freemem,
126  int& nrchunks) const;
127 
129  bool isok_;
131  TrcKeySampling outputhrg_; // deprecated
133  mutable uiString errmsg_;
138 
141 
142  friend class ChainOutput;
143 
144 };
145 
146 } // namespace VolProc
147 
148 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Definition: volprocchainexec.h:75
int totalnrepochs_
Definition: volprocchainexec.h:137
BufferString errMsg() const
Definition: volprocchainexec.h:83
is an interface where processes can report their progress.
Definition: progressmeter.h:21
ObjectSet< Epoch > epochs_
Definition: volprocchainexec.h:135
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
Epoch * curepoch_
Definition: volprocchainexec.h:128
#define od_int64
Definition: plftypes.h:36
SeisDataPack for 2D and 3D seismic data.
Definition: seisdatapack.h:28
Definition: uistring.h:89
Definition: volprocchain.h:58
void addStep(Step *s)
Definition: volprocchainexec.h:81
A collection of tasks, that behave as a single task.
Definition: task.h:82
Set of pointers to objects.
Definition: commontypes.h:32
BufferString errmsg_
Definition: volprocchainexec.h:95
Chain::Web web_
Definition: volprocchainexec.h:136
Chain & chain_
Definition: volprocchainexec.h:130
A chain of Steps that can be applied to a volume of scalars.
Definition: volprocchain.h:29
Horizontal sampling (inline and crossline range and steps).
Definition: trckeysampling.h:27
Adapter for a VolProc chain to external attribute calculation.
Definition: seisdatapackwriter.h:25
Control
Definition: task.h:55
const ObjectSet< Step > & getSteps() const
Definition: volprocchainexec.h:82
Hor+Vert sampling in 3D surveys.
Definition: trckeyzsampling.h:35
int ID
Definition: volprocstep.h:45
~Epoch()
Definition: volprocchainexec.h:79
Manages output creation for a VolProc::Chain.
Definition: volprocchainoutput.h:37
ObjectSet< Step > steps_
Definition: volprocchainexec.h:98
executes the work for a single VolProc::Chain.
Definition: volprocchainexec.h:27
#define od_uint64
Definition: plftypes.h:37
An algorithm/calculation/transformation that takes one scalar volume as input, processes it...
Definition: volprocstep.h:42
bool isok_
Definition: volprocchainexec.h:129
JobCommunic * jobcomm_
Definition: volprocchainexec.h:140
#define mDeprecated
Definition: plfdefs.h:233
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
const RegularSeisDataPack * outputdp_
Definition: volprocchainexec.h:139
BufferString errmsg_
Definition: horizontracker.h:119
StepInterval< int > outputzrg_
Definition: volprocchainexec.h:132
Task & getTask()
Definition: volprocchainexec.h:88
const char * errMsg() const
Definition: horizontracker.h:61
uiString errmsg_
Definition: volprocchainexec.h:133
ObjectSet< Step > scheduledsteps_
Definition: volprocchainexec.h:134
Multi-machine socket communicator Handles the communication between a client and the master...
Definition: jobcommunic.h:51
TrcKeySampling outputhrg_
Definition: volprocchainexec.h:131
Generalization of something (e.g. a computation) that needs to be done in multiple steps...
Definition: task.h:28
const ChainExecutor & chainexec_
Definition: volprocchainexec.h:96
Specification to enable chunkwise execution of a process.
Definition: executor.h:39
TaskGroup & taskgroup_
Definition: volprocchainexec.h:97

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