beautypg.com

4 submitting a batch job or job script, Example 5-11 – HP XC System 3.x Software User Manual

Page 53

background image

Example 5-11 Using the External Scheduler to Submit a Job That Excludes One or More Nodes

$ bsub -n4 -ext "SLURM[nodes=4; exclude=n3]" -I srun hostname

Job <72> is submitted to default queue .

<>

<>

n1

n2

n4

n5

This example runs the job exactly the same as in

Example 5-10 “Using the External Scheduler to Submit

a Job to Run One Task per Node”

, but additionally requests that node n3 is not to be used to run the job.

Note that this command could have been written to exclude additional nodes.

Example 5-12

launches the hostname command once on nodes n1 through n10 (n[1-10]):

Example 5-12 Using the External Scheduler to Launch a Command in Parallel on Ten Nodes

$ bsub -n 10 -ext "SLURM[nodelist=n[1-10]]" srun hostname

Example 5-13

launches the hostname command on 10 cores on nodes with a dualcore SLURM feature

assigned to them:

Example 5-13 Using the External Scheduler to Constrain Launching to Nodes with a Given Feature

$ bsub -n 10 -ext "SLURM[constraint=dualcore]" -I srun hostname

You can use the bqueues command to determine the SLURM scheduler options that apply to jobs submitted
to a specific LSF-HPC queue, for example:

$ bqueues -l dualcore | grep SLURM

MANDATORY_EXTSCHED: SLURM[constraint=dualcore]

5.4 Submitting a Batch Job or Job Script

Use the following bsub command format to submit a batch job or job script:

bsub -n num-procs [bsub-options] script-name

The -n num-procs parameter, which is required for parallel jobs, specifies the number of cores the job
requests.

The script-name argument is the name of the batch job or script. The script can contain one or more
srun

or mpirun commands.

The script will execute once on the first allocated node, and the srun or mpirun commands within the
script will be run on the allocated compute nodes.

In

Example 5-14

, a simple script named myscript.sh, which contains two srun commands, is displayed

then submitted.

5.4 Submitting a Batch Job or Job Script

53