Run the example

Get the code and the image, record your local values, submit the example job, check that it worked, and copy your results out.

Can I run this?

New to this guide? Take the five-minute tour first for audience, assumed skills, and a readiness checklist; this page stays focused on running the example.

Confirm these assumptions before you run anything:

Get the code

Clone the repository at this release. The commands on this page start from its root, laptop-to-cluster, unless they say otherwise:

git clone --branch v0.2.0 https://github.com/pnsinha/laptop-to-cluster.git && cd laptop-to-cluster

The code of the example workflow (workflows/baseline-slurm-apptainer) in this release is identical to the tested v0.1.0 revision; only its README changed.

Check the prerequisites

  1. Run command -v sbatch and confirm your center’s account and partition syntax. If either fails, use BSSW-PREQ-SLURM.
  2. Run command -v apptainer and apptainer --version in the compute-node module environment. If either fails, use BSSW-PREQ-APPTAINER.
  3. Create and remove a private test file through the intended container bind. If that fails, use BSSW-PREQ-STORAGE.

Record your local values

Write these down before you submit. The right-hand column says how to find each one. If a command prints nothing, ask your center’s support.

Scroll horizontally to view all table columns.

Value What it is How to find it
Account or project The allocation your jobs are charged to sacctmgr show associations user=$USER format=Account,Partition, or your center’s account page
Partition or queue The group of nodes your job runs on sinfo -s lists them; your center’s guide says which ones you may use
Wall time The longest the job may run The script asks for 10 minutes (#SBATCH --time=00:10:00). scontrol show partition <name> shows the partition’s limit
CPUs and memory What the job asks for on its one node The script asks for 4 CPUs (--cpus-per-task=4) and sets no memory, so your partition’s default applies. Add #SBATCH --mem= if your center requires it
Apptainer module How the compute nodes provide the runtime module spider apptainer, or your center’s software guide
Scratch root (BSSW_SCRATCH_ROOT) A private, job-scoped directory under which the job makes its bssw-<job id> run folder Your center’s storage guide. Set it explicitly; do not rely on the fallback to /tmp
Image and input paths Absolute paths to the image, the input, and the expected results The files you prepare in the next two sections; “Submit the job” shows where they go
Worker and task counts How many workers run, and how many tasks they share The defaults are 2 workers and 4 tasks (WORKER_COUNT, TASK_COUNT). TASK_COUNT must equal the number of tasks in inputs/tasks.json
Readiness timeout How long the gate waits for the coordinator The default is 30 seconds (READINESS_TIMEOUT, 1 to 300)
Tunnel or accelerator request Needed only if you extend the example Your center’s documentation. The example uses neither

Get the container image

From the root of the repository you cloned in Get the code, run:

workflows/baseline-slurm-apptainer/container/acquire.sh

The script builds the image from a digest-pinned base into a temporary file, records the image’s SHA-256 in container/baseline.sif.sha256, and then installs container/baseline.sif. It needs Apptainer and network access to the registry, so run it where your center allows image builds. If your center builds images elsewhere, build container/Apptainer.def there and create container/baseline.sif.sha256 with your SHA-256 tool. If a check in the script fails, it prints a BSSW-PREQ-* or BSSW-INTEGRITY-* ID; look it up in Troubleshooting.

Some centers do not allow an unprivileged apptainer build. On the Apptainer used for the October 2026 test, this script could not build the image without extra privileges, and the test used the earlier build with the same digest. If the build fails with an Apptainer error rather than a BSSW ID, build container/Apptainer.def where you have privileges (or ask your center’s support), copy the .sif file into container/, and create container/baseline.sif.sha256 with your SHA-256 tool.

Check the input

The input has a recorded checksum. Check it from inside the inputs folder, because the checksum file names tasks.json without a directory:

(cd workflows/baseline-slurm-apptainer/inputs && sha256sum -c tasks.json.sha256)

Expect tasks.json: OK. If the checksum does not match, stop: the job would stop at the same point with BSSW-INTEGRITY-INPUT.

Submit the job

Submit once, from the repository root. Slurm runs a copy of the script from its own spool directory, so pass the file locations as absolute paths instead of relying on the defaults:

cd workflows/baseline-slurm-apptainer
WF=$PWD
sbatch --export=ALL,BSSW_SCRATCH_ROOT=<path>,IMAGE_PATH=$WF/container/baseline.sif,INPUT_PATH=$WF/inputs/tasks.json,INPUT_SHA256_FILE=$WF/inputs/tasks.json.sha256,EXPECTED_PATH=$WF/expected/results.json slurm/baseline.sbatch

Replace <path> with your scratch root. Add your own --account= and --partition= options to the same command. Do not exceed the documented worker, task, or timeout bounds, and keep account names, private hosts, and sensitive paths out of logs.

The readiness gate must pass before any worker starts. If it expires, use BSSW-READY-TIMEOUT.

Check that it worked

Two places hold the output:

Accept success only when all of these agree:

A zero exit alone is not success. Module 2 describes the complete result-based check.

Copy your results out

The run folder is job-scoped scratch. Your center may clear it without notice, and the job’s cleanup stops the coordinator and workers but never deletes the folder. Copy out what you want to keep, to storage your center says is durable:

cp -r <path>/bssw-<job id> ~/bssw-results-<job id>

If it still fails

Use Troubleshooting to match the ID or symptom you see. If no entry matches, report a workflow defect with sanitized commands, expected behavior, and observed behavior.

How we know this works

The example workflow has a published test record: what ran, where it ran, and what it checked. Read the full test record.

Sources and scope

Review source roles and citations
  • Project decision: Prerequisite and adaptation sequence for the single-node baseline. Milestone 1 bounded workflow

Project-adopted practices and project decisions are not BSSw Fellowship Program requirements.