The srun command handles both serial and parallel jobs.

The srun command has a significant number of options to control the execution of your application closely. However, you can use it for a simple launch of a serial program, as Example 9-1shows.

Example 9-1 Simple Launch of a Serial Program

$ srun hostname n1

9.3.1 The srun Roles and Modes

The srun command submits jobs to run under SLURM management. The srun command can perform many roles in launching and managing your job. The srun command operates in several distinct usage modes to accommodate the roles it performs.

9.3.1.1 The srun Roles

The options of the srun command allow you control a SLURM job by:

Specifying the parallel environment for your job when you submit it, such as the number of nodes to use, partition, distribution of processes among nodes, and maximum time.

Controlling the behavior of your parallel job as it runs, such as by redirecting or labeling its output, sending it signals, or specifying its reporting verbosity.

9.3.1.2The srun Modes

The srun command has five distinct modes in which it can be used:

Simple mode

Batch mode

Allocate mode

Attach mode

Batch (with LSF) mode

The SLURM Reference Manual describes the Simple, Batch, Allocate, and Attach modes.

You can submit a script to LSF that contains (simple) srun commands to execute parallel jobs later. In this case, LSF takes the place of the srun -boption for indirect, across-machine job-queue management.

9.3.2 Using the srun Command with HP-MPI

The srun command can be used as an option in an HP-MPI launch command. See Chapter Chapter 5: Submitting Jobs for information about using srun with HP-MPI.

9.3.3 Using the srun Command with LSF

The srun command can be used in an LSF launch command. See Chapter Chapter 10: Using LSF for information about using srun with LSF.

9.4 Monitoring Jobs with the squeue Command

The squeue command displays the queue of running and waiting jobs (or "job steps"), including the JobID used for scancel), and the nodes assigned to each running job. It has a wide variety of filtering, sorting, and formatting options. By default, it reports the running jobs in priority order and then the pending jobs in priority order.

Example 9-2reports on job 12345 and job 12346:

82 Using SLURM

Page 82
Image 82
HP XC System 4.x Software Monitoring Jobs with the squeue Command, Srun Roles and Modes, Using the srun Command with LSF