mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Use mpicc and mpicxx for MPI configurations
This commit is contained in:
parent
c710184fba
commit
36244692fd
2 changed files with 10 additions and 7 deletions
|
|
@ -263,14 +263,15 @@ should be used:
|
|||
Compiling with MPI
|
||||
++++++++++++++++++
|
||||
|
||||
To compile with MPI, set the :envvar:`FC` and :envvar:`CC` environment variables
|
||||
to the path to the MPI Fortran and C wrappers, respectively. For example, in a
|
||||
bash shell:
|
||||
To compile with MPI, set the :envvar:`FC`, :envvar:`CC`, and :envvar:`CXX`
|
||||
environment variables to the path to the MPI Fortran, C, and C++ wrappers,
|
||||
respectively. For example, in a bash shell:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export FC=mpif90
|
||||
export FC=mpifort
|
||||
export CC=mpicc
|
||||
export CXX=mpicxx
|
||||
cmake /path/to/openmc
|
||||
|
||||
Note that in many shells, environment variables can be set for a single command,
|
||||
|
|
@ -278,7 +279,7 @@ i.e.
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
FC=mpif90 CC=mpicc cmake /path/to/openmc
|
||||
FC=mpifort CC=mpicc CXX=mpicxx cmake /path/to/openmc
|
||||
|
||||
Selecting HDF5 Installation
|
||||
+++++++++++++++++++++++++++
|
||||
|
|
@ -354,7 +355,7 @@ follows:
|
|||
.. code-block:: sh
|
||||
|
||||
mkdir build && cd build
|
||||
FC=ifort CC=icc FFLAGS=-mmic cmake -Dopenmp=on ..
|
||||
FC=ifort CC=icc CXX=icpc FFLAGS=-mmic cmake -Dopenmp=on ..
|
||||
make
|
||||
|
||||
Note that unless an HDF5 build for the Intel Xeon Phi (Knights Corner) is
|
||||
|
|
|
|||
|
|
@ -33,9 +33,11 @@ def install(omp=False, mpi=False, phdf5=False):
|
|||
if not omp:
|
||||
cmake_cmd.append('-Dopenmp=off')
|
||||
|
||||
# For MPI, we just need to change the Fortran compiler
|
||||
# Use MPI wrappers when building in parallel
|
||||
if mpi:
|
||||
os.environ['FC'] = 'mpifort' if which('mpifort') else 'mpif90'
|
||||
os.environ['CC'] = 'mpicc'
|
||||
os.environ['CXX'] = 'mpicxx'
|
||||
|
||||
# Tell CMake to prefer parallel HDF5 if specified
|
||||
if phdf5:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue