Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROCm Build #1228

Merged
merged 29 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d2b1350
setup spack for tioga build
chapman39 Sep 11, 2024
16ae2cf
Merge remote-tracking branch 'origin/develop' into feature/chapman39/…
chapman39 Sep 11, 2024
6e7db08
simplify spack yaml, add custom craympich
chapman39 Sep 13, 2024
784a370
cleanup spack.yaml, try newer rocm
chapman39 Sep 18, 2024
991ce12
Merge remote-tracking branch 'origin/develop' into feature/chapman39/…
chapman39 Sep 19, 2024
65202aa
petsc can build on rocm, mfem build fails
chapman39 Sep 21, 2024
7becd7e
TPLs built on rzvernal locally
chapman39 Sep 24, 2024
b7fa8fd
wording
chapman39 Sep 24, 2024
d1534e6
add SERAC_ENABLE_X option for hip, cuda, openmp, mpi
chapman39 Sep 25, 2024
479a234
cray-mpich needs the slurm variant
chapman39 Sep 26, 2024
1320dc7
add serac_device_depends where needed with correct syntax
chapman39 Sep 27, 2024
8a882ed
Merge remote-tracking branch 'origin/develop' into feature/chapman39/…
chapman39 Sep 30, 2024
0146a0a
prevent compiler error in the no strumpack no petsc case
chapman39 Sep 30, 2024
396e4ea
resolve +profiling error, external hip prefix /opt/rocm/hip
chapman39 Sep 30, 2024
eb1f8fa
resolve libpgmath.so error
chapman39 Oct 1, 2024
9fa9527
resolve strumpack issues on tioga, fix cmake var naming
chapman39 Oct 1, 2024
9d9a5b5
inherit from spack builtin
chapman39 Oct 1, 2024
fd5e8f1
rz host configs
chapman39 Oct 2, 2024
12be74d
toss4 cray ci setup
chapman39 Oct 2, 2024
9c6af2c
lassen and tioga host configs
chapman39 Oct 2, 2024
5bddf58
Merge branch 'feature/chapman39/tioga-build' of github.com:LLNL/serac…
chapman39 Oct 2, 2024
c4a4889
correct hc name
chapman39 Oct 2, 2024
f2635c7
Merge branch 'feature/chapman39/tioga-build' of github.com:LLNL/serac…
chapman39 Oct 2, 2024
3471146
use flux args
chapman39 Oct 2, 2024
60e9437
remove module load texlive
chapman39 Oct 2, 2024
58f124f
add -lrocblas to fix build errors
chapman39 Oct 2, 2024
f1c1db2
ruby host configs
chapman39 Oct 2, 2024
ca154cf
hip smoketest
chapman39 Oct 2, 2024
1771162
remove CMAKE_CXX_FLAGS_DEBUG section
chapman39 Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ __pycache__/
view
/_serac_build_and_test*
build-linux-*-*-*
*.core
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ variables:
include:
- local: .gitlab/build_blueos.yml
- local: .gitlab/build_toss4.yml
- local: .gitlab/build_toss4_cray.yml
- project: 'lc-templates/id_tokens'
file: 'id_tokens.yml'
49 changes: 49 additions & 0 deletions .gitlab/build_toss4_cray.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
####
# This is the shared configuration of jobs for toss4_cray
.on_toss4_cray:
variables:
SCHEDULER_PARAMETERS: "--queue pci --exclusive --time-limit=${ALLOC_TIME}m --nodes=${ALLOC_NODES}"
tags:
- batch
- tioga
rules:
- if: '$CI_COMMIT_BRANCH =~ /_qnone/ || $ON_TOSS4_CRAY == "OFF"' #run except if ...
when: never
before_script:
- module load cmake/3.23.1

####
# Templates
.src_build_on_toss4_cray:
extends: [.src_build_script, .on_toss4_cray, .src_workflow]
needs: []

.full_build_on_toss4_cray:
extends: [.full_build_script, .on_toss4_cray, .full_workflow]
needs: []
before_script:
# LC version of pip is ancient
- if [[ $(python3 -c 'import pip; print(pip.__version__ < "19.3")') == "True" ]]; then python3 -m pip install --user --upgrade pip; fi


####
# Build jobs

# Only run integration tests on one spec
toss4_cray-clang_17_0_0-src:
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}_hip.cmake"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4_cray

toss4_cray-clang_17_0_0-full:
variables:
COMPILER: "[email protected]"
SPEC: "--spec=%${COMPILER}"
ALLOC_NODES: "1"
ALLOC_TIME: "45"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON"
extends: .full_build_on_toss4_cray
2 changes: 1 addition & 1 deletion .uberenv_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"package_final_phase" : "initconfig",
"package_source_dir" : "../..",
"spack_url": "https://github.com/spack/spack.git",
"spack_commit": "6d244b3f6776b3697861c6b5cebbee376c30bff3",
"spack_commit": "cfee88a5bb56a1c8ec892879e04cb6a17c4f9404",
"spack_configs_path": "scripts/spack/configs",
"spack_packages_path": ["scripts/spack/radiuss-spack-configs/packages", "scripts/spack/packages"],
"spack_concretizer": "clingo"
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ if(NOT DEFINED SERAC_SOURCE_DIR)
endif()
message(STATUS "Serac Source Dir: ${SERAC_SOURCE_DIR}")

