snek5000.make#
Snakemake interface#
Functions
Used for the command snek-make |
|
Used for the command snek-make-nek |
|
|
Unlock a directory locked using Snakemake. |
Classes
|
Snakemake interface for the solvers. |
- class snek5000.make.Make(sim=None, path_run=None, snakefile=None)[source]#
Snakemake interface for the solvers.
- Parameters
sim – A simulation instance
- 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
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