Compiling Hybrid Programs
A hybrid program combines both MPI and shared-memory to take advantage of compute clusters with multi-core compute nodes. Libraries for OpenMPI and Intel MPI (IMPI) and compilers which include OpenMP for C, C++, and Fortran are available.
| Language | Header Files | 
|---|---|
| Fortran 77 | 
 | 
| Fortran 90 | 
 | 
| Fortran 95 | 
 | 
| C | 
 | 
| C++ | 
 | 
A few examples illustrate hybrid programs with task parallelism of OpenMP:
This example illustrates a hybrid program with loop-level (data) parallelism of OpenMP:
To see the available MPI libraries:
$ module avail impi
$ module avail openmpi
The following tables illustrate how to compile your hybrid (MPI/OpenMP) program. Any compiler flags accepted by Intel ifort/icc compilers are compatible with their respective MPI compiler.
| Language | Command | 
|---|---|
| Fortran 77 | 
 | 
| Fortran 90 | 
 | 
| Fortran 95 | 
 | 
| C | 
 | 
| C++ | 
 | 
| Language | Command | 
|---|---|
| Fortran 77 | 
 | 
| Fortran 90 | 
 | 
| Fortran 95 | 
 | 
| C | 
 | 
| C++ | 
 | 
The Intel and GNU compilers will not output anything for a successful compilation. Also, the Intel compiler does not recognize the suffix .f95.