User Documentation

Skip to end of metadata
Go to start of metadata

Hybrid programming combines MPI with OpenMP to achieve parallel execution.

OpenMP spawns multiple threads, which are children of the MPI processes. Therefore, the default core binding option of mprirun/mpiexec, which is --bind-to-core  must be changed to --bind-to-socket --by-socket, in order for the OpenMP threads to be able to run on all cores of the node.

Below is an example PBS script which runs a hybrid programming job.

#!/bin/bash
#PBS -N mixed-hello
#PBS -j oe
#PBS -q cpuq
#PBS -l nodes=3:ppn=2
cd $PBS_O_WORKDIR
export NN=`cat $PBS_NODEFILE | sort -u | wc -l`
export NP=`cat $PBS_NODEFILE | wc -l`
export OMP_NUM_THREADS=6
echo $NN $NP $OMP_NUM_THREADS
#sleep 10
module load OpenMPI/1.6.4-GCC-4.7.2
mpiexec --bind-to-socket --bysocket -np $NP ./hello
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.