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

Outputs:
opts: cape.options.runControl.Environ

System environment variable options interface

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 or None

Phase number

Outputs:
val: str

Value to set the environment variable to

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 or None

Phase number

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

Outputs:
opts: cape.options.runControl.RunControl

Basic control options interface

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 or None

Phase number

Outputs:
cont: bool | list (bool)

Whether or not to continue restarts of same input sequence without resubmitting

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 or None

Phase number

Outputs:
val: str

Value to set the environment variable to

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

Outputs:
MPI: bool

Whether or not to use 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 or None

Phase number

Outputs:
PhaseIters: int or list`(:class:`int)

Sequence of iteration break points

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 or None

Phase number

Outputs:
PhaseSeq: int or list[int]

Sequence of input run index(es)

Versions:
  • 2014-10-02 @ddalle: First version

  • 2015-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 or None

Phase number

Outputs:
resub: bool | list (bool)

Whether or not to resubmit/restart a case

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 or None

Phase number

Outputs:
mpicmd: str

System command to call MPI

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 or None

Run sequence index

Outputs:
nIter: int or list[int]

Number of iterations to run

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 or None

Phase number

Outputs:
nProc: int or list`(:class:`int)

Number of threads for flowCart

Versions:
  • 2014-08-02 @ddalle: First version

  • 2014-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

Outputs:
nSeq: int

Number of input sets in the sequence

Versions:
  • 2014-10-02 @ddalle: First version

  • 2015-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 or None

Phase number

Outputs:
qsub: bool or list`(:class:`bool)

Whether or not to submit case to PBS

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 or None

Phase number

Outputs:
l: int

Value of the resource limit

Versions:
  • 2015-11-10 @ddalle: First version