Download User Manual - Support
Transcript
7.1 Components Of A Job Script
41
consulted.
7.1.3 The Executable Line
In the job script structure (section 7.1.1), the executable line is launched with the job launcher command
after the directives lines have been dealt with, and after any other shell commands have been carried
out to set up the execution environment.
Using mpirun In The Executable Line
The mpirun command is used for executables compiled with MPI libraries. Executables that have not
been compiled with MPI libraries, or which are launched without any specified number of nodes, run
on a single free node chosen by the workload manager.
The executable line to run a program myprog that has been compiled with MPI libraries is run by
placing the job-launcher command mpirun before it as follows:
mpirun myprog
Using cm-launcher With mpirun In The Executable Line
For Torque, for some MPI implementations, jobs sometimes leave processes behind after they have
ended. A default Bright Cluster Manager installation provides a cleanup utility that removes such processes. To use it, the user simply runs the executable line using the cm-launcher wrapper before the
mpirun job-launcher command:
cm-launcher mpirun myprog
The wrapper tracks processes that the workload manager launches. When it sees processes that the
workload manager is unable to clean up after the job is over, it carries out the cleanup instead. Using
cm-launcher is recommended if jobs that do not get cleaned up correctly are an issue for the user or
administrator.
7.1.4
Example Batch Submission Scripts
Node Availability
The following job script tests which out of 4 nodes requested with “-l nodes” are made available to
the job in the workload manager:
Example
#!/bin/bash
#PBS -l walltime=1:00
#PBS -l nodes=4
echo -n "I am on: "
hostname;
echo finding ssh-accessible nodes:
for node in $(cat ${PBS_NODEFILE}) ; do
echo -n "running on: "
/usr/bin/ssh $node hostname
done
The directive specifying walltime means the script runs at most for 1 minute. The ${PBS_NODEFILE}
array used by the script is created and appended with hosts by the queueing system. The script illustrates how the workload manager generates a ${PBS_NODEFILE} array based on the requested number
of nodes, and which can be used in a job script to spawn child processes. When the script is submitted,
the output from the log will look like:
© Bright Computing, Inc.