Personal tools

Parallel shell script

#!/bin/bash

###specify the queue:
#PBS -q defq
###request 3 nodes with two processors each:
#PBS -l nodes=3:ppn=2

date

### cd to directory where the job was submitted:
cd $PBS_O_WORKDIR
### determine the number of allocated processors:
NPROCS=`wc -l < $PBS_NODEFILE`

echo "----------------"
echo "PBS job running on: `hostname`"
echo "in directory:       `pwd`"
echo "nodes: $NPROCS"
echo "nodefile:"
cat $PBS_NODEFILE
echo "----------------"

### run the program in parallel:
mpirun a.out

date
Document Actions