Skip to content

Commit

Permalink
Combined PR: hpc-stack locations, Disable Fused Multiply Add, and Ena…
Browse files Browse the repository at this point in the history
…ble usage of shared pio (ufs-community#1645)

* Gaea system: change in hpc-stack location, miniconda3 (EPIC-managed)

* move DISABLE_FMA to one if at the end

* only disable fma on wcoss if FASTER=ON

* Update CMakeModules to develop; remove STATIC requirement from PIO find.

Co-authored-by: Natalie Perlin <[email protected]>
Co-authored-by: ulmononian <[email protected]>
  • Loading branch information
3 people authored Mar 9, 2023
1 parent b388eb9 commit 495c5fd
Show file tree
Hide file tree
Showing 31 changed files with 5,111 additions and 5,224 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ set(AVX OFF CACHE BOOL "Enable AVX-I instruction set")
set(SIMDMULTIARCH OFF CACHE BOOL "Enable multi-target SIMD instruction sets")
set(DEBUG OFF CACHE BOOL "Enable DEBUG mode")
set(DEBUG_LINKMPI ON CACHE BOOL "Enable linkmpi option when DEBUG mode is on")
set(DISABLE_FMA OFF CACHE BOOL "Disable Fused Multiply-Add instructions (workaround needed for AMD EPYC)" FORCE)
set(INLINE_POST ON CACHE BOOL "Enable inline post")
set(MULTI_GASES OFF CACHE BOOL "Enable MULTI_GASES")
set(MOVING_NEST OFF CACHE BOOL "Enable moving nest code")
Expand Down Expand Up @@ -137,7 +138,7 @@ if(FMS)
endif()

if(CMEPS)
find_package(PIO 2.5.3 REQUIRED COMPONENTS C Fortran STATIC)
find_package(PIO 2.5.3 REQUIRED COMPONENTS C Fortran)
endif()

find_package(bacio 2.4.0 REQUIRED)
Expand Down
6 changes: 6 additions & 0 deletions cmake/Intel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ if(APPLE)
# Passing the -c flag includes them and fixes an error with undefined symbols
set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> -c <TARGET>")
endif()

# This must be last, to override all other optimization settings.
if(DISABLE_FMA)
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -no-fma")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -no-fma")
endif()
4 changes: 4 additions & 0 deletions cmake/configure_acorn.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
set(PARALLEL_NETCDF ON CACHE BOOL "Enable parallel NetCDF" FORCE)
set(DEBUG_LINKMPI OFF CACHE BOOL "Enable linkmpi option when DEBUG mode is on" FORCE)
set(AVX2 OFF CACHE BOOL "Enable AVX2 instruction set" FORCE)

if(FASTER)
set(DISABLE_FMA ON CACHE BOOL "Disable Fused Multiply-Add instructions (workaround needed for AMD EPYC)" FORCE)
endif()
4 changes: 4 additions & 0 deletions cmake/configure_wcoss2.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
set(PARALLEL_NETCDF ON CACHE BOOL "Enable parallel NetCDF" FORCE)
set(DEBUG_LINKMPI OFF CACHE BOOL "Enable linkmpi option when DEBUG mode is on" FORCE)
set(AVX2 OFF CACHE BOOL "Enable AVX2 instruction set" FORCE)

if(FASTER)
set(DISABLE_FMA ON CACHE BOOL "Disable Fused Multiply-Add instructions (workaround needed for AMD EPYC)" FORCE)
endif()
56 changes: 0 additions & 56 deletions modulefiles/ufs_gaea.intel

This file was deleted.

35 changes: 35 additions & 0 deletions modulefiles/ufs_gaea.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
help([[
This module loads libraries required for building and running UFS Weather Model
on the NOAA RDHPC machine Gaea using Intel-2022.1.2
]])

whatis([===[Loads libraries needed for building the UFS Weather Model on Gaea ]===])

prepend_path("MODULEPATH", "/lustre/f2/dev/role.epic/contrib/modulefiles")
load(pathJoin("miniconda3",os.getenv("miniconda_ver") or "4.12.0"))

load(pathJoin("cmake", os.getenv("cmake_ver") or "3.20.1"))

prepend_path("MODULEPATH","/lustre/f2/dev/role.epic/contrib/hpc-stack/intel-2021.3.0_noarch/modulefiles/stack")
load(pathJoin("hpc", os.getenv("hpc_ver") or "1.2.0"))
load(pathJoin("intel", os.getenv("intel_ver") or "2021.3.0"))
load(pathJoin("hpc-intel", os.getenv("hpc_intel_ver") or "2021.3.0"))
load(pathJoin("hpc-cray-mpich", os.getenv("hpc_cray_mpich_ver") or "7.7.11"))
load(pathJoin("gcc", os.getenv("gcc_ver") or "8.3.0"))
load(pathJoin("libpng", os.getenv("libpng_ver") or "1.6.37"))

-- needed for WW3 build
load(pathJoin("gcc", os.getenv("gcc_ver") or "8.3.0"))
-- Needed at runtime:
load("alps")
load("rocoto")

load("ufs_common")

setenv("CC","cc")
setenv("FC","ftn")
setenv("CXX","CC")
setenv("CMAKE_C_COMPILER","cc")
setenv("CMAKE_CXX_COMPILER","CC")
setenv("CMAKE_Fortran_COMPILER","ftn")
setenv("CMAKE_Platform","gaea.intel")
53 changes: 0 additions & 53 deletions modulefiles/ufs_gaea.intel_debug

This file was deleted.

35 changes: 35 additions & 0 deletions modulefiles/ufs_gaea.intel_debug.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
help([[
This module loads libraries required for building and running UFS Weather Model
on the NOAA RDHPC machine Gaea using Intel-2022.1.2
]])

whatis([===[Loads libraries needed for building the UFS Weather Model and debug on Gaea ]===])

prepend_path("MODULEPATH", "/lustre/f2/dev/role.epic/contrib/modulefiles")
load(pathJoin("miniconda3",os.getenv("miniconda_ver") or "4.12.0"))

load(pathJoin("cmake", os.getenv("cmake_ver") or "3.20.1"))

prepend_path("MODULEPATH","/lustre/f2/dev/role.epic/contrib/hpc-stack/intel-2021.3.0_noarch/modulefiles/stack")
load(pathJoin("hpc", os.getenv("hpc_ver") or "1.2.0"))
load(pathJoin("intel", os.getenv("intel_ver") or "2021.3.0"))
load(pathJoin("hpc-intel", os.getenv("hpc_intel_ver") or "2021.3.0"))
load(pathJoin("hpc-cray-mpich", os.getenv("hpc_cray_mpich_ver") or "7.7.11"))
load(pathJoin("gcc", os.getenv("gcc_ver") or "8.3.0"))
load(pathJoin("libpng", os.getenv("libpng_ver") or "1.6.37"))

-- needed for WW3 build
load(pathJoin("gcc", os.getenv("gcc_ver") or "8.3.0"))
-- Needed at runtime:
load("alps")
load("rocoto")

load("ufs_common_debug")

setenv("CC","cc")
setenv("FC","ftn")
setenv("CXX","CC")
setenv("CMAKE_C_COMPILER","cc")
setenv("CMAKE_CXX_COMPILER","CC")
setenv("CMAKE_Fortran_COMPILER","ftn")
setenv("CMAKE_Platform","gaea.intel")
Loading

0 comments on commit 495c5fd

Please sign in to comment.