snek5000.make#

Snakemake interface#

Functions

snek_make()

Used for the command snek-make

snek_make_nek()

Used for the command snek-make-nek

unlock(path_dir)

Unlock a directory locked using Snakemake.

Classes

Make([sim, path_run, snakefile])

Snakemake interface for the solvers.

snek5000.make.unlock(path_dir)[source]#

Unlock a directory locked using Snakemake.

class snek5000.make.Make(sim=None, path_run=None, snakefile=None)[source]#

Snakemake interface for the solvers.

Parameters

sim – A simulation instance

list(**kwargs)[source]#

List rules.

Equivalent to:

snakemake --list-target-rules
exec(*rules, set_resources=None, dryrun=False, keep_incomplete=True, nproc=None, **kwargs)[source]#

Execute snakemake rules in sequence.

Parameters
  • rules (iterable of str, positional-only) – Snakemake rules to be executed. Default rule is “run”

  • set_resources (dict[str, int]) – Resources to override (see example below).

  • dryrun (bool) – Dry run snakemake rules without executing

  • keep_incomplete (bool) – Keep incomplete output files of failed jobs

  • nproc (Optional[int]) – Number of MPI processes

Notes

For more on available keyword arguments refer to Snakemake API documentation.

Returns

True if workflow execution was successful.

Return type

bool

Examples

>>> sim.make.exec('mesh', 'SESSION.NAME')
>>> sim.make.exec('compile')
>>> sim.make.exec('run', set_resources={'nproc': 4})
>>> sim.make.exec('run_fg', nproc=2)

It is also possible to do the same directly from command line by changing to the simulation directory and executing:

snek-make -h
snek-make compile
snakemake -j1 compile
snakemake -j1 --set-resources='run:nproc=4' run

The flag -j is short for --jobs and sets the number of threads available for snakemake rules to execute.

The list of the available target rules can be obtained with:

>>> sim.make.list()

or from command line with:

snek-make -l
snakemake --list-target-rules

See also

Useful Snakemake command line arguments

snek5000.make.snek_make()[source]#

Used for the command snek-make

snek5000.make.snek_make_nek()[source]#

Used for the command snek-make-nek