Yellow

505.277.6900
help@carc.unm.edu

Walk-in office hours
with Dr. Ryan Johnson,
Applications Scientist

Wednesdays 10 am to noon

18. Example PBS Scripts

All parallel supercomputers and clusters at the Center for Advanced Research Computing use the Portable Batch System (PBS) for job submission. Below are three example scripts.

PBS Hello World:

## Introductory Example
## Copyright (c) 2014 The Center for Advanced Research Computing
##  at The University of New Mexico
#PBS -lnodes=1:ppn=4
#PBS -lwalltime=1:00
## Specify the shell to be tcsh
#PBS -S /bin/bash
# print out a hello message
# indicating the host this is running on
export THIS_HOST=`hostname`
echo Hello World from host $THIS_HOST

Multi-processor example script:

## Introductory Example
## Copyright (c) 2014
## The Center for Advanced Research Computing
## at The University of New Mexico
#PBS -lnodes=1:ppn=2
#PBS -lwalltime=1:00
## Specify the shell to be tcsh
#PBS -S /bin/bash
# load the environment module to use OpenMPI built with the GNU compilers
module load openmpi/gnu
# print out a hello message from each of the processors on this host
# indicating the host this is running on
export THIS_HOST=`hostname`
mpirun -np 4 -machinefile $PBS_NODEFILE /bin/sh \-c \
  'echo Hello World from process \$MXMPI_ID of \$MXMPI_NP on host $THIS_HOST'
echo Hello World from host `hostname`

Multi-node example script:

## Introductory Example
## Copyright (c) 2014
## The Center for Advanced Research Computing
## at The University of New Mexico
#PBS -lnodes=4:ppn=2
#PBS -lwalltime=1:00
## Specify the shell to be tcsh
#PBS -S /bin/tcsh
# load the environment module to use OpenMPI built with the GNU compilers
module load openmpi/gnu
# print out a hello message from each of the processors on this host
# indicating the host this is running on
mpirun -np 16 -machinefile $PBS_NODEFILE /bin/sh \-c \
       'echo Hello World from process \$MXMPI_ID of \$MXMPI_NP on host `hostname`'

Center for Advanced Research Computing

MSC01 1190
1601 Central Ave. NE
Albuquerque, NM 87106

p: 505.277.8249
f:  505.277.8235
e: