Run on a cluster (SLURM)
Goal: process a whole cohort on a SLURM cluster, one job per scan.
-
Install QSMxT in your home directory on the cluster, with the same one-line command as on a laptop (Install). No administrator is needed.
-
Convert and check the data (on a login node or a small interactive job):
Terminal window qsmxt dicom-convert /data/dicoms study/bidsqsmxt validate study/bids -
Write and submit the jobs.
--accountis the SLURM account to charge:Terminal window qsmxt slurm study/bids --account myaccount --submitAny
qsmxt runoption works here too, for example--config pipeline_config.tomlto use settings you tried on one subject first.
In the TUI, set the Execution tab to SLURM, fill in the account, and run.
Check it worked
Section titled “Check it worked”squeue -u $USER shows one job per scan and one aggregation job, which waits until every
scan’s job has finished. When it is done, the output looks the same as a local
qsmxt run: maps under derivatives/qsmxt/sub-*/anat/, methods.md at the top. Each scan’s
log is derivatives/qsmxt/logs/<run>.log; SLURM’s own output is beside the job scripts in
derivatives/qsmxt/slurm/.
If a job fails
Section titled “If a job fails”- Read its log in
derivatives/qsmxt/logs/, and fix the cause. - Submit that scan’s job again:
sbatch derivatives/qsmxt/slurm/qsmxt_<run>.sh. Steps that already finished are not repeated. - Then submit the aggregation job yourself:
sbatch derivatives/qsmxt/slurm/qsmxt_aggregate.sh.
Options you may need
Section titled “Options you may need”--partitionand--time(default 2 hours per job).--mem: memory per job in GB. By default each job asks for an estimate from its scan’s size.- Without
--submit, the scripts are written but not submitted; submit them later withbash derivatives/qsmxt/slurm/submit.sh.
Every option is in Command line.
What the jobs do
Section titled “What the jobs do”qsmxt slurm checks the settings, and every scan against them, before it writes anything, so
a bad setting is reported once rather than by every job. It writes the resolved settings to
derivatives/qsmxt/pipeline_config.toml, and the jobs to derivatives/qsmxt/slurm/:
- One job per scan (
qsmxt_<run>.sh) runsqsmxt run --no-dataset-steps --include <run>: that scan’s pipeline and nothing else. - One aggregation job (
qsmxt_aggregate.sh) starts once every scan’s job has succeeded (--dependency=afterok). It runsqsmxt aggregate, which does what a localqsmxt rundoes after its scans: multi-orientation reconstruction, the dataset’s tables and figures,methods.md, the provenance records, the combinedqsmxt.log, and--clean-intermediatesif you asked for it. It refuses a scan that has not finished under the same settings, and names it.
The result is the dataset a local qsmxt run makes. Each job asks for memory estimated from
its scan’s size; the aggregation job is sized for the largest multi-orientation group. A job
that is requeued or restarted carries on from its last finished step.