cape.pyover.cmdgen
: Create commands for OVERFLOW executables¶
This module creates system commands as lists of strings for executable
binaries or scripts for OVERFLOW. While OVERFLOW has only one main
executable, there are several versions, which are all interpreted by the
primary function of this module, overrun()
.
The basic format of the OVERFLOW command is determined using the value
returned from pyOver.options.runControl.get_overrun_cmd()
(or the
keyword argument cmd to overrun()
). In some cases, the command
will also depend on the OVERFLOW file prefix (usually "run"
), which
is stored in a variable pre, the number of processors (technically
cores) in nProc, and the phase number i (0-based; OVERFLOW uses
1-based phase indexing). Let
j = "%02i" % i
for convenience. Finally, mpicmd is the system’s call to run MPI
executables, which is often "mpiexec"
.
The format of the command that is generated can take any of the following versions based on the input options.
Value for cmd
System command
"overrunmpi"
[
"overrunmpi"
,"-np"
, nProc, pre, j]
"overflowmpi"
[mpicmd,
"-np"
, nProc,"overflowmpi"
]
"overrun"
[
"overrun"
, pre, j]
"overflow"
[
"overflow"
]
Commands are created in the form of a list of strings. This is the
format used in the built-in module subprocess
and also with
cape.bin.calli()
. As a very simple example, the system command
"ls -lh"
becomes the list ["ls", "-lh"]
.
- See also:
cape.cmdgen
cape.cmdrun
- cape.pyover.cmdgen.overrun(opts=None, j=0, **kw)¶
Interface to OVERFLOW binary
- Call:
>>> cmdi = overrun(opts, i=0) >>> cmdi = overrun(**kw)
- Inputs:
- Outputs:
- Versions:
2016-02-02
@ddalle
: v1.02023-06-21
@ddalle
: v1.1; use isolate_subsection()