This is an old revision of the document!
Table of Contents
CLUSTER MANUAL
Running jobs
What's on this page:
- General information
- Job Blueprint
- R example
- Python example
- MATLAB example
1. General information
Below here, there are a few introductory sections for your general information on SLURM workload management system. For more details on SLURM visit the SLURM website or check out the Advanced SLURM documentation in this manual.
SLURM Workload Manager
SLURM is the workload manager and job scheduler.
There are two ways of starting jobs with SLURM; either interactively with srun
or as a script with sbatch
.
Interactive jobs are a good way to test your setup before you put it into a script or to work with interactive applications like MATLAB or Python. You immediately see the results and can check if all parts behave as you expected. See the Interactive Jobs for more details.
Please note: at our site if you submit SLURM task arrays it is very important to throttle the number of tasks/CPUs dispatched or you will take all the available resources.
SLURM Parameters
SLURM supports a multitude of different parameters. This enables you to effectively tailor your script to your need when using Psychp01 but also means that is easy to get lost and waste your time and quota.
Note: everything that is preceded by #
followed by a space will be taken as a comment. On the contrary, #SBATCH
followed by dash or double dash will define the parameters for the job.
The following parameters can be used as command line parameters with sbatch
and srun
or in jobscript
, see script examples below. To use it in a jobscript
, start a newline with #SBATCH
followed by the parameter. For example, if you want to give a name to your job script, use the argument –job-name=
, for example:
#SBATCH --job-name=my_test_job_name
NOTE: Do not use spaces in the job name. Something like that: #SBATCH –job-name=my test job
name would not work!
See the Advanced SLURM section for list of commands and examples on how to use them in batch scripts.
Differences between CPUs and tasks
As a new user writing your first SLURM job script the difference between –ntasks and –cpus-per-task is typically quite confusing. Assuming you want to run your program on a single node with 16 cores which SLURM parameters should you specify?
The answer is it depends whether your application supports MPI. MPI (message passing protocol) is a communication interface used for developing parallel computing programs on distributed memory systems. This is necessary for applications running on multiple computers (nodes) to be able to share (intermediate) results.
To decide which set of parameters you should use, check if your application utilizes MPI and therefore would benefit from running on multiple nodes simultaneously. On the other hand, if you have an non-MPI enables application or made a mistake in your setup, it doesn’t make sense to request more than one node. Currently, psychp01 has only a single node, hence when running your analyses, you would need to carefully choose only how many CPUs your analysis (task) requires by using –cpus-per-task.
Discussion