38 #ifndef EGS_RUN_CONTROL_
39 #define EGS_RUN_CONTROL_
155 virtual int startSimulation();
167 return getNcase() - ndone;
180 virtual int finishSimulation();
188 virtual bool startBatch(
int,EGS_I64);
196 virtual bool finishBatch();
198 virtual void describeRCO();
199 virtual bool storeState(ostream &data);
200 virtual bool setState(istream &data);
201 virtual bool addState(istream &data);
202 virtual void resetCounter();
203 virtual bool getCombinedResult(
double &,
double &)
const {
207 virtual EGS_I64 getNdone()
const {
211 virtual void setNdone(EGS_I64 Ndone) {
215 virtual void incrementNdone() {
219 virtual EGS_Float getCPUTime()
const {
220 return cpu_time+previous_cpu_time;
232 int geomErrorCount, geomErrorMax;
254 EGS_Float previous_cpu_time;
258 class EGS_FileLocking;
283 void setNchunkForParallel(
int n) {
288 int startSimulation();
289 EGS_I64 getNextChunk();
290 int finishSimulation();
291 bool getCombinedResult(
double &,
double &)
const;
296 double tsum, tsum2, tcount, norm;
297 double last_sum, last_sum2, last_count;
298 unsigned long start_time;
310 bool createControlFile();
311 bool openControlFile();
312 bool closeControlFile();
313 bool lockControlFile();
314 bool unlockControlFile();
315 bool rewindControlFile();
316 bool readControlFile();
317 bool writeControlFile();
318 virtual bool writeControlString();
319 virtual bool readControlString();
374 int startSimulation();
384 int finishSimulation();
#define EGS_EXPORT
Export symbols from the egspp library.
virtual EGS_I64 getNextChunk()
Returns the number of histories to run in the next simulation chunk.
int getNchunk() const
Returns the number of simulation chunks.
A simple run control object for advanced EGSnrc C++ applications.
EGS_I64 getNcase() const
Returns the total number of particles to be simulated.
void setMaxTime(EGS_Float t)
Set the maximum CPU time for the simulation to t.
RCOType rco_type
RCO type to use.
int getNbatch() const
Returns the number of batches per simulation chunk.
parallel jobs with same numbe of histories
A simple class for measuring CPU time.
single job or multiple independent jobs
void setNbatch(int n)
Set the number of batches to n.
void setNcase(EGS_I64 n)
Set the number of particles to be simulated to n.
Defines the EGS_EXPORT and EGS_LOCAL macros.
A 'job control file' (JCF) RCO.
EGS_Timer class header file.
Base class for advanced EGSnrc C++ applications.
void setRequiredUncertainty(EGS_Float a)
Set the required statistical uncertainty to a.