Deprecated: please see new documentation site.


Contents


Intel compilers on LONI linux clusters offer the interface to OpenMP threading tools. To compile your OpenMP program with Intel compilers, simply invoke -openmp flag at compilation for either Fortran or C. In the following example, an OpenMP code my_openmp_code.c is compiled with Intel C compiler icc, an executable myprogram is generated:

icc -openmp -O3 my_openmp_code.c -o myprogram

To run the executable myprogram interactively, first submit your job as the following:

qsub -I -l nodes=1:ppn=4

after being assigned a node, setup environment for OpenMP

export OMP_NUM_THREADS=4

then, run the executable directly:

cd $PATH_To_EXECUTABLE
myprogram

To send an OpenMP job to PBS batch queues, please see the following script for reference:

#!/bin/bash
#PBS -q checkpt
#PBS -A loni_gridadmin1
#
#PBS -l nodes=1:ppn=4
# number of nodes can only be 1 because memory is only shared within one node
# Do NOT use ppn = 1.
#
#PBS -l cput=2:00:00
# requested CPU time.
#
#PBS -l walltime=2:00:00
# requested Wall-clock time.
#
#PBS -o myoutput2
# name of the standard out file to be "output-file".
#
#PBS -j oe
# standard error output merge to the standard output file.
#
#PBS -N openmp_test
# name of the job (that will appear on executing the qstat command) to be "syschk".
#
# Following are non PBS commands. PLEASE ADOPT THE SAME EXECUTION SCHEME
# i.e. execute the job by copying the necessary files from your home directpory
# to the scratch space, execute in the scratch space, and copy back
# the necessary files to your home directory.
#
# enter the working directory
cd your_path_to_executable
#
# set Openm Environment
export OMP_NUM_THREADS=4
#
# Launch your OpenMp program
./myprogram

Please keep in mind that you can only ask for one node for OpenMP jobs, because memory is only shared within one node. The environment variable OMP_NUM_THREADS is the number of OpenMP threads that will share the workload, it should be identical to ppn for full utilization of computing resources. Note that ppn (processor per node) is 4 for Louie and 8 for QueenBee.

Links


Users may direct questions to sys-help@loni.org.

Powered by MediaWiki