ISG Website header

Documentation

Links

Help

  • CGD/IS Help Line: x2400
  • NCAR/UCAR Help Desk

ISG

CGD/IS Help Files

02.11.03 - Cluster Job Submission

The following qsub script provides a comprehensive template for submitting jobs to the queue manager.

#!/bin/sh
#

### Job name
#
#PBS -N MostExcellentJob

### Declare job non-rerunable
#
#PBS -r n

### Output files - sort to top of directory.
#
#PBS -e AAA_MostExcellentJob.err
#PBS -o AAA_MostExcellentJob.log

# Mail to user
#
#PBS -m ae

### Queue name (short, medium, long, verylong)
#
#PBS -q medium
#
# Number of nodes, number of processors
#
# nodes = physical host
# ppn   = processors per node (i.e., number of cores)
#
#PBS -l nodes=1:ppn=48

#
# This job's working directory
#
echo `date`
echo Working directory is $PBS_O_WORKDIR
cd $PBS_O_WORKDIR

# May be necessary for some OMP jobs.
#
#export KPM_STACKSIZE=50m

echo "Environment:"
echo "--------------"
echo ""

# Print out some job information for debugging.
#
echo Running $PROGNAME on host `hostname`
echo Time is `date`
echo Directory is `pwd`

# Configure the run environment.
#
module load compiler/intel/default

# Convert the host file to use IB
#
/cluster/bin/make_ib_hosts.sh

# Get the number of procs by counting the nodes file,
# which was generated from the #PBS -l line above.
#
NPROCS=`wc -l < $PBS_NODEFILE`

echo "Node File:"
echo "----------"
cat  "$PBS_NODEFILE"
echo ""

# Run the parallel MPI executable 
#
echo "`date` mpiexec - Start"

mpiexec -v -np $NPROCS ./MostExcellentJob

echo ""
echo "`date` MPIRUN - END"                      

exit 0


Then submit the the job using

/usr/local/torque/bin/qsub <script>

For a list of all CGD/IS documentation, see:

    Table of Contents
    Index