EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EGS_JCFControl Class Reference

A 'job control file' (JCF) RCO. More...

#include <egs_run_control.h>

Inheritance diagram for EGS_JCFControl:
EGS_RunControl

Public Member Functions

 EGS_JCFControl (EGS_Application *, int Nbuf=1024)
 
void setNchunkForParallel (int n)
 
int startSimulation ()
 
EGS_I64 getNextChunk ()
 
int finishSimulation ()
 
bool getCombinedResult (double &, double &) const
 
- Public Member Functions inherited from EGS_RunControl
 EGS_RunControl (EGS_Application *app)
 Creates an RCO for the application app. More...
 
virtual ~EGS_RunControl ()
 Destructor.
 
void setNcase (EGS_I64 n)
 Set the number of particles to be simulated to n.
 
void setNbatch (int n)
 Set the number of batches to n.
 
void setMaxTime (EGS_Float t)
 Set the maximum CPU time for the simulation to t.
 
void setRequiredUncertainty (EGS_Float a)
 Set the required statistical uncertainty to a.
 
EGS_I64 getNcase () const
 Returns the total number of particles to be simulated.
 
int getNbatch () const
 Returns the number of batches per simulation chunk.
 
int getNchunk () const
 Returns the number of simulation chunks.
 
virtual bool startBatch (int, EGS_I64)
 Start a new batch. More...
 
virtual bool finishBatch ()
 Finish a batch. More...
 
virtual void describeRCO ()
 
virtual bool storeState (ostream &data)
 
virtual bool setState (istream &data)
 
virtual bool addState (istream &data)
 
virtual void resetCounter ()
 
virtual EGS_I64 getNdone () const
 
virtual void setNdone (EGS_I64 Ndone)
 
virtual void incrementNdone ()
 
virtual EGS_Float getCPUTime () const
 

Protected Member Functions

bool createControlFile ()
 
bool openControlFile ()
 
bool closeControlFile ()
 
bool lockControlFile ()
 
bool unlockControlFile ()
 
bool rewindControlFile ()
 
bool readControlFile ()
 
bool writeControlFile ()
 
virtual bool writeControlString ()
 
virtual bool readControlString ()
 

Protected Attributes

EGS_I64 nleft
 
EGS_I64 ntot
 
double tsum
 
double tsum2
 
double tcount
 
double norm
 
double last_sum
 
double last_sum2
 
double last_count
 
unsigned long start_time
 
int njob
 
int npar
 
int ipar
 
int ifirst
 
bool first_time
 
bool removed_jcf
 
int nbuf
 
char * buf
 
EGS_FileLocking * p
 
- Protected Attributes inherited from EGS_RunControl
EGS_Applicationapp
 
EGS_Inputinput
 
EGS_I64 ncase
 
EGS_I64 ndone
 
EGS_Float maxt
 
EGS_Float accu
 
int nbatch
 
int restart
 
int nchunk
 
RCOType rco_type
 RCO type to use.
 
EGS_Timer timer
 
EGS_Float cpu_time
 
EGS_Float previous_cpu_time
 

Additional Inherited Members

- Public Types inherited from EGS_RunControl
enum  RCOType { simple, uniform, balanced }
 Define RCO types. More...
 
- Static Public Member Functions inherited from EGS_RunControl
static EGS_RunControlgetRunControlObject (EGS_Application *)
 
- Public Attributes inherited from EGS_RunControl
int geomErrorCount
 
int geomErrorMax
 

Detailed Description

A 'job control file' (JCF) RCO.

The JCF RCO is used by default for controlling parallel job execution. It is called a JCF-RCO because execution is controlled by a file placed in the user code directory, which is created by the first parallel job and contains information such as the number of particles remaining to be simulated, number of jobs running, combined result of all parallel jobs, etc. This RCO objects requires that file locking works on the file system containing the EGS_HOME directory because the JCF is locked prior to being modified by one of the jobs to prevent multiply jobs modifying the file at the same time. For more details see PIRS-877.

Definition at line 277 of file egs_run_control.h.


The documentation for this class was generated from the following files: