7.4.6.1 Examples

Consider an HP XC system configuration in which lsfhost.localdomain is the LSF execution host and nodes n[1-10]are compute nodes in the lsf partition. All nodes contain 2 processors, providing 20 processors for use by LSF jobs.

Example 7-8displays, then runs, a simple batch script.

Example 7-8: Submitting a Batch Job Script

$ cat ./myscript.sh #!/bin/sh

srun hostname mpirun -srun hellompi

$ bsub -n4 -I ./myscript.sh

Job <78> is submitted to

default queue <normal>.

<<Waiting for

dispatch

...>>

 

<<Starting on

lsfhost.localdomain>>

n1

 

 

 

 

 

n1

 

 

 

 

 

n2

 

 

 

 

 

n2

 

 

 

 

 

Hello world!

I’m 0

of

4

on

n1

Hello world!

I’m 1

of

4

on

n1

Hello world!

I’m 2

of

4

on

n2

Hello world!

I’m 3

of

4

on

n2

 

 

 

 

 

 

Example 7-9runs the same script on different resources.

Example 7-9: Submitting a Batch Script with a Specific Topologic Request

$ bsub -n4 -ext "SLURM[nodes=4]" -I ./myscript.sh

Job <79> is submitted to

default queue <normal>.

<<Waiting for

dispatch

...>>

 

<<Starting on

lsfhost.localdomain>>

n1

 

 

 

 

 

n2

 

 

 

 

 

n3

 

 

 

 

 

n4

 

 

 

 

 

Hello world!

I’m 0

of

4

on

n1

Hello world!

I’m 1

of

4

on

n2

Hello world!

I’m 2

of

4

on

n3

Hello world!

I’m 3

of

4

on

n4

 

 

 

 

 

 

Example 7-10and Example 7-11show how the jobs inside the script can be manipulated within the allocation.

Example 7-10: Submitting a Batch Job Script that uses a Subset of the Allocation

$ bsub -n4 -ext "SLURM[nodes=4]" -I ./myscript.sh "-n 2" Job <80> is submitted to default queue <normal>. <<Waiting for dispatch ...>>

<<Starting on lsfhost.localdomain>> n1

n2

Hello world! I’m 0 of 2 on n1 Hello world! I’m 1 of 2 on n2

Using LSF 7-15