Skip to content

Commit

Permalink
Merge branch 'vegarde-main-patch-80184' into 'main'
Browse files Browse the repository at this point in the history
Update compilers.md

See merge request documentation/public!1019
  • Loading branch information
hrnagel committed Feb 6, 2025
2 parents d15edbd + 07d23bf commit d1a5ac6
Showing 1 changed file with 33 additions and 78 deletions.
111 changes: 33 additions & 78 deletions code_development/compilers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,46 @@

## Compiling MPI Applications

### Intel MPI

The following table shows available Intel MPI compiler commands, the underlying Intel and GNU compilers, and ways to override underlying compilers with environment variables or command line options:
### Open MPI

<table>
<thead>
<th align="left">Language</th>
<th align="left">Wrapper script</th>
<th align="left">Default compiler</th>
<th align="left">Environment variable</th>
<th align="left">Command line</th>
</thead>
<tbody>
<tr>
<td rowspan="2" align="left" valign="middle">C</td>
<td><code class="code">mpiicc</code></td>
<td><code class="code">icc</code></td>
<td rowspan="2">I_MPI_CC</td>
<td rowspan="2"><code class="code">-cc</code>=&lt;compiler&gt;</td>
</tr>
<tr>
<td><code class="code">mpigcc</code></td>
<td><code class="code">gcc</code></td>
</tr>
<tr>
<td rowspan="2">C++</td>
<td><code class="code">mpiicpc</code></td>
<td><code class="code">icpc</code></td>
<td rowspan="2">I_MPI_CXX</td>
<td rowspan="2"><code class="code">-cxx</code>=&lt;compiler&gt;</td>
</tr>
<tr>
<td><code class="code">mpigxx</code></td>
<td><code class="code">g++</code></td>
</tr>
<tr>
<td rowspan="2">Fortran</td>
<td><code class="code">mpiifort</code></td>
<td><code class="code">ifort</code></td>
<td rowspan="2">I_MPI_FC</td>
<td rowspan="2"><code class="code">-fc</code>=&lt;compiler&gt;</td>
</tr>
<tr>
<td><code class="code">mpifc</code></td>
<td><code class="code">gfortran</code></td>
</tr>
</tbody>
</table>
The Open MPI compiler wrapper scripts listed in the table below add in all relevant compiler and link flags, and the invoke the underlying compiler, i.e. the compiler the Open MPI installation was built with.

Specify option `-show` with one of the compiler wrapper scripts to see the underlying compiler together with compiler options, link flags and libraries.
| Language | Wrapper script | Default compiler | Environment variable |
| :------------- | :-------------: |:-------------: |:-------------: |
| C |`mpiicc` | `gcc` | `OMPI_CC` |
| C++ | `mpicxx, mpic++, mpiCC` | `g++` | `OMPI_CXX` |
| Fortran | `mpifort` | `gfortran` | `OMPI_FC` |

The Intel MPI toolchain is loaded by using `module load`:
It is possible to change the underlying compiler invoked when calling the compiler wrappers using the environment variables listed in the table. Use the option `-showme` to see the underlying compiler, the compile and link flags, and the libraries that are linked.

module load intel/2017a
### Intel MPI

Please see also {ref}`running-mpi-applications`.
The following table shows available Intel MPI compiler commands, the underlying Intel and GNU compilers, and ways to override underlying compilers with environment variables or command line options.
| Language | Wrapper script | Default compiler | Environment variable | Command line |
| :------------- | :-------------: |:-------------: |:-------------: |:-------------: |
| C |`mpiicc` | `icc` [^1]| `I_MPI_CC` | `-cc=`<compiler> |
| C |`mpiicx` [^2] | `icx` [^3]| `I_MPI_CC` | `-cc=`<compiler> |
| C |`mpicc` | `gcc` | `I_MPI_CC` | `-cc=`<compiler> |
| C++ | `mpiicpc` | `icpc` [^1] | `I_MPI_CXX` | `-cxx=`<compiler> |
| C++ | `mpiicpx` [^2] | `icpx` [^3] | `I_MPI_CXX` | `-cxx=`<compiler> |
| C++ | `mpicxx` | `g++`| `I_MPI_CXX` | `-cxx=`<compiler> |
| Fortran | `mpiifort` | `ifort` [^1] | `I_MPI_FC` | `-fc=`<compiler> |
| Fortran | `mpiifx` [^2] | `ifx` [^3] | `I_MPI_FC` | `-fc=`<compiler> |
| Fortran | `mpif90` | `gfortran` | `I_MPI_FC` | `-fc=`<compiler> |

Specify option `-show` with one of the compiler wrapper scripts to see the underlying compiler together with compiler options, link flags and libraries.

### Open MPI
**Example:** use the available MPI C wrapper command before the Intel oneAPI 2023.2 release but with the LLVM based compiler
```
$ module load intel/2022a
$ mpiicc -cc=icx mpi_hello_world.c
```

The Open MPI compiler wrapper scripts listed in the table below add in all relevant compiler and link flags, and the invoke the underlying compiler, i.e. the compiler the Open MPI installation was built with.
Notice, the Intel Compiler Classic drivers commands `icc`and `icpc` have been removed since the Intel oneAPI 2024.0 release (i.e. 2024 toolchains for NRIS clusters). Use the LLVM-based Intel Compiler drivers `icx` and `icpx` instead, for more information see the [Porting Guide for ICC Users to DPCPP or ICX](https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-icc-users-to-dpcpp-or-icx.html).
The Classic `ifort` command will be discontinued in the oneAPI 2025 release. Use LLVM-based Intel Compiler driver `ifx` instead, for more information see the [Porting Guide for ifort Users to ifx.](https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-icc-users-to-dpcpp-or-icx.html).

<table>
<thead>
<th align="left">Language</th>
<th align="left">Wrapper script</th>
<th align="left">Environment variable</th>
</thead>
<tbody>
<tr>
<td>C</td>
<td><code class="code">mpicc</code></td>
<td>OMPI_CC</td>
</tr>
<tr>
<td>C++</td>
<td><code class="code">mpiCC, mpicxx, mpic++</code></td>
<td>OMPI_CXX</td>
</tr>
<tr>
<td>Fortran</td>
<td><code class="code">mpifort</code></td>
<td>OMPI_FC</td>
</tr>
</tbody>
</table>
See also {ref}`running-mpi-applications`.

It is possible to change the underlying compiler invoked when calling the compiler wrappers using the environment variables listed in the table. Use the option `-showme` to see the underlying compiler, the compile and link flags, and the libraries that are linked.
[^1]: Intel Compiler Classic driver commands, available before the Intel oneAPI 2024.0 release (`icc/icpc`), and before the Intel oneAPI 2025 release (`ifort`).
[^2]: Intel LLVM based compiler based wrappers available since the Intel oneAPI 2023.2 release (i.e. `intel/2023b` toolchain on NRIS clusters)
[^3]: LLVM-based backend Intel Compiler drivers available since 2022

0 comments on commit d1a5ac6

Please sign in to comment.