Compiling OpenMP Programs
All compilers installed on Anvil include OpenMP functionality for C, C++, and Fortran. An OpenMP program is a single process that takes advantage of a multi-core processor and its shared memory to achieve a form of parallel computing called multithreading. It distributes the work of a process over processor cores in a single compute node without the need for MPI communications.
| Language | Header Files |
|---|---|
| Fortran 77 | |
| Fortran 90 | |
| Fortran 95 | |
| C | |
| C++ | |
Sample programs illustrate task parallelism of OpenMP:
A sample program illustrates loop-level (data) parallelism of OpenMP:
To load a compiler, enter one of the following:
$ module load intel
$ module load gcc
$ module load aocc
| Language | Intel Compiler | GNU Compiler | AOCC Compiler |
|---|---|---|---|
| Fortran 77 | |
|
|
| Fortran 90 | |
|
|
| Fortran 95 | |
|
|
| C | |
|
|
| C++ | |
|
|
The Intel, GNU and AOCC compilers will not output anything for a successful compilation. Also, the Intel compiler does not recognize the suffix ".f95". You may use ".f90" to stand for any Fortran code regardless of version as it is a free-formatted form.
Here is some more documentation from other sources on OpenMP: