Skip to content

Divvy CLI reference

Divvy is looper's compute configuration tool. It writes job submission scripts that can be submitted to any computing resource (local, SLURM, SGE, etc.).

Divvy is installed automatically with looper.

List available compute packages.

Terminal window
divvy list [--config CONFIG]
OptionDescription
--configPath to divvy configuration file (default: uses $DIVCFG or built-in config)

Example:

Terminal window
$ divvy list
Available compute packages:
local
slurm
sge
apptainer
apptainer_slurm
bulker_local
bulker_slurm
default
docker

Write a job submission script from a template.

Terminal window
divvy write --package PACKAGE [--settings SETTINGS] [--compute KEY=VALUE ...] [--outfile OUTFILE] [--config CONFIG]
OptionDescription
-p, --packageCompute package to use (default: default)
-s, --settingsYAML file with job settings to populate the template
-c, --computeExtra key=value variable pairs (can specify multiple)
-o, --outfileOutput file path for the generated script
--configPath to divvy configuration file

Example:

Terminal window
divvy write --package slurm --settings job_settings.yaml --compute code="python run.py" jobname=myjob --outfile submit.sh

Write a job submission script and submit it.

Terminal window
divvy submit --package PACKAGE [--settings SETTINGS] [--compute KEY=VALUE ...] [--outfile OUTFILE] [--config CONFIG]

Takes the same options as divvy write, but also submits the script using the package's submission command.

Example:

Terminal window
divvy submit --package slurm --settings job_settings.yaml --compute code="python run.py" --outfile submit.sh

Initialize a new divvy configuration file.

Terminal window
divvy init --config CONFIG
OptionDescription
--configPath where the new config file will be created

Example:

Terminal window
divvy init --config ~/.divvy_config.yaml

Display the template for a compute package.

Terminal window
divvy inspect --package PACKAGE [--config CONFIG]
OptionDescription
-p, --packageCompute package to inspect (default: default)
--configPath to divvy configuration file

Example:

$ divvy inspect --package slurm
#!/bin/bash
#SBATCH --job-name='{JOBNAME}'
#SBATCH --output='{LOGFILE}'
#SBATCH --mem='{MEM}'
#SBATCH --cpus-per-task='{CORES}'
#SBATCH --time='{TIME}'
#SBATCH --partition='{PARTITION}'
#SBATCH -m block
#SBATCH --ntasks=1
echo 'Compute node:' `hostname`
echo 'Start time:' `date +'%Y-%m-%d %T'`
{PRE_COMMAND}
{CODE}
{POST_COMMAND}

Variables can come from three sources, in order of increasing priority:

  1. Compute package - Defined in the divvy configuration file
  2. Settings file - YAML file passed with --settings
  3. Command line - Key=value pairs passed with --compute

Higher priority sources override lower priority sources.

The settings file is a simple YAML file with key-value pairs:

time: 4-0-0
logfile: results.log
cores: 6
partition: large_mem
mem: 16G

These variables are commonly used in compute package templates:

VariableDescription
{CODE}The command(s) to execute
{JOBNAME}Name of the job
{LOGFILE}Path to log file
{MEM}Memory to request
{CORES}Number of CPU cores
{TIME}Wall time limit
{PARTITION}Cluster partition/queue
{PRE_COMMAND}Commands to run before the pipeline command (e.g., module loads, TMPDIR setup)
{POST_COMMAND}Commands to run after the pipeline command (e.g., cleanup)
{BULKER_CRATE}Bulker crate identifier for the bulker_slurm and bulker_local packages
{APPTAINER_IMAGE}Apptainer container image path
{APPTAINER_ARGS}Extra arguments passed to apptainer (e.g., bind mounts)
VariableDescription
DIVCFGDefault path to divvy configuration file