Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A job script contains the definition of a computing job. It is a good practice to include everything needed for the job to run in the jobscript itself, this includes loading modules, initialization of the environment, and setting variables. Details of Slurm jobscripts are documented in the following locations:

https://slurm.schedmd.com/quickstart.html

https://slurm.schedmd.com/sbatch.html

CPU job script

This is the simple script for submitting basic CPU jobs:

...

The job will be named "job_name", declares a run time of 1 hour, is being run with the "grantname-cpu" account, is submitted to "plgrid" (default for CPU jobs) partition. The job operates in the directory where the batch command was issued, loads a python module, and executes a python application. Job's output will be written to a file named slurm-<JOBID>.out in the current directory. More information and a detailed explanation for each parameter can be found here: https://slurm.schedmd.com/quickstart.html and https://slurm.schedmd.com/sbatch.html

The advanced job could look like the following example:

...

Please note the additional parameters and the MPI-enabled application! This job uses 2 nodes, with 48 tasks on each node, and each task uses 1 CPU. Each node will allocate 184GB of memory for the job. The job's stdout and stderr are redirected to joblog.txt and joberr.txt files. In the example, the myapp.bin application uses MPI. The mpiexec command is responsible for spawning the additional application ranks (processes). In most cases of MPI applications, the mpiexec's parameters are configured automaticallyby the system, so there is no need to specify the -np argument explicitly.

...