if(SERAC_ENABLE_CODEVELOP)
# For HIP case, this flag prevents the following Strumpack linker error:
# undefined symbol: mpi_abort_
if(SERAC_ENABLE_CODEVELOP OR (ENABLE_HIP AND STRUMPACK_DIR))
set(ENABLE_FORTRAN ON CACHE BOOL "")
endif()

Expand Down
4 changes: 4 additions & 0 deletions cmake/SeracBasics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ endif()
option(SERAC_ENABLE_CODE_CHECKS "Enable Serac's code checks" ${_enable_serac_code_checks})

cmake_dependent_option(SERAC_ENABLE_TESTS "Enables Serac Tests" ON "ENABLE_TESTS" OFF)
cmake_dependent_option(SERAC_ENABLE_CUDA "Enables Serac with CUDA support" ON "ENABLE_CUDA" OFF)
cmake_dependent_option(SERAC_ENABLE_HIP "Enables Serac with HIP support" ON "ENABLE_HIP" OFF)
cmake_dependent_option(SERAC_ENABLE_MPI "Enables Serac with MPI support" ON "ENABLE_MPI" OFF)
cmake_dependent_option(SERAC_ENABLE_OPENMP "Enables Serac with OPENMP support" ON "ENABLE_OPENMP" OFF)

#------------------------------------------------------------------------------
# Profiling options
Expand Down
4 changes: 2 additions & 2 deletions cmake/SeracConfigHeader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ message(STATUS "Configuring Serac version ${SERAC_VERSION_FULL}")
#------------------------------------------------------------------------------
# Create variable for every TPL
#------------------------------------------------------------------------------
set(TPL_DEPS ADIAK AXOM CALIPER CAMP CONDUIT CUDA FMT HDF5 LUA MFEM MPI PETSC RAJA SLEPC STRUMPACK SUNDIALS TRIBOL UMPIRE)
set(TPL_DEPS ADIAK AXOM CALIPER CAMP CONDUIT CUDA FMT HDF5 HIP LUA MFEM MPI PETSC RAJA SLEPC STRUMPACK SUNDIALS TRIBOL UMPIRE)
foreach(dep ${TPL_DEPS})
if( ${dep}_FOUND OR ENABLE_${dep} )
set(SERAC_USE_${dep} TRUE)
Expand All @@ -60,7 +60,7 @@ endif()
# General Build Info
#------------------------------------------------------------------------------
serac_convert_to_native_escaped_file_path(${PROJECT_SOURCE_DIR} SERAC_REPO_DIR)
serac_convert_to_native_escaped_file_path(${CMAKE_BINARY_DIR} SERAC_BIN_DIR)
serac_convert_to_native_escaped_file_path(${CMAKE_BINARY_DIR} SERAC_BINARY_DIR)

#------------------------------------------------------------------------------
# Create Config Header
Expand Down
5 changes: 4 additions & 1 deletion cmake/serac-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ if(NOT SERAC_FOUND)
#----------------------------------------------------------------------------

set(SERAC_ENABLE_CODEVELOP @SERAC_ENABLE_CODEVELOP@)
set(SERAC_ENABLE_CUDA @ENABLE_CUDA@)
set(SERAC_ENABLE_CUDA @SERAC_ENABLE_CUDA@)
set(SERAC_ENABLE_HIP @SERAC_ENABLE_HIP@)
set(SERAC_ENABLE_MPI @SERAC_ENABLE_MPI@)
set(SERAC_ENABLE_OPENMP @SERAC_ENABLE_OPENMP@)

set(SERAC_USE_ADIAK @SERAC_USE_ADIAK@)
set(SERAC_USE_AXOM @SERAC_USE_AXOM@)
Expand Down
2 changes: 1 addition & 1 deletion cmake/thirdparty/FindMFEM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ else()
list(APPEND MFEM_LIBRARIES ${mfem_tpl_lnk_flags})

if(mfem_cfg_file_txt MATCHES "MFEM_USE_CUDA += YES")
if(NOT ENABLE_CUDA)
if(NOT SERAC_ENABLE_CUDA)
message(WARNING "MFEM was built with CUDA but CUDA is not enabled")
endif()
list(APPEND MFEM_INCLUDE_DIRS ${CUDA_INCLUDE_DIRS})
Expand Down
37 changes: 24 additions & 13 deletions cmake/thirdparty/SetupSeracThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
#------------------------------------------------------------------------------
# CUDA
#------------------------------------------------------------------------------
if(ENABLE_CUDA)
if(SERAC_ENABLE_CUDA)
# Manually set includes as system includes
foreach(_target cuda_runtime cuda)
get_target_property(_dirs ${_target} INTERFACE_INCLUDE_DIRECTORIES)
Expand All @@ -37,6 +37,17 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)

include(CMakeFindDependencyMacro)

