SLURM MC Fitting - ATTPC/ATTPCROOTv2 GitHub Wiki
Parallel MC fitting
Submitting jobs
sbatch submissionScript.sh
will submit a job to the SLURM job manager. The number of threads, memory, and time required by the job (along with other paramaters) can be specified in comments at the start of the submission script. By default, the SLURM environment will inherit the current bash environment when sbatch is called. So, if you can run your ROOT macro in the current terminal, then the macros called in the slurm job should also run.
An example header for a SLURM submission script with some default parameters set would be
#!/bin/bash
#SBATCH --job-name=sim_fission_fit
#SBATCH --output=log/run_%j/log.out
#SBATCH --error=log/run_%j/log.out
#SBATCH --partition=cs
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem-per-cpu=1G
#SBATCH --time=UNLIMITED
The default values can be overwritten by passing command line arguments to the sbatch
command. Let's say we wanted to run the same fitting using different numbers of threads to do a scalability study. Then you could run something like the following set of commands:
sbatch --cpus-per-task=1 submissionScript.sh
sbatch --cpus-per-task=2 submissionScript.sh
sbatch --cpus-per-task=4 submissionScript.sh
sbatch --cpus-per-task=8 submissionScript.sh
sbatch --cpus-per-task=16 submissionScript.sh
Monitoring jobs
You can monitor the status of the jobs you have submitted using the squeue
command. If you want more details you can use the command scontrol show job job_id
where job_id
is the numerical job ID assigned by SLURM when the job is submitted.
Canceling jobs
You can cancel jobs using the command scancel job_id