From e16e32ce70badfd75dcb4c383132b114d7d405d6 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Mon, 8 Jan 2024 09:43:23 +0100 Subject: [PATCH] Add arch files for nvhpc/22.7 @ MLux. --- arch/eurohpc/meluxina/nvhpc/22.7/env.sh | 52 +++++++++++++++++ .../meluxina/nvhpc/22.7/toolchain.cmake | 57 +++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 arch/eurohpc/meluxina/nvhpc/22.7/env.sh create mode 100644 arch/eurohpc/meluxina/nvhpc/22.7/toolchain.cmake diff --git a/arch/eurohpc/meluxina/nvhpc/22.7/env.sh b/arch/eurohpc/meluxina/nvhpc/22.7/env.sh new file mode 100644 index 00000000..d02d9cab --- /dev/null +++ b/arch/eurohpc/meluxina/nvhpc/22.7/env.sh @@ -0,0 +1,52 @@ +# (C) Copyright 1988- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. + +# Source me to get the correct configure/build/run environment + +# Store tracing and disable (module is *way* too verbose) +{ tracing_=${-//[^x]/}; set +x; } 2>/dev/null + +module_load() { + echo "+ module load $1" + module load $1 +} +module_unload() { + echo "+ module unload $1" + module unload $1 +} + +# Unload all modules to be certain +module --force purge + +# Load modules +module_load env/release/2022.1 +module_load CUDA/11.7.0 +module_load NVHPC/22.7-CUDA-11.7.0 +module_load OpenMPI/4.1.4-GCC-11.3.0 +module_load CMake +module_load Boost +module_load Python +#module_load HDF5 + +export CC=nvc +export CXX=nvc++ +export F77=nvfortran +export FC=nvfortran +export F90=nvfortran + +export HDF5_ROOT=/project/home/p200177/nasu/hdf5/1.14.3/build/release/2022.1/nvhpc/22.7/ + +# Increase stack size to maximum +ulimit -S -s unlimited + +set -x + +# Restore tracing to stored setting +{ if [[ -n "$tracing_" ]]; then set -x; else set +x; fi } 2>/dev/null + +export ECBUILD_TOOLCHAIN="./toolchain.cmake" diff --git a/arch/eurohpc/meluxina/nvhpc/22.7/toolchain.cmake b/arch/eurohpc/meluxina/nvhpc/22.7/toolchain.cmake new file mode 100644 index 00000000..ce8de9da --- /dev/null +++ b/arch/eurohpc/meluxina/nvhpc/22.7/toolchain.cmake @@ -0,0 +1,57 @@ +# (C) Copyright 1988- ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. + +#################################################################### +# COMPILER +#################################################################### + +set( ECBUILD_FIND_MPI ON ) + +#################################################################### +# OpenMP FLAGS +#################################################################### + +# Note: OpenMP_Fortran_FLAGS gets overwritten by the FindOpenMP module +# unless its stored as a cache variable +set( OpenMP_Fortran_FLAGS "-mp -mp=gpu,bind,allcores,numa" CACHE STRING "" ) + +# Note: OpenMP_C_FLAGS and OpenMP_C_LIB_NAMES have to be provided _both_ to +# keep FindOpenMP from overwriting the FLAGS variable (the cache entry alone +# doesn't have any effect here as the module uses FORCE to overwrite the +# existing value) +set( OpenMP_C_FLAGS "-mp -mp=bind,allcores,numa" CACHE STRING "" ) +set( OpenMP_C_LIB_NAMES "acchost" CACHE STRING "") + +#################################################################### +# OpenAcc FLAGS +#################################################################### + +# NB: We have to add `-mp` again to avoid undefined symbols during linking +# (smells like an Nvidia bug) +set( OpenACC_Fortran_FLAGS "-acc=gpu -mp=gpu -gpu=cc80,lineinfo,fastmath" CACHE STRING "" ) +# Enable this to get more detailed compiler output +# set( OpenACC_Fortran_FLAGS "${OpenACC_Fortran_FLAGS} -Minfo" ) + +#################################################################### +# COMMON FLAGS +#################################################################### + +set(ECBUILD_Fortran_FLAGS "-fpic") +set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mframe") +set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mbyteswapio") +set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mstack_arrays") +set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mrecursive") +set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Ktrap=fp") +set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Kieee") +set(ECBUILD_Fortran_FLAGS "${ECBUILD_Fortran_FLAGS} -Mdaz") + +set( ECBUILD_Fortran_FLAGS_BIT "-O2 -gopt" ) + +set( ECBUILD_C_FLAGS "-O2 -gopt -traceback" ) + +set( ECBUILD_CXX_FLAGS "-O2 -gopt" )