Difference between revisions of "Submitting CPU Jobs"

From UFAL AIC
(modified for SLURM - first draft)
(Tag: Replaced)
Line 26: Line 26:
 
=== Output monitoring ===
 
=== Output monitoring ===
 
The standard output of the job is written to the file specified with the option <code>-o</code>. Similarly the errors are logged in the file specified with the option <code>-e</code>.
 
The standard output of the job is written to the file specified with the option <code>-o</code>. Similarly the errors are logged in the file specified with the option <code>-e</code>.
 +
 +
=== Selected submit options ===
 +
 +
The complete list of available options for the commands <code>srun</code> and <code>sbatch</code> can be found in [https://slurm.schedmd.com/man_index.html SLURM documentation].

Revision as of 13:46, 1 December 2022

The CPU jobs should be submitted to cpu partition.

You can submit a non-interactive job using the sbatch command. To submit an interactive job, use the srun command:

srun --pty bash

Resource specification

You should specify the memory and CPU requirements (if higher than the defaults) and don't exceed them. If your job needs more than one CPU (thread) (on a single machine) for most of the time, reserve the given number of CPU threads with the --cpus-per-task and memory with the --mem options.

srun -p cpu --cpus-per-task=4 --mem=8G --pty bash

This will give you an interactive shell with 4 threads and 8G RAM on the cpu partition.

Monitoring and interaction

Job monitoring

We should be able to see what is going on when we run a job. Following examples shows usage of some typical commands:

  • squeue -a - this shows the jobs in all partitions.
  • squeue -u user - print a list of running/waiting jobs of a given user
  • squeue -j<JOB_ID> - this shows detailed info about the job with given JOB_ID (if it is still running).
  • sinfo - print available/total resources

Output monitoring

The standard output of the job is written to the file specified with the option -o. Similarly the errors are logged in the file specified with the option -e.

Selected submit options

The complete list of available options for the commands srun and sbatch can be found in SLURM documentation.