Example
$ bsub -n4 -I ./myscript.sh
Job <81> is submitted to default queue <normal>. <<Waiting for dispatch ...>>
<<Starting on lsfhost.localdomain>> n1
n1
n1
n1
n2
n2
n2
n2
Hello world! I'm 0 of 8 on n1 Hello world! I'm 1 of 8 on n1 Hello world! I'm 2 of 8 on n1 Hello world! I'm 3 of 8 on n1 Hello world! I'm 4 of 8 on n2 Hello world! I'm 5 of 8 on n2 Hello world! I'm 6 of 8 on n2 Hello world! I'm 7 of 8 on n2
Example
Example
$ cat ./envscript.sh #!/bin/sh name=`hostname`
echo "hostname = $name"
echo "LSB_HOSTS = '$LSB_HOSTS'"
echo "LSB_MCPU_HOSTS = '$LSB_MCPU_HOSTS'" echo "SLURM_JOBID = $SLURM_JOBID"
echo "SLURM_NPROCS = $SLURM_NPROCS" $ bsub
Job <82> is submitted to default queue <normal>. <<Waiting for dispatch ...>>
<<Starting on lsfhost.localdomain>> hostname = n1
LSB_HOSTS = 'n1 n1 n2 n2' LSB_MCPU_HOSTS = 'n1 2 n2 2' SLURM_JOBID = 176 SLURM_NPROCS = 4
Running Preexecution Programs
A preexecution program is a program that performs needed setup tasks that an application needs. It may create directories, input files, and so on.
Though
Where preexecution commands run depends on the type of job:
•For interactive jobs, preexecution commands run on the node where the sbatchd daemon runs, typically, the resource manager node.
•For normal batch jobs, preexecution commands run on the first node of the SLURM allocation.
Before starting a preexecution program,
Running Preexecution Programs 51