From b86d51b755b00226b8e78e728888eeaa36ee912b Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Fri, 17 Dec 2021 15:47:09 -0300 Subject: [PATCH] CMAKE, MAKE: Add support for NV HPC version 21.11. Signed-off-by: Grzegorz Kowal --- CMakeLists.txt | 5 +++++ README.md | 4 ++-- build/hosts/default | 4 ++-- sources/mpitools.F90 | 4 ---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a250804..69d36c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,11 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "PGI") add_compile_options("$<$:-O;-Minfo=all>") endif() +if(CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC") + add_compile_options("$<$:-fast;-O4;-Minline>") + add_compile_options("$<$:-Mbounds;-Mchkptr;-Minfo=all>") +endif() + file(GLOB_RECURSE sources sources/*.F90) add_executable(amun.x ${sources}) diff --git a/README.md b/README.md index de8f536..489beca 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,8 @@ Requirements version 18.10 or newer, - [Intel Fortran](https://software.intel.com/en-us/fortran-compilers) compiler version 9.0 or newer. - - [NVIDIA HPC](https://developer.nvidia.com/hpc-sdk) compiler version 21.9. - Warning: I could not make it run with the included MPI libraries. + - [NVIDIA HPC](https://developer.nvidia.com/hpc-sdk) compiler version 21.11 + or newer. * Recommended, although optional, [OpenMPI](https://www.open-mpi.org/) for parallel runs, tested with version 1.8 or newer. * Optional [CMake](https://cmake.org) version 3.16 or newer, for advanced diff --git a/build/hosts/default b/build/hosts/default index a296ebe..92e5d5b 100644 --- a/build/hosts/default +++ b/build/hosts/default @@ -55,9 +55,9 @@ LD = $(FC) # compiler and linker flags # ifeq ($(DEBUG),Y) -FFLAGS = -O0 -g -Mbounds -Mchkptr -Mcache_align -Mnovintr -Mchkstk -DDEBUG +FFLAGS = -O0 -g -Mbounds -Mchkptr -Minfo=all -DDEBUG else -FFLAGS = -fast -O3 +FFLAGS = -fast -O4 -Minline endif ifeq ($(OPENMP),Y) FFLAGS += -mp diff --git a/sources/mpitools.F90 b/sources/mpitools.F90 index 81c0b14..92ea9c1 100644 --- a/sources/mpitools.F90 +++ b/sources/mpitools.F90 @@ -46,9 +46,7 @@ module mpitools end interface interface reduce_maximum module procedure reduce_maximum_integer -#ifndef __NVCOMPILER module procedure reduce_maximum_double -#endif /* __NVCOMPILER */ module procedure reduce_maximum_double_array end interface interface reduce_sum @@ -655,7 +653,6 @@ module mpitools !------------------------------------------------------------------------------- ! end subroutine reduce_maximum_integer -#ifndef __NVCOMPILER ! !=============================================================================== ! @@ -697,7 +694,6 @@ module mpitools !------------------------------------------------------------------------------- ! end subroutine reduce_maximum_double -#endif /* __NVCOMPILER */ ! !=============================================================================== !