|
OpenMP at MCSR
How to Compile an OpenMP C or C++ program on sequoia, using the Intel compiler.
. /etc/profile.d/modules.sh
module load intel-compilers-em64t-10.1.017
icc -openmp myprog.c -o myprog.exe
How to Run an OpenMP C program on sequoia
Set the OMP_NUM_THREADS environment variable equal to the number of OpenMP threads that you want to run. (This can be overridden in the C code itself.):
export OMP_NUM_THREADS=4
This will run an OpenMP program named myprog.exe on four CPUs.
. /etc/profile.d/modules.sh
module load intel-compilers-em64t-10.1.017
myprog.exe
However, on sequoia, you should run all OpenMP calculations as PBS batch jobs.
NOTE: You only need to load the appropriate Intel compiler module once per login session--not before each compilation. Also, if you are running your OpenMP program from a PBS script (as you should be) you will need to make sure that the script first loads the appropriate Intel compiler module.
How to Compile an OpenMP C or C++ program on redwood, using the Intel compiler.
icc -openmp myprog.c -o myprog.exe
icc -openmp myprog.cpp -o myprog.exe
Example OpenMP C program that may be run on sweetgum
See example program
How to tell if your OpenMP threads are executing on different CPUS
You can use the ps command, while your program is executing, to see which processors its threads are executing on.
ps -eLF | grep $USER
The 9th column will be the processor id.
|