#------------------------------------------------------------------------------
# Create global variable to toggle between GPU targets
#------------------------------------------------------------------------------
if(SERAC_ENABLE_CUDA)
set(serac_device_depends blt::cuda CACHE STRING "" FORCE)
elseif(SERAC_ENABLE_HIP)
set(serac_device_depends blt::hip CACHE STRING "" FORCE)
else()
set(serac_device_depends "" CACHE STRING "" FORCE)
endif()

#------------------------------------------------------------------------------
# Camp
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -206,27 +217,27 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
#### MFEM "Use" Options

# Assumes that we have AMGX if we have CUDA
set(MFEM_USE_AMGX ${ENABLE_CUDA} CACHE BOOL "")
set(MFEM_USE_AMGX ${SERAC_ENABLE_CUDA} CACHE BOOL "")
set(MFEM_USE_CALIPER ${CALIPER_FOUND} CACHE BOOL "")
# We don't use MFEM's Conduit/Axom support
set(MFEM_USE_CONDUIT OFF CACHE BOOL "")
set(MFEM_USE_CUDA ${ENABLE_CUDA} CACHE BOOL "")
set(MFEM_USE_CUDA ${SERAC_ENABLE_CUDA} CACHE BOOL "")
set(MFEM_USE_LAPACK ON CACHE BOOL "")
# mfem+mpi requires metis
set(MFEM_USE_METIS ${ENABLE_MPI} CACHE BOOL "")
set(MFEM_USE_METIS_5 ${ENABLE_MPI} CACHE BOOL "")
set(MFEM_USE_MPI ${ENABLE_MPI} CACHE BOOL "")
set(MFEM_USE_METIS ${SERAC_ENABLE_MPI} CACHE BOOL "")
set(MFEM_USE_METIS_5 ${SERAC_ENABLE_MPI} CACHE BOOL "")
set(MFEM_USE_MPI ${SERAC_ENABLE_MPI} CACHE BOOL "")
if(NETCDF_DIR)
serac_assert_is_directory(DIR_VARIABLE NETCDF_DIR)
set(MFEM_USE_NETCDF ON CACHE BOOL "")
endif()
# mfem+mpi also needs parmetis
if(ENABLE_MPI)
if(SERAC_ENABLE_MPI)
serac_assert_is_directory(DIR_VARIABLE PARMETIS_DIR)
# Slightly different naming convention
set(ParMETIS_DIR ${PARMETIS_DIR} CACHE PATH "")
endif()
set(MFEM_USE_OPENMP ${ENABLE_OPENMP} CACHE BOOL "")
set(MFEM_USE_OPENMP ${SERAC_ENABLE_OPENMP} CACHE BOOL "")

if(PETSC_DIR)
set(MFEM_USE_PETSC ON CACHE BOOL "")
Expand All @@ -248,7 +259,7 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
serac_assert_is_directory(DIR_VARIABLE SUPERLUDIST_DIR)
# MFEM uses a slightly different naming convention
set(SuperLUDist_DIR ${SUPERLUDIST_DIR} CACHE PATH "")
set(MFEM_USE_SUPERLU ${ENABLE_MPI} CACHE BOOL "")
set(MFEM_USE_SUPERLU ${SERAC_ENABLE_MPI} CACHE BOOL "")
endif()
if(STRUMPACK_DIR)
serac_assert_is_directory(DIR_VARIABLE STRUMPACK_DIR)
Expand Down Expand Up @@ -429,7 +440,7 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
target_link_libraries(sidre PUBLIC STRUMPACK::strumpack)
endif()

if(ENABLE_OPENMP)
if(SERAC_ENABLE_OPENMP)
target_link_libraries(core INTERFACE blt::openmp)
endif()

Expand Down Expand Up @@ -461,8 +472,8 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
set(ENABLE_FORTRAN OFF CACHE BOOL "" FORCE)
# Otherwise we use the submodule
message(STATUS "Using Tribol submodule")
set(BUILD_REDECOMP ${ENABLE_MPI} CACHE BOOL "")
set(TRIBOL_USE_MPI ${ENABLE_MPI} CACHE BOOL "")
set(BUILD_REDECOMP ${SERAC_ENABLE_MPI} CACHE BOOL "")
set(TRIBOL_USE_MPI ${SERAC_ENABLE_MPI} CACHE BOOL "")
set(TRIBOL_ENABLE_TESTS OFF CACHE BOOL "")
set(TRIBOL_ENABLE_EXAMPLES OFF CACHE BOOL "")
set(TRIBOL_ENABLE_DOCS OFF CACHE BOOL "")
Expand Down Expand Up @@ -594,7 +605,7 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
# Should this logic be in the Caliper CMake package?
# If CMake version doesn't support CUDAToolkit the libraries
# are just "baked in"
if(ENABLE_CUDA)
if(SERAC_ENABLE_CUDA)
if(CMAKE_VERSION VERSION_LESS 3.17)
message(FATAL_ERROR "Serac+Caliper+CUDA requires CMake > 3.17.")
else()
Expand Down
Loading