omf77 [compiler options] -o myexec.exe file.f -lpthread omcc [compiler options] -o myexec.exe file.c -lpthreadSee the documentation in :
file:/opt/omni/lib/openmp/doc/index.htmlon the front end server. By default the compiled code will run using 2 cpus if it is compiled on a dual cpu host and on 4 cpus if compiled on a quad processor etc. You can explicitly set the number of threads by setting the environment variable OMPC_NUM_PROCS. See the documentation.
pgf77 [compiler options] -o myexec.exe -mp file.f -lpthread pgf90 [compiler options] -o myexec.exe -mp file.f90 -lpthread pgcc [compiler options] -o myexec.exe -mp file.c -lpthread pgCC [compiler options] -o myexec.exe -mp file.cc -lpthreadYou should use the PGI -Bstatic option to ensure that your code is statically linked in case the compiler libraries are not installed on the compute nodes.
For the PGI compilers you can control the number of parallel threads at execution time by setting the environment variable OMP_NUM_THREADS to the appropriate value. Unlike the Omni compilers the default number of threads is 1. To execute code on a dual or quad processor you will therefore need explicitly to explicitly set this variable - e.g on a dual cpu host you will need to type
setenv OMP_NUM_THREADS 2if you are using csh or tcsh shells, or
export OMP_NUM_THREADS=2if you are using the sh or bash shells. You may submit an OpenMP parallel job to a single SMP compute node using SGE. In which case you should probable set the OMP_NUM_THREADS variable in your job script. See .
There is an extensive documentation to OpenMP programming in the PGI Users' Guide. (3) Using the Intel OPenMP compilers. If you have an Intel Fortran (ifc) license or Intel C (icc) license then you can compile OpenMP source code using the -openmp opt ion :
ifc [compiler options] -o myexec.exe -openmp file.f -lpthread ifc [compiler options] -o myexec.exe -openmp file.f90 -lpthread icc [compiler options] -o myexec.exe -openmp file.c -lpthread icc [compiler options] -o myexec.exe -openmp file.cca -lpthreadYou should use the Intel -static option to ensure that your code is statically linked in case the compiler libraries are not installed on the compute nodes.
By default the number of threads is the same as the number of processors on the host you run the code - eg 2 for a dual processor machine.