ParRunControl Class Reference

Helper class for initializing parallel jobs from the command arguments, storing 'dry-run' state etc. Also handles cleanup of parallel (or serial) jobs. More...

Public Member Functions

 ParRunControl ()
 Default construct. More...
 
 ~ParRunControl ()
 Destructor. Shutdown (finalize) MPI as required. More...
 
void runPar (int &argc, char **&argv, bool needsThread)
 Initialize Pstream for a parallel run. More...
 
bool parRun () const noexcept
 True if this is a parallel run. More...
 
bool distributed () const noexcept
 True if this is a parallel run and uses distributed roots. More...
 
void distributed (bool on) noexcept
 Set use of distributed roots, but only if actually parallel. More...
 
int dryRun () const noexcept
 Non-zero if set as 'dry-run'. More...
 
int dryRun (const int level) noexcept
 Change 'dry-run', return old value. More...
 
int verbose () const noexcept
 Non-zero if set as 'verbose'. More...
 
int verbose (const int level) noexcept
 Change 'verbose', return old value. More...
 

Detailed Description

Helper class for initializing parallel jobs from the command arguments, storing 'dry-run' state etc. Also handles cleanup of parallel (or serial) jobs.

Note
In the meantime the class name may be slightly misleading.

Definition at line 54 of file parRun.H.

Constructor & Destructor Documentation

◆ ParRunControl()

ParRunControl ( )
inline

Default construct.

Definition at line 64 of file parRun.H.

◆ ~ParRunControl()

~ParRunControl ( )
inline

Destructor. Shutdown (finalize) MPI as required.

Definition at line 73 of file parRun.H.

References Foam::endl(), Foam::Info, and UPstream::shutdown().

Here is the call graph for this function:

Member Function Documentation

◆ runPar()

void runPar ( int &  argc,
char **&  argv,
bool  needsThread 
)
inline

Initialize Pstream for a parallel run.

Definition at line 86 of file parRun.H.

References Foam::endl(), UPstream::exit(), Foam::Info, and UPstream::init().

Here is the call graph for this function:

◆ parRun()

bool parRun ( ) const
inlinenoexcept

True if this is a parallel run.

Definition at line 98 of file parRun.H.

◆ distributed() [1/2]

bool distributed ( ) const
inlinenoexcept

True if this is a parallel run and uses distributed roots.

Definition at line 104 of file parRun.H.

◆ distributed() [2/2]

void distributed ( bool  on)
inlinenoexcept

Set use of distributed roots, but only if actually parallel.

Definition at line 110 of file parRun.H.

◆ dryRun() [1/2]

int dryRun ( ) const
inlinenoexcept

Non-zero if set as 'dry-run'.

Definition at line 119 of file parRun.H.

◆ dryRun() [2/2]

int dryRun ( const int  level)
inlinenoexcept

Change 'dry-run', return old value.

Definition at line 125 of file parRun.H.

◆ verbose() [1/2]

int verbose ( ) const
inlinenoexcept

Non-zero if set as 'verbose'.

Definition at line 133 of file parRun.H.

◆ verbose() [2/2]

int verbose ( const int  level)
inlinenoexcept

Change 'verbose', return old value.

Definition at line 139 of file parRun.H.


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