Understanding PBS Professional Script for Submitting Paralleling Calculation

Portable Batch System

Portable Batch System (PBS) is the name of computer software that performs job scheduling. Its primary task is to allocate computational tasks, i.e., batch jobs, among the available computing resources. PBS is often used in conjunction with Linux system. PBS Professionally (PBS Pro) is one of the powerful version, which optimize utilization and simplify administration for High-Performance Supercomputer or Computer Cluster. The PBS Pro can be download with free of charge from http://pbspro.org/. PBS script is the bash shell script, which contains the environment variable setting for calculation.

Terminology:

# select = number of physical compute node

# ncpus = number of CPUs allocated for each node

# mpiprocs = number of MPI process(es) per node

# ompthreads = number of thread(s) per MPI process

# $PBS_O_WORKDIR = working directory, where PBS script is

# $PBS_NODEFILE = list of compute node which will be requested for calculation

Note that the total number of CPUs cores that you requests is select*ncpus.

OpenMP

Example: select=1:ncpus=20:ompthreads=20

Requests 20 CPU cores and 20 threads

#!/bin/bash
#PBS -l select=1:ncpus=20:ompthreads=20
#PBS -l walltime=96:00:00
#PBS -q test
#PBS -N CAL_A

cd $PBS_O_WORKDIR

program.exe -genv OMP_NUM_THREADS=20  input.file > output.file &

MPI

Example: select=2:ncpus=36:mpiprocs=36

Request 2 nodes with 36 CPUs each for a total of 72 MPI processes

#!/bin/bash
#PBS -l select=100:ncpus=20:mpiprocs=20
#PBS -l walltime=96:00:00
#PBS -q test
#PBS -N CAL_A

cd $PBS_O_WORKDIR

ALLPROC=`cat $PBS_NODEFILE | wc -l` 
echo $ALLPROC

mpiexec -machinefile $PBS_NODEFILE -np $ALLPROC program.exe input.file > output.file &

Hybrid OpenMP+MPI

Example: select=2:ncpus=40:mpiprocs=1:ompthreads=40

Request two nodes, each with one MPI task and 36 threads/task

/ select=10:ncpus=40:mpiprocs=1:ompthreads=40 For 1 MPI process/node

x select=10:ncpus=40:mpiprocs=40:ompthreads=40 This will generate 1600 process over CPU cores. Don't use this recipe!

#!/bin/bash
#PBS -l select=40:ncpus=40:mpiprocs=1:ompthreads=40
#PBS -l walltime=96:00:00
#PBS -q test
#PBS -N CAL_A

cd $PBS_O_WORKDIR

mpiexec -machinefile $PBS_NODEFILE -np $ALLPROC -genv OMP_NUM_THREADS=40 program.exe -genv OMP_NUM_THREADS=20

YSK

-genv is global environment variable.

-env is local environment variable.

Rangsiman Ketkaew