cape.cfdx.options.slurm
: SLURM script options¶
This portion of the options is universal, and so it is only encoded in the
cape
module. The cape.pycart
module, for example, does not have a
modified version. It contains options for specifying which architecture to use,
how many nodes to request, etc.
- class cape.cfdx.options.slurm.Slurm¶
Dictionary-based options for Slurm jobs submitted via
sbatch
- Call:
>>> opts = Slurm(**kw)
- Inputs:
- kw:
dict
Dictionary of Slurm options
- kw:
- Outputs:
- opts:
cape.options.pbs.Slurm
Slurm options interface
- opts:
- Versions:
2014-12-01
@ddalle
: First version
- get_Slurm_A(i=None)¶
Return the Slurm A (account) setting
- Call:
>>> A = opts.get_Slurm_A(i)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Index to select
- opts:
- Outputs:
- A:
str
Slurm account setting
- A:
- Versions:
2018-10-10
@ddalle
: First version
- get_Slurm_C(i=None)¶
Return the “constraints” option for Slurm
- Call:
>>> n = opts.get_Slurm_C(i)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
|None
Index to select
- opts:
- Outputs:
- C:
str
Slurm constraints text
- C:
- Versions:
2022-12-02
@ddalle
: First version
- get_Slurm_N(i=None)¶
Return the number of nodes
- Call:
>>> n = opts.get_Slurm_N(i)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
|None
Index to select
- opts:
- Outputs:
- N:
int
Slurm number of nodes
- N:
- Versions:
2018-10-10
@ddalle
: First version
- get_Slurm_gid(i=None)¶
Return Slurm gid setting, usually for setting groups
- Call:
>>> gid = opts.get_Slurm_gid(i)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Index to select
- opts:
- Outputs:
- gid:
str
Slurm gid setting
- gid:
- Versions:
2018-10-10
@ddalle
: First version
- get_Slurm_n(i=None)¶
Return the number of CPUs per node
- Call:
>>> n = opts.get_Slurm_n(i)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Index to select
- opts:
- Outputs:
- n:
int
Slurm number of CPUs per node
- n:
- Versions:
2018-10-10
@ddalle
: First version
- get_Slurm_other(i=None)¶
Get other generic Slurm options dict
- Call:
>>> other_opts = opts.get_Slurm_other(i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- i: {
None
} |int
Phase number
- opts:
- Outputs:
- other_opts:
None
|dict
Dictionary of additional Slurm options
- other_opts:
- Versions:
2023-04-18
@ddalle
: v1.0
- get_Slurm_p(i=None)¶
Return Slurm queue
- Call:
>>> p = opts.get_Slurm_p()
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Index to select
- opts:
- Outputs:
- p:
str
Name of Slurm queue to submit to
- p:
- Versions:
2018-10-10
@ddalle
: First version
- get_Slurm_shell(i=None)¶
Return the Slurm S setting, which determines the shell
- Call:
>>> r = opts.get_Slurm_shell(i)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Index to select
- opts:
- Outputs:
- S:
str
Slurm shell setting;
'/bin/bash'
in most cases
- S:
- Versions:
2018-10-10
@ddalle
: First version
- get_Slurm_time(i=None)¶
Return maximum wall time
- Call:
>>> t = opts.get_Slurm_time(i)
- Inputs:
- opts:
cape.options.Options
Options interface
- i:
int
orNone
Index to select
- opts:
- Outputs:
- t:
str
Maximum wall clock time (e.g.
'8:00:00'
)
- t:
- Versions:
2018-10-10
@ddalle
: First version
- get_nSlurm()¶
Return the maximum number of unique Slurm inputs
For example, if a case is set up to be run in two parts, and the first phase needs only one node (select=1) while the second phase needs 10 nodes (select=10), then the input file should have
"select": [1, 10]
, and the output of this function will be2
.- Call:
>>> n = opts.get_nSlurm()
- Inputs:
- opts:
cape.options.Options
Options interface
- opts:
- Outputs:
- n:
int
Number of unique Slurm scripts
- n:
- Versions:
2014-12-01
@ddalle
: First version
- set_Slurm_A(A='', i=None)¶
Set the Slurm A (account) setting
- Call:
>>> opts.set_Slurm_A(A, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- A:
str
Slurm account setting
- i:
int
orNone
Index to select
- opts:
- Versions:
2018-10-10
@ddalle
: First version
- set_Slurm_C(C='', i=None)¶
Set “constraints” option for Slurm
- Call:
>>> opts.set_Slurm_C(C, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- C:
str
Slurm constraints text
- i:
int
orNone
Index to select
- opts:
- Versions:
2022-12-02
@ddalle
: First version
- set_Slurm_N(N=1, i=None)¶
Set Slurm number of nodes
- Call:
>>> opts.set_Slurm_N(N, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- N:
int
Slurm number of nodes
- i:
int
orNone
Index to select
- opts:
- Versions:
2018-10-10
@ddalle
: First version
- set_Slurm_gid(gid='', i=None)¶
Set Slurm W setting, usually for setting groups
- Call:
>>> opts.set_Slurm_gid(gid, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- gid:
str
Slurm gid setting
- i:
int
orNone
Index to select
- opts:
- Versions:
2018-10-10
@ddalle
: First version
- set_Slurm_n(n=20, i=None)¶
Set Slurm number of CPUs per node
- Call:
>>> opts.set_Slurm_n(n, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- n:
int
Slurm number of CPUs per node
- i:
int
orNone
Index to select
- opts:
- Versions:
2018-10-10
@ddalle
: First version
- set_Slurm_p(p='normal', i=None)¶
Set Slurm queue
- Call:
>>> opts.set_Slurm_p(p, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- p:
str
Name of Slurm queue to submit to
- i:
int
orNone
Index to select
- opts:
- Versions:
2018-10-10
@ddalle
: First version
- set_Slurm_shell(S='/bin/bash', i=None)¶
Set the Slurm S setting, which determines the shell
- Call:
>>> opts.set_Slurm_shell(S, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- S:
str
Slurm shell setting;
'/bin/bash'
in most cases- i:
int
orNone
Index to select
- opts:
- Versions:
2018-10-10
@ddalle
: First version
- set_Slurm_time(t='8:00:00', i=None)¶
Set the maximum wall time
- Call:
>>> opts.set_Slurm_time(t, i=None)
- Inputs:
- opts:
cape.options.Options
Options interface
- t:
str
Maximum wall clock time (e.g.
'8:00:00'
)- i:
int
orNone
Index to select
- opts:
- Versions:
2018-10-10
@ddalle
: First version