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

GPU Evaluate Derivatives #235

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
feffbf6
Adding RAJA, CHAI, Umpire and Camp and TPLs. test_cuda_launch using c…
mdavis36 Jul 12, 2022
5bb4392
Adding camp.cmake.
mdavis36 Jul 13, 2022
eedb71e
Static RAJA and Chai.
mdavis36 Jul 13, 2022
b896f0e
Merge branch 'develop' into feature/raja-suite-tpls
mdavis36 Jul 26, 2022
be17764
Update release notes for RAJA Protability suite PR.
mdavis36 Jul 26, 2022
e743c69
Using RAJA atomics for SPH evaluate derivatives
mdavis36 Sep 13, 2022
b297f15
Merge branch 'develop' into feature/raja-atomics
mdavis36 Oct 24, 2022
c126af2
Merge branch 'feature/adiak-metadata' into feature/raja-atomics
mdavis36 Oct 27, 2022
05b6b83
Report failed build
mdavis36 Oct 27, 2022
5eb54b7
Move string include out of guarded scope
mdavis36 Oct 28, 2022
5334ff5
when:always
mdavis36 Oct 28, 2022
bdf6bd3
Move camp before raja; link new camp lib.
mdavis36 Nov 4, 2022
c308ca8
Updating camp and raja spack scripts with the most recent implmenetat…
mdavis36 Nov 4, 2022
29b9cb2
HOST_DEVICE signatures everywhere
mdavis36 Nov 4, 2022
4c7e7f6
spheral_cuda_test cuda atomics w/ GeomVector.
mdavis36 Nov 4, 2022
545012e
Merge branch 'feature/adiak-metadata' into feature/raja-atomics
mdavis36 Nov 7, 2022
4960781
Fixing clang build; Desul need the gcc toolchain specified and this c…
mdavis36 Nov 8, 2022
5911dee
Possibly fixing strange spheral_cuda_test link bug.
mdavis36 Nov 8, 2022
9e1cdc2
Fix spheral_cuda_test
mdavis36 Nov 8, 2022
1b14ee7
Object libs CUDA_RESOLVE_DEVICE_SYMBOLS.
mdavis36 Nov 8, 2022
5607121
Adding mini app of EvalDerivs pair algorithm. Runs on CPU and GPU w/ …
mdavis36 Nov 10, 2022
1a06149
Cleanup and only use chai::ManagedArray
mdavis36 Nov 11, 2022
ce40b84
Performance improvements.
mdavis36 Nov 11, 2022
e42f1e6
test sizes
mdavis36 Nov 11, 2022
ad5040e
fixing packages so lvarray will work w/ raja+desul; adding lvarray tpl
mdavis36 Nov 17, 2022
e8a5fcd
Merge branch 'develop' into research/EvalDeriv-GPU-Execution-Model
mdavis36 Jan 4, 2023
909fc5e
raja @ 2022.10.4; SPHEvalDeriv Test using lvarray arrays and views di…
mdavis36 Jan 8, 2023
7b8935c
Using test Field class and FIeldView Class with internal LvArray cont…
mdavis36 Jan 9, 2023
e52e1d0
FieldList with LvArray implementation and proper chai data migration …
mdavis36 Jan 11, 2023
48f9fc2
Cleanup and comments.
mdavis36 Jan 11, 2023
9bc53a9
Pair data uses lvField class.
mdavis36 Jan 11, 2023
1922da4
Move LvField classes into separate header.
mdavis36 Jan 11, 2023
7496d11
const memory management, making test eval derivs look more like spher…
mdavis36 Jan 11, 2023
e66d33e
Atomics solution for complex multi data class types.
mdavis36 Jan 17, 2023
691d9ff
Adding GeomVectorAtomic type.
mdavis36 Jan 18, 2023
590636f
Coupling field pools and fields within a fieldview. FieldLists can ac…
mdavis36 Jan 18, 2023
329af03
Pooling fields are no longer constrained to n_blocks; Massive CUDA sp…
mdavis36 Jan 18, 2023
4000584
Fixing python spheral_cuda_test
mdavis36 Jan 19, 2023
541130f
Field uses LvArray under the hood; Using Spheral::Field directly in t…
mdavis36 Jan 19, 2023
bae187d
Guard non cuda build
mdavis36 Jan 20, 2023
f608042
lvarray rpath.
mdavis36 Jan 20, 2023
ffe327f
Launch caller only moves data if compiling with GPU support.
mdavis36 Jan 20, 2023
df1e14c
Removing references to FieldListBase class from State classes
mdavis36 Jan 24, 2023
2fe98f6
Removing mFieldBasePtrs from FieldList; Removing base_begin/end itera…
mdavis36 Jan 24, 2023
956d8e5
evalDeriv test program uses Spheral::FieldView.
mdavis36 Jan 24, 2023
e620dea
std::min_element.
mdavis36 Jan 30, 2023
f80742b
-g flag for debug builds...
mdavis36 Feb 2, 2023
3029d79
Spheral::FieldList LvArray Conversion; SphArrayIterator; FieldView ca…
mdavis36 Feb 2, 2023
173b6fd
SphArrayFieldIterator for the python interface FieldList iterator.
mdavis36 Feb 3, 2023
2f50285
Removing FieldView python intreface methods; comment cleanup and reve…
mdavis36 Feb 3, 2023
7e9b428
Completely remove FieldView from the Python interface, should probabl…
mdavis36 Feb 3, 2023
bdd8eec
Remove Field forwarding functions from FieldView.
mdavis36 Feb 3, 2023
82a99b4
Squash warnings from SPHEvalDerivTest
mdavis36 Feb 3, 2023
a883c0d
Merge branch 'feature/adiak-metadata' into research/EvalDeriv-GPU-Exe…
mdavis36 Jul 11, 2023
732d56d
Disable DBC in GeomTensorInline constructors.
mdavis36 Jul 11, 2023
d87db27
prefix variable that will use atomic operations w/ a_*
mdavis36 Jul 11, 2023
ceeb643
Using Spheral::FieldList in EvalDerivTest.
mdavis36 Jul 12, 2023
b1538cc
Adding Spheral::FieldListView; Using FieldListView in test app; Integ…
mdavis36 Jul 14, 2023
555a727
Remove temporary pre-processor guards
mdavis36 Jul 17, 2023
a4d1444
SPHERAL_ABS using axom::utilities::abs
mdavis36 Jul 17, 2023
a836722
SphArray for nodepair list; Some device compilable geometry functions…
mdavis36 Jul 17, 2023
b4c0bc1
toView for NodePairList.
mdavis36 Jul 18, 2023
7598e0b
Partial SPH evalDerivs running on the GPU...
mdavis36 Jul 18, 2023
27b9458
Messing with pairAccelerations
mdavis36 Jul 21, 2023
ad49cef
Making GeomSymTensor device capable; Need to figure out how to pass s…
mdavis36 Aug 15, 2023
40e454f
QuadraticInterpolator Device conversion; QInt C++ test.
mdavis36 Aug 15, 2023
b1b0eba
Making Table Kernel device capable; Move guards in evaluate derivs pa…
mdavis36 Aug 15, 2023
1a6a119
Fix DBC Cmake flag
mdavis36 Aug 22, 2023
3b16dc2
Include desul library for linking.
mdavis36 Aug 22, 2023
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 RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Notable changes include:
* ATS bumped to version 7.0.9 for blueos smpi option support.
* Eigen bumped to 3.4.0 for NVCC compatiblity.
* C++ flag suppression is gaurded with build time CMake generators to only apply to C++ compilers.
* Adding RAJA, CAMP, Umpire and CHAI as dependencies of Spheral.
* Python runtime libraries are now managed through Spack / tpl-manager.
* Added ENABLE_NAN_EXCEPTIONS (default OFF) Cmake flag to raise an exception when a NAN occurs (Gnu only).
* Byte-compiling python installed in virtual spheral environment.
Expand Down
2 changes: 1 addition & 1 deletion cmake/CMakeDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option(ENABLE_NAN_EXCEPTIONS "Raise an excpetion when a NAN occurs (Gnu only)" O
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- building Debug")
add_definitions("-DDEBUG=1")
if (NOT DBC_MODE)
if (NOT DEFINED DBC_MODE)
set(DBC_MODE "All")
endif()
else()
Expand Down
10 changes: 9 additions & 1 deletion cmake/Compilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ option(ENABLE_UNUSED_VARIABLE_WARNINGS "show unused variable compiler warnings"
option(ENABLE_UNUSED_PARAMETER_WARNINGS "show unused parameter warnings" OFF)
option(ENABLE_MISSING_INCLUDE_DIR_WARNINGS "show unused parameter warnings" ON)

if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif()

set(CXX_WARNING_FLAGS "")
if (ENABLE_WARNINGS)
Expand Down Expand Up @@ -48,7 +52,11 @@ if (NOT ENABLE_MISSING_INCLUDE_DIR_WARNINGS)
endif()
message("-- Compiler missing include dir warnings ${ENABLE_MISSING_INCLUDE_DIR_WARNINGS}")

set(CUDA_WARNING_FLAGS -Xcudafe=\"--diag_suppress=esa_on_defaulted_function_ignored\")
set(CUDA_WARNING_FLAGS )
# Suppress Eigen warnings.
list(APPEND CUDA_WARNING_FLAGS -Xcudafe=\"--diag_suppress=esa_on_defaulted_function_ignored\")
# Suppress: warning: a __device__ function("Spheral::X") redeclared with __host__ __device__, hence treated as a __host__ __device__ function
list(APPEND CUDA_WARNING_FLAGS -Xcudafe=\"--diag_suppress=3148\")

add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${CXX_WARNING_FLAGS}>")
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:${CUDA_WARNING_FLAGS}>")
Expand Down
6 changes: 6 additions & 0 deletions cmake/InstallTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ Spheral_Handle_TPL(boost spheral_depends cxx)
Spheral_Handle_TPL(eigen spheral_depends cxx)
Spheral_Handle_TPL(qhull spheral_depends cxx)
Spheral_Handle_TPL(silo spheral_depends cxx)
Spheral_Handle_TPL(conduit spheral_depends cxx)
Spheral_Handle_TPL(camp spheral_depends cxx)
Spheral_Handle_TPL(raja spheral_depends cxx)
Spheral_Handle_TPL(chai spheral_depends cxx)
Spheral_Handle_TPL(umpire spheral_depends cxx)
Spheral_Handle_TPL(lvarray spheral_depends cxx)

# AXOM PUlls in HDF5 and Conduit for us
#Spheral_Handle_TPL(conduit spheral_depends cxx)
Expand Down
31 changes: 16 additions & 15 deletions cmake/SetupSpheral.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@ if (NOT SPHERAL_CMAKE_MODULE_PATH)
endif()
list(APPEND CMAKE_MODULE_PATH "${SPHERAL_CMAKE_MODULE_PATH}")


#-------------------------------------------------------------------------------#
# Set a default build type if none was specified
#-------------------------------------------------------------------------------#
set(default_build_type "Release")

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build (debug, release, etc)." FORCE)

# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

#-------------------------------------------------------------------------------
# Set Compiler Flags / Options
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -67,27 +82,13 @@ if(ENABLE_OPENMP)
endif()

if(ENABLE_CUDA)
#set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=${CUDA_ARCH} --extended-lambda -Xcudafe --display_error_number")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr --extended-lambda -Xcudafe --display_error_number")
set(CMAKE_CUDA_STANDARD 14)
list(APPEND SPHERAL_CXX_DEPENDS cuda)
endif()

option(BOOST_HEADER_ONLY "only use the header only components of Boost" OFF)

#-------------------------------------------------------------------------------#
# Set a default build type if none was specified
#-------------------------------------------------------------------------------#
set(default_build_type "Release")

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build (debug, release, etc)." FORCE)

# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

#-------------------------------------------------------------------------------
# Should we build sphinx documentation
#-------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions cmake/spheral/SpheralAddLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function(spheral_add_obj_library
)

if(ENABLE_CUDA)
set_target_properties(Spheral_${package_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_target_properties(Spheral_${package_name} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()

# Add this to the obj_libs_list list
Expand Down Expand Up @@ -224,7 +224,7 @@ function(spheral_add_pybind11_library package_name)

# Set the r-path of the C++ lib such that it is independent of the build dir when installed
set_target_properties(${package_name} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${conduit_DIR}/lib;${axom_DIR}/lib;${boost_DIR}/lib;${python_DIR}/lib;${hdf5_DIR}/lib;${zlib_DIR}/lib;${SPHERAL_ADDITIONAL_RPATHS}"
INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${conduit_DIR}/lib;${axom_DIR}/lib;${boost_DIR}/lib;${python_DIR}/lib;${lvarray_DIR}/lib;${hdf5_DIR}/lib;${zlib_DIR}/lib;${SPHERAL_ADDITIONAL_RPATHS}"
)

endfunction()
1 change: 1 addition & 0 deletions cmake/tpl/camp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(${lib_name}_libs libcamp.a)
1 change: 1 addition & 0 deletions cmake/tpl/chai.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(${lib_name}_libs libchai.a)
1 change: 1 addition & 0 deletions cmake/tpl/lvarray.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(${lib_name}_libs liblvarray.so)
1 change: 1 addition & 0 deletions cmake/tpl/raja.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(${lib_name}_libs libRAJA.a libdesul_atomics.a)
1 change: 1 addition & 0 deletions cmake/tpl/umpire.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(${lib_name}_libs libumpire.a)
8 changes: 5 additions & 3 deletions scripts/spack/configs/toss_3_x86_64_ib/compilers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ compilers:
paths:
cc: /usr/tce/packages/clang/clang-9.0.0/bin/clang
cxx: /usr/tce/packages/clang/clang-9.0.0/bin/clang++
f77: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran
fc: /usr/tce/packages/gcc/gcc-8.1.0/bin/gfortran
flags: {}
f77: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran
fc: /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran
flags:
cflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1
cxxflags: --gcc-toolchain=/usr/tce/packages/gcc/gcc-8.3.1
operating_system: rhel7
target: x86_64
modules: []
Expand Down
40 changes: 40 additions & 0 deletions scripts/spack/packages/blt/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *


class Blt(Package):
"""BLT is a streamlined CMake-based foundation for Building, Linking and
Testing large-scale high performance computing (HPC) applications."""

homepage = "https://github.com/LLNL/blt"
url = "https://github.com/LLNL/blt/archive/v0.4.0.tar.gz"
git = "https://github.com/LLNL/blt.git"
tags = ["radiuss"]

maintainers = ["white238", "davidbeckingsale"]

version("develop", branch="develop")
version("main", branch="main")
# Note: 0.4.0+ contains a breaking change to BLT created targets
# if you export targets this could cause problems in downstream
# projects if not handled properly. More info here:
# https://llnl-blt.readthedocs.io/en/develop/tutorial/exporting_targets.html
version("0.5.2", sha256="95b924cfbb2bddd9b1a92e96603b2fd485a19721d59ddf8ff50baefc1714d7ea")
version("0.5.1", sha256="ff7e87eefc48704a0721b66174612b945955adaa0a56aa69dd0473074fa4badf")
version("0.5.0", sha256="5f680ef922d0e0a7ff1b1a5fc8aa107cd4f543ad888cbc9b12639bea72a6ab1f")
version("0.4.1", sha256="16cc3e067ddcf48b99358107e5035a17549f52dcc701a35cd18a9d9f536826c1")
version("0.4.0", sha256="f3bc45d28b9b2eb6df43b75d4f6f89a1557d73d012da7b75bac1be0574767193")
version("0.3.6", sha256="6276317c29e7ff8524fbea47d9288ddb40ac06e9f9da5e878bf9011e2c99bf71")
version("0.3.5", sha256="68a1c224bb9203461ae6f5ab0ff3c50b4a58dcce6c2d2799489a1811f425fb84")
version("0.3.0", sha256="bb917a67cb7335d6721c997ba9c5dca70506006d7bba5e0e50033dd0836481a5")
version("0.2.5", sha256="3a000f60194e47b3e5623cc528cbcaf88f7fea4d9620b3c7446ff6658dc582a5")
version("0.2.0", sha256="c0cadf1269c2feb189e398a356e3c49170bc832df95e5564e32bdbb1eb0fa1b3")

depends_on("cmake", type="run")

def install(self, spec, prefix):
install_tree(".", prefix)
84 changes: 84 additions & 0 deletions scripts/spack/packages/camp/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import glob

from spack.package import *


def hip_repair_options(options, spec):
# there is only one dir like this, but the version component is unknown
options.append(
"-DHIP_CLANG_INCLUDE_PATH="
+ glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0]
)


class Camp(CMakePackage, CudaPackage, ROCmPackage):
"""
Compiler agnostic metaprogramming library providing concepts,
type operations and tuples for C++ and cuda
"""

homepage = "https://github.com/LLNL/camp"
git = "https://github.com/LLNL/camp.git"
url = "https://github.com/LLNL/camp/archive/v0.1.0.tar.gz"

maintainers = ["trws"]

version("main", branch="main", submodules="True")
version("2022.10.0", sha256="3561c3ef00bbcb61fe3183c53d49b110e54910f47e7fc689ad9ccce57e55d6b8")
version("2022.03.2", sha256="bc4aaeacfe8f2912e28f7a36fc731ab9e481bee15f2c6daf0cb208eed3f201eb")
version("2022.03.0", sha256="e9090d5ee191ea3a8e36b47a8fe78f3ac95d51804f1d986d931e85b8f8dad721")
version("0.3.0", sha256="129431a049ca5825443038ad5a37a86ba6d09b2618d5fe65d35f83136575afdb")
version("0.2.3", sha256="58a0f3bd5eadb588d7dc83f3d050aff8c8db639fc89e8d6553f9ce34fc2421a7")
version("0.2.2", sha256="194d38b57e50e3494482a7f94940b27f37a2bee8291f2574d64db342b981d819")
version("0.1.0", sha256="fd4f0f2a60b82a12a1d9f943f8893dc6fe770db493f8fae5ef6f7d0c439bebcc")

# TODO: figure out gtest dependency and then set this default True.
variant("tests", default=False, description="Build tests")
variant("openmp", default=False, description="Build OpenMP support")

depends_on("cub", when="+cuda")

depends_on("blt")

def cmake_args(self):
spec = self.spec

options = []

options.append("-DBLT_SOURCE_DIR={0}".format(spec["blt"].prefix))

options.append("-DENABLE_OPENMP=" + ("On" if "+openmp" in spec else "Off"))
if "+cuda" in spec:
options.extend(
["-DENABLE_CUDA=ON", "-DCUDA_TOOLKIT_ROOT_DIR=%s" % (spec["cuda"].prefix)]
)

if not spec.satisfies("cuda_arch=none"):
cuda_arch = spec.variants["cuda_arch"].value
options.append("-DCMAKE_CUDA_ARCHITECTURES={0}".format(cuda_arch[0]))
options.append("-DCUDA_ARCH=sm_{0}".format(cuda_arch[0]))
flag = "-arch sm_{0}".format(cuda_arch[0])
options.append("-DCMAKE_CUDA_FLAGS:STRING={0}".format(flag))
else:
options.append("-DENABLE_CUDA=OFF")

if "+rocm" in spec:
options.extend(["-DENABLE_HIP=ON", "-DHIP_ROOT_DIR={0}".format(spec["hip"].prefix)])

hip_repair_options(options, spec)

archs = self.spec.variants["amdgpu_target"].value
if archs != "none":
arch_str = ",".join(archs)
options.append("-DHIP_HIPCC_FLAGS=--amdgpu-target={0}".format(arch_str))
else:
options.append("-DENABLE_HIP=OFF")

options.append(self.define_from_variant("ENABLE_TESTS", "tests"))

return options
Loading