Skip to content

Commit

Permalink
docs: add openmpi compiler wrappers to requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
yoctoyotta1024 committed Nov 17, 2024
1 parent 1306324 commit d79ef38
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# run cmake with " cmake -S [source dir of targerts] -B [build dir for makefile] "
# e.g. could run cmake with these compiler options:
# cmake -S ./ -B ./build -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON
# cmake -S ./ -B ./build -DCMAKE_CXX_COMPILER=mpic++ -DCMAKE_C_COMPILER=mpicc -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON

# set cmake version
cmake_minimum_required(VERSION 3.18.0)
Expand Down
9 changes: 5 additions & 4 deletions docs/source/usage/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ Compilers
---------
A C++ compiler with the C++20 standard library is the absolute minimum.

On Levante you can use the latest gcc compilers. At the time of writing this is gcc 11.2.0, e.g.
On Levante you can use the latest MPI compiler wrappers for the gcc compilers.
At the time of writing this is gcc 11.2.0, e.g.

.. code-block:: console
$ module load gcc/11.2.0-gcc-11.2.0
$ module load gcc/11.2.0-gcc-11.2.0 openmpi/4.1.2-gcc-11.2.0
To compile with CUDA, use Levante's latest nvhpc compilers, e.g.
To compile with C++ and CUDA, use Levante's latest gcc and nvhpc compilers, e.g.

.. code-block:: console
$ module load nvhpc/23.9-gcc-11.2.0
$ module load gcc/11.2.0-gcc-11.2.0 nvhpc/23.9-gcc-11.2.0 openmpi/4.1.6-nvhpc-23.9
Python
------
Expand Down
3 changes: 2 additions & 1 deletion roughpaper/scratch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# module load gcc && CXX=g++ CC=gcc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON
# module load gcc/11.2.0-gcc-11.2.0 openmpi/4.1.2-gcc-11.2.0
# CXX=mpic++ CC=mpicc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON

# set cmake version
if(NOT DEFINED CMAKE_MINIMUM_REQUIRED_VERSION)
Expand Down
39 changes: 21 additions & 18 deletions scripts/cmakebuild-examples.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
### using nvcc compiler:
### nvhpc > 22.3
### with cmake 3.21.1
### using appropriate openmpi library for chosen compiler
### (e.g. via Levante compiler wrappers)
### ----------------------------- ###

### -- CLEO PySD Requirements --- ###
Expand All @@ -44,26 +46,27 @@ e.g. spack find cmake
-DKokkos_ENABLE_CUDA_LAMBDA=ON
-DKokkos_ENABLE_CUDA_UVM=ON (depreciated)

OPENMP ENABLED build:
module load gcc
CXX=g++ CC=gcc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON

SERIAL ONLY build (no MPI):
module load gcc/11.2.0-gcc-11.2.0
CXX=g++ CC=gcc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON
CXX=nvc++ CC=nvcc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON
or perhaps:
CXX=g++-13 CC=gcc-13 cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON
CXX=g++-13 CC=gcc-13 cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON

GPU (CUDA) ENABLED build:
module load gcc
module load nvhpc
spack load [email protected]%gcc
CXX=nvc++ CC=nvcc cmake -S ./ -B ./build -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_CUDA_UVM=ON
MPI + SERIAL ONLY build
module load gcc/11.2.0-gcc-11.2.0 openmpi/4.1.2-gcc-11.2.0
CXX=mpi++ CC=mpicc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON

SERIAL ONLY build:
module load gcc
CXX=g++ CC=gcc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON
CXX=nvc++ CC=nvcc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON
MPI + OPENMP ENABLED build:
module load gcc/11.2.0-gcc-11.2.0 openmpi/4.1.2-gcc-11.2.0
CXX=mpi++ CC=mpicc cmake -S ./ -B ./build -DKokkos_ARCH_NATIVE=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON

MPI + GPU (CUDA) ENABLED build:
module load gcc/11.2.0-gcc-11.2.0 nvhpc/23.9-gcc-11.2.0 openmpi/4.1.6-nvhpc-23.9
spack load [email protected]%gcc
CXX=mpic++ CC=mpicc cmake -S ./ -B ./build -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_CUDA_UVM=ON

CUDA and OPENMP build:
module load gcc
module load nvhpc
MPI + CUDA and OPENMP build:
module load gcc/11.2.0-gcc-11.2.0 nvhpc/23.9-gcc-11.2.0 openmpi/4.1.6-nvhpc-23.9
spack load [email protected]%gcc
CXX=nvc++ CC=nvcc cmake -S ./ -B ./build -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_CUDA_UVM=ON
CXX=mpic++ CC=mpicc cmake -S ./ -B ./build -DKokkos_ARCH_AMPERE80=ON -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=ON -DKokkos_ENABLE_CUDA=ON -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_CUDA_UVM=ON

0 comments on commit d79ef38

Please sign in to comment.