cape.cfdx.options.runControl
: Primary case control options¶
This module provides a class to access (or set) options pertaining to the basic execution of the code. For example, it specifies how many iterations to run, whether or not to use an MPI version of a solver, and whether or not to submit the job to a PBS queue.
It also contains command-line options that are given to each binary that is
utilized for a a solver, and it also contains archiving options. This entire
section is written to the file case.json
within each run folder.
Environment variables¶
- class cape.cfdx.options.runControl.Environ¶
Class for environment variables
- Call:
>>> opts = Environ(**kw)
- Inputs:
- kw:
dict
Dictionary of environment variables
- kw:
- Outputs:
- opts:
cape.options.runControl.Environ
System environment variable options interface
- opts:
- Versions:
2015-11-10
@ddalle
: First version
- get_Environ(key, i=0)¶
Get an environment variable setting by name of environment variable
- Call:
>>> val = opts.get_Environ(key, i=0)
- Inputs:
- opts:
cape.options.Options
Options interface
- key:
str
Name of the environment variable
- i:
int
orNone
Phase number
- opts:
- Outputs:
- val:
str
Value to set the environment variable to
- val:
- Versions:
2015-11-10
@ddalle
: First version
- set_Environ(key, val, i=None)¶
Set an environment variable setting by name of environment variable
- Call:
>>> val = opts.get_Environ(key, i=0)
- Inputs:
- opts:
cape.options.Options
Options interface
- key:
str
Name of the environment variable
- val:
str
Value to set the environment variable to
- i:
int
orNone
Phase number
- opts:
- Versions:
2015-11-10
@ddalle
: First version
Overall run control and system options¶
- class cape.cfdx.options.runControl.RunControl(fname=None, **kw)¶
Dictionary-based interface for generic code run control
- Call:
>>> opts = RunControl(**kw)
- Inputs:
- kw:
dict
Dictionary of run control options
- kw:
- Outputs:
- opts:
cape.options.runControl.RunControl
Basic control options interface
- opts:
- Versions:
2014-12-01
@ddalle
: First version
- get_Continue(i=None)¶
Determine if restarts of the same run input should be resubmitted
- Call:
>> cont = opts.get_Continue(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Phase number
- opts:
- Outputs:
- cont:
bool
|list
(bool
) Whether or not to continue restarts of same input sequence without resubmitting
- cont:
- Versions:
2015-11-08
@ddalle
: First version
- get_Environ(key, i=0)¶
Get an environment variable setting by name of environment variable
- Call:
>>> val = opts.get_Environ(key, i=0)
- Inputs:
- opts:
cape.options.Options
Options interface
- key:
str
Name of the environment variable
- i:
int
orNone
Phase number
- opts:
- Outputs:
- val:
str
Value to set the environment variable to
- val:
- Versions:
2015-11-10
@ddalle
: First version
- get_MPI(i)¶
Return whether or not to use MPI version
- Call:
>>> MPI = opts.get_mpi(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
Run sequence index
- opts:
- Outputs:
- MPI:
bool
Whether or not to use MPI
- MPI:
- Versions:
2015-10-17
@ddalle
: First version
- get_PhaseIters(i=None)¶
Get the break points for run i. Input i will be repeated until the cumulative iteration count is greater than or equal to PhaseIters[i].
- Call:
>>> PhaseIters = opts.get_PhaseIters(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Phase number
- opts:
- Outputs:
- PhaseIters:
int
orlist`(:class:`int
) Sequence of iteration break points
- PhaseIters:
- Versions:
2014-10-02
@ddalle
: First version
- get_PhaseSequence(i=None)¶
Return the input sequence for flowCart
- Call:
>>> PhaseSeq = opts.get_PhaseSequence(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Phase number
- opts:
- Outputs:
- PhaseSeq:
int
orlist
[int
] Sequence of input run index(es)
- PhaseSeq:
- Versions:
2014-10-02
@ddalle
: First version2015-11-27
@ddalle
: InputSeq -> PhaseSeq
- get_Resubmit(i=None)¶
Determine whether or not a job should restart or resubmit itself
- Call:
>>> resub = opts.get_Resubmit(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Phase number
- opts:
- Outputs:
- resub:
bool
|list
(bool
) Whether or not to resubmit/restart a case
- resub:
- Versions:
2014-10-05
@ddalle
: First version
- get_mpicmd(i=None)¶
Return either
'mpirun'
or'mpiexec
- Call:
>>> mpicmd = opts.get_mpicmd(i=None)
- Inputs:
- opts:
pyCart.options.Options
Options interface
- i:
int
orNone
Phase number
- opts:
- Outputs:
- mpicmd:
str
System command to call MPI
- mpicmd:
- Versions:
2014-10-02
@ddalle
: First version
- get_nIter(i=None)¶
Return the number of iterations for run sequence i
- Call:
>>> nIter = opts.get_nIter(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Run sequence index
- opts:
- Outputs:
- nIter:
int
orlist
[int
] Number of iterations to run
- nIter:
- Versions:
2015-10-20
@ddalle
: First version
- get_nProc(i=None)¶
Return the number of threads to use
- Call:
>>> nProc = opts.get_nProc(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Phase number
- opts:
- Outputs:
- nProc:
int
orlist`(:class:`int
) Number of threads for flowCart
- nProc:
- Versions:
2014-08-02
@ddalle
: First version2014-10-02
@ddalle
: Switched to “nProc”
- get_nSeq()¶
Return the number of input sets in the sequence
- Call:
>>> nSeq = opts.get_nSeq()
- Inputs:
- opts:
cape.options.Options
Options interface
- opts:
- Outputs:
- nSeq:
int
Number of input sets in the sequence
- nSeq:
- Versions:
2014-10-02
@ddalle
: First version2015-02-02
@ddalle
: Added nPhase override
- get_qsub(i=None)¶
Determine whether or not to submit jobs
- Call:
>>> qsub = opts.get_qsub(i=None)
- Inputs:
- opts:
pyCart.options.Options
Options interface
- i:
int
orNone
Phase number
- opts:
- Outputs:
- qsub:
bool
orlist`(:class:`bool
) Whether or not to submit case to PBS
- qsub:
- Versions:
2014-10-05
@ddalle
: First version
- get_ulimit(u, i=0)¶
Get a resource limit (
ulimit
) setting by its command-line flag- Call:
>>> l = opts.get_ulimit(u, i=0)
- Inputs:
- opts:
cape.options.Options
Options interface
- u:
str
Name of the
ulimit
flag- i:
int
orNone
Phase number
- opts:
- Outputs:
- l:
int
Value of the resource limit
- l:
- Versions:
2015-11-10
@ddalle
: First version