Exercises: cluster execution
No exercise requires submitting a job. Run commands from snakemake-workshop/work-cluster-b, with .venv-slurm active and the profile prepared in the walkthrough. Mode A in exercise C1 refers to the separate work-cluster-a directory and its batch script.
C1. Count jobs and CPUs
The single allocation contains four CPUs and a 1024 MB local scheduling budget. Every run_app job requests one thread and 256 MB. How many can run simultaneously? When can collect start?
Now consider the Slurm profile with jobs: 4. Does changing it to jobs: 10 make each job use ten CPUs? Explain what changes and what still depends on the cluster.
Success criterion: distinguish per-job requests, a local total budget and a limit on outstanding jobs.
C2. Override one rule's time limit
Suppose collect needs eight minutes on a real workload. Edit a copy of the profile to give this rule a ten-minute limit, leaving run_app at five minutes. Preview all jobs without submitting them:
snakemake --profile profiles/slurm --dry-run --forceall
Success criterion: the dry-run resource listing shows runtime=10 for collect and runtime=5 for run_app.
Hint
The Snakefile already specifies a runtime. A new default will not override it. Extend the existing collect entry in the profile's set-resources mapping, using the exact rule name. Preserve both 1024 MB memory overrides; do not add a second set-resources key.
C3. Diagnose a failure
A submitted job reports a time-limit failure. A colleague suggests increasing jobs from four to twenty and running touch summary.tsv. Explain why neither repairs the cause. What evidence should you inspect, and how would you resume after fixing the relevant setting?
Success criterion: propose a retry that preserves completed work and does not manufacture successful outputs.
Compare with the solutions.