Using Slurm =========== .. _slurm: Slurm is a free and open-source job scheduler for Linux and Unix-like kernels, used by many of the world's supercomputers and computer clusters. Slurm is used @ CINECA, CERN, RIKEN, LIVERMORE, OAK RIDGE, etc. Installed Slurm version: 19.05.2 (Aug 13, 2019) Slurm Partitions ---------------- .. _slurmpartitions: A Slurm partition is a group of resources. Each partition can be considered as a job queue, each of which has some constraint (e.g. number of running jobs, job time limit, etc.). CAPRI has 2 partitions: * **allgroups**: partition to run both serial and parallel software. This partition **should not** be used to run interactive software; * **interactive**: partition to run software in an interactive way. This partition has limited resources (default: 1 cores, 1GB RAM). Interactive sessions should be shorter than 24 hours. Which partition should I use? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The great majority of CAPRI users should use the allgroups partition. Typical serial and parallel software that require no interaction with the user should be run in this partition. The interactive partition should be used only when a real time interaction is needed and/or for tasks having low computation burden. Typical examples are the installation of software having an interactive installation procedure, simple file managing/manipulation (e.g. compressing files), etc. Slurm Jobs ---------- .. _slurmjobs: To run a software on CAPRI, the user the user must prepare a so-called (Slurm) *job file*. A job file is a text file containing some Slurm instructions/options and the call to user software. The typical job file is something like this: :: #!/bin/bash #SBATCH --ntasks 4 #SBATCH --partition allgroups #SBATCH --time 02:00 #SBATCH --mem 1G cd $SLURM_SUBMIT_DIR srun Dissection of the job file ^^^^^^^^^^^^^^^^^^^^^^^^^^ .. _jobdissection: ``#!/bin/bash`` This is simply the interpreter of subsequent commands (bash in this case). ``#SBATCH ...`` Following the ``#SBATCH`` directive are special options geared at the SLURM scheduler. We will see some of them in detail below. ``cd $SLURM_SUBMIT_DIR`` This is a useful command to ask the scheduler to change the current directory before launching the program. This way all the paths can be considered as relative to the directory the job file resides in. ``srun `` This is where you ask the scheduler to run your program for you. Slurm mandatory options ^^^^^^^^^^^^^^^^^^^^^^^ .. _mandatoryopts: Slurm (actually *srun*) recognizes a large number of options to suit your needs. Some options can be specified using either the short (prefixed with just one dash and a letter) or the long (two dashes) form. There are four **mandatory** options you must specify on your job to successfully run on the CAPRI platform. These are: -n, -\\-ntasks Number of tasks to launch. For serial code should be set to 1, for parallel code should be set to the number of parallel execution flows. -p, -\\-partition Slurm partition. For typical serial or parallel job is *allgroups* -t, -\\-time