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

Outputs:
opts: cape.options.pbs.Slurm

Slurm options interface

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

Index to select

Outputs:
A: str

Slurm account setting

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

Outputs:
C: str

Slurm constraints text

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

Outputs:
N: int

Slurm number of nodes

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

Index to select

Outputs:
gid: str

Slurm gid setting

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

Index to select

Outputs:
n: int

Slurm number of CPUs per node

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

Outputs:
other_opts: None | dict

Dictionary of additional Slurm options

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

Index to select

Outputs:
p: str

Name of Slurm queue to submit to

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

Index to select

Outputs:
S: str

Slurm shell setting; '/bin/bash' in most cases

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

Index to select

Outputs:
t: str

Maximum wall clock time (e.g. '8:00:00')

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 be 2.

Call:
>>> n = opts.get_nSlurm()
Inputs:
opts: cape.options.Options

Options interface

Outputs:
n: int

Number of unique Slurm scripts

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

Index to select

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

Index to select

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

Index to select

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

Index to select

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

Index to select

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

Index to select

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

Index to select

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

Index to select

Versions:
  • 2018-10-10 @ddalle: First version