Personal tools

Serial shell script

#!/bin/bash

###specify the queue:
#PBS -q defq
###request 1 node with one processor:
#PBS -l nodes=1:ppn=1

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:
./a.out

date
Document Actions