diff --git a/.github/workflows/frontier/build.sh b/.github/workflows/frontier/build.sh index 5cbc100ccc..a6a51b65f0 100644 --- a/.github/workflows/frontier/build.sh +++ b/.github/workflows/frontier/build.sh @@ -1,4 +1,4 @@ #!/bin/bash . ./mfc.sh load -c f -m g -./mfc.sh build -j 8 --gpu --sys-hdf5 +./mfc.sh build -j 8 --gpu diff --git a/.github/workflows/frontier/test.sh b/.github/workflows/frontier/test.sh index 57b85ac341..12a81d2c13 100644 --- a/.github/workflows/frontier/test.sh +++ b/.github/workflows/frontier/test.sh @@ -3,5 +3,5 @@ gpus=`rocm-smi --showid | awk '{print $1}' | grep -Eo '[0-9]+' | uniq | tr '\n' ' '` ngpus=`echo "$gpus" | tr -d '[:space:]' | wc -c` -./mfc.sh test --max-attempts 3 -j $ngpus --sys-hdf5 -- -c frontier +./mfc.sh test --max-attempts 3 -j $ngpus -- -c frontier diff --git a/CMakeLists.txt b/CMakeLists.txt index a596a935c8..7d05c9c19a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,10 @@ find_program(FYPP_EXE fypp REQUIRED) link_libraries("${CMAKE_DL_LIBS}") set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake") +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake/regular") +if (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray") + list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake/cce") +endif() # Compiler Flags: Here, we specify our own compiler flags for both release and diff --git a/toolchain/cmake/FindcuTENSOR.cmake b/toolchain/cmake/FindcuTENSOR.cmake deleted file mode 100644 index 827d07fe81..0000000000 --- a/toolchain/cmake/FindcuTENSOR.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# Attempt to find NVIDIA cuTENSOR -# URL: https://developer.nvidia.com/cutensor -# DOCS: https://cmake.org/cmake/help/latest/command/find_library.html -# https://cmake.org/cmake/help/latest/module/FindPackageHandleStandardArgs.html - -cmake_minimum_required(VERSION 3.18) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE(CUDAToolkit) - -MESSAGE(STATUS "CUDAToolkit_LIBRARY_ROOT=${CUDAToolkit_LIBRARY_ROOT}") - -FIND_LIBRARY(cuTENSOR_LIBRARY - NAMES cutensor - HINTS "${CUDAToolkit_LIBRARY_ROOT}/../../math_libs" - NAMES_PER_DIR -) - - -FIND_PACKAGE_HANDLE_STANDARD_ARGS( - cuTENSOR - REQUIRED_VARS - cuTENSOR_LIBRARY -) - -IF (cuTENSOR_FOUND AND NOT TARGET cuTENSOR::cuTENSOR) - SET(cuTENSOR_LIBRARIES "${cuTENSOR_LIBRARY}") - SET(cuTENSOR_INCLUDE_DIRS "${cuTENSOR_INCLUDE_DIR}") - - ADD_LIBRARY(cuTENSOR::cuTENSOR UNKNOWN IMPORTED) - - SET_TARGET_PROPERTIES(cuTENSOR::cuTENSOR PROPERTIES - IMPORTED_LOCATION "${cuTENSOR_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${cuTENSOR_INCLUDE_DIRS}" - ) -ENDIF() diff --git a/toolchain/cmake/FindHDF5.cmake b/toolchain/cmake/cce/FindHDF5.cmake similarity index 100% rename from toolchain/cmake/FindHDF5.cmake rename to toolchain/cmake/cce/FindHDF5.cmake diff --git a/toolchain/cmake/FindFFTW.cmake b/toolchain/cmake/regular/FindFFTW.cmake similarity index 100% rename from toolchain/cmake/FindFFTW.cmake rename to toolchain/cmake/regular/FindFFTW.cmake diff --git a/toolchain/cmake/FindSILO.cmake b/toolchain/cmake/regular/FindSILO.cmake similarity index 100% rename from toolchain/cmake/FindSILO.cmake rename to toolchain/cmake/regular/FindSILO.cmake diff --git a/toolchain/dependencies/CMakeLists.txt b/toolchain/dependencies/CMakeLists.txt index 3f875982d0..116e288711 100644 --- a/toolchain/dependencies/CMakeLists.txt +++ b/toolchain/dependencies/CMakeLists.txt @@ -5,7 +5,10 @@ cmake_minimum_required(VERSION 3.12) project(MFC-Dependencies LANGUAGES C CXX Fortran) -list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/regular") +if (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray") + list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/cce") +endif() set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON) @@ -45,19 +48,25 @@ endif() # HDF5 if (MFC_HDF5) - ExternalProject_Add(hdf5 - GIT_REPOSITORY "https://github.com/HDFGroup/hdf5" - GIT_TAG hdf5-1_12_2 - GIT_SHALLOW ON - GIT_PROGRESS ON - CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" - -DBUILD_SHARED_LIBS=OFF - -DFORTRAN_LIBRARIES=ON - -DBUILD_TESTING=OFF - -DHDF5_BUILD_UTILS=OFF - -DHDF5_BUILD_TOOLS=ON - -DHDF5_BUILD_EXAMPLES=OFF - ) + find_package(HDF5) + if (HDF5_FOUND) + message(STATUS "HDF5 found.") + add_custom_target(hdf5) + else() + ExternalProject_Add(hdf5 + GIT_REPOSITORY "https://github.com/HDFGroup/hdf5" + GIT_TAG hdf5-1_12_2 + GIT_SHALLOW ON + GIT_PROGRESS ON + CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" + -DBUILD_SHARED_LIBS=OFF + -DFORTRAN_LIBRARIES=ON + -DBUILD_TESTING=OFF + -DHDF5_BUILD_UTILS=OFF + -DHDF5_BUILD_TOOLS=ON + -DHDF5_BUILD_EXAMPLES=OFF + ) + endif() endif() @@ -84,7 +93,7 @@ if (MFC_SILO) "-DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}" "-DCMAKE_FIND_PACKAGE_REDIRECTS_DIR=${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}" "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" - "$<$:-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/../cmake>" + "$<$:-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/../cmake/cce>" ) endif() endif() diff --git a/toolchain/mfc/args.py b/toolchain/mfc/args.py index 6efdc5c020..cad27120a0 100644 --- a/toolchain/mfc/args.py +++ b/toolchain/mfc/args.py @@ -61,9 +61,6 @@ def add_common_arguments(p, mask = None): if "v" not in mask: p.add_argument("-v", "--verbose", action="store_true", help="Enables verbose compiler & linker output.") - if "n" not in mask: - p.add_argument(f"--sys-hdf5", action="store_true", help=f"Do not build the hdf5 dependency. Use the system's instead.") - if "g" not in mask: p.add_argument("-g", "--gpus", nargs="+", type=int, default=None, help="(Optional GPU override) List of GPU #s to use (environment default if unspecified).")