Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a1fd3c4
pulling over a working subset of dfem-residual-ex
ebchin Sep 9, 2025
ec9f22e
example and test cleanup
ebchin Sep 10, 2025
4acb25b
update docs
ebchin Sep 10, 2025
37fde7e
formatting and comments
ebchin Sep 10, 2025
7a91d3e
make dfem stuff optional
ebchin Sep 10, 2025
c0fbe8a
fixes with cmake defs
ebchin Sep 11, 2025
dffe8a9
add missing include
ebchin Sep 15, 2025
fa5cfc2
formatting
ebchin Sep 15, 2025
7303822
fix non-gpu examples
ebchin Sep 15, 2025
7a91bfe
more small gpu improvements
ebchin Sep 15, 2025
babf48e
small fixes
ebchin Sep 16, 2025
a24841c
Merge branch 'develop' into feature/dfem-explicit-dynamics-gpu
ebchin Sep 16, 2025
ca17a2c
fix one more cmake var
ebchin Sep 16, 2025
1155eaa
fix for header check
ebchin Sep 17, 2025
3a2ecf9
fix doc issues, enzyme dfem on tioga
ebchin Sep 17, 2025
11bbe9b
let enzyme be turned on
ebchin Sep 17, 2025
e8f58a2
restore host configs; add CI jobs the right way
ebchin Sep 19, 2025
a906b0d
turn off enzyme explicitly in mfem when not used
ebchin Sep 19, 2025
f4d72f7
set enzyme off by default
ebchin Sep 19, 2025
e9b3731
small change
ebchin Sep 19, 2025
39b6759
add SERAC_USE_DFEM
ebchin Sep 19, 2025
02ed2f5
add missing includes
ebchin Sep 19, 2025
c956443
Merge branch 'task/update_tpls_for_enzyme' into feature/dfem-explicit…
ebchin Sep 26, 2025
03bc7c3
cleanup from other PR
ebchin Sep 26, 2025
2cac1bc
turn off enzyme until tpl update
ebchin Sep 26, 2025
d7d564b
fix naming
ebchin Sep 26, 2025
1dbc62b
try residual_vector as a member
ebchin Sep 26, 2025
d459ddf
update comment
ebchin Sep 26, 2025
b59ff75
update tpls
ebchin Sep 26, 2025
72f7b8c
turn off dane llvm codevelop for now
ebchin Sep 28, 2025
02d085e
Merge branch 'develop' into feature/dfem-explicit-dynamics-gpu
ebchin Oct 22, 2025
744de81
Merge branch 'develop' into feature/dfem-explicit-dynamics-gpu
ebchin Nov 7, 2025
4805643
more name changes serac -> smith
ebchin Nov 7, 2025
6f79c54
another name change
ebchin Nov 7, 2025
65eb831
address review comments
ebchin Nov 7, 2025
af85395
try codevelop again
ebchin Nov 7, 2025
4066720
Update cmake/thirdparty/SetupSmithThirdParty.cmake
ebchin Nov 11, 2025
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
12 changes: 11 additions & 1 deletion .gitlab/build_toss4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,24 @@ toss4-llvm_19_1_3-src:
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "dane-toss_4_x86_64_ib-${COMPILER}.cmake"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON -DENABLE_DOCS=OFF -DCMAKE_BUILD_TYPE=Debug"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON -DENABLE_DOCS=OFF -DCMAKE_BUILD_TYPE=Debug -DSMITH_USE_DFEM=ON"
# Only run integration tests on one spec (Disabled until integration tests are reenabled)
# DO_INTEGRATION_TESTS: "yes"
# ALLOC_NODES: "2"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4

toss4-llvm_19_1_3-src-codevelop:
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "dane-toss_4_x86_64_ib-${COMPILER}.cmake"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON -DENABLE_DOCS=OFF -DCMAKE_BUILD_TYPE=Debug -DSMITH_ENABLE_CODEVELOP=ON -DSMITH_USE_DFEM=ON"
EXTRA_BUILD_OPTIONS: "--skip-install"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4

toss4-gcc_13_3_1-src:
variables:
COMPILER: "[email protected]"
Expand Down
31 changes: 16 additions & 15 deletions .gitlab/build_toss4_cray.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,24 @@
# Build jobs

toss4_cray-rocmcc_6_2_1-src:
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}_hip.cmake"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON -DENABLE_DOCS=OFF -DCMAKE_BUILD_TYPE=Debug"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4_cray
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}_hip.cmake"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON -DENABLE_DOCS=OFF -DCMAKE_BUILD_TYPE=Debug"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4_cray

toss4_cray-rocmcc_6_2_1-src-codevelop:
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}_hip.cmake"
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON -DENABLE_DOCS=OFF -DCMAKE_BUILD_TYPE=Debug -DSMITH_ENABLE_CODEVELOP=ON"
EXTRA_BUILD_OPTIONS: "--skip-install"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4_cray
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "tioga-toss_4_x86_64_ib_cray-${COMPILER}_hip.cmake"
# TODO: Add -DSMITH_USE_DFEM=ON when TPLs are updated
EXTRA_CMAKE_OPTIONS: "-DENABLE_BENCHMARKS=ON -DENABLE_DOCS=OFF -DCMAKE_BUILD_TYPE=Debug -DSMITH_ENABLE_CODEVELOP=ON"
EXTRA_BUILD_OPTIONS: "--skip-install"
ALLOC_NODES: "1"
ALLOC_TIME: "30"
extends: .src_build_on_toss4_cray

# NOTE: SPEC should matches specs.json, but devtools and profiling variants removed
toss4_cray-rocmcc_6_2_1-tpl:
Expand Down
1 change: 1 addition & 0 deletions cmake/smith-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if(NOT SMITH_FOUND)
set(SMITH_USE_CALIPER @SMITH_USE_CALIPER@)
set(SMITH_USE_CONDUIT @SMITH_USE_CONDUIT@)
set(SMITH_USE_CONTINUATION @SMITH_USE_CONTINUATION@)
set(SMITH_USE_DFEM @SMITH_USE_DFEM@)
set(SMITH_USE_ENZYME @SMITH_USE_ENZYME@)
set(SMITH_USE_HDF5 @SMITH_USE_HDF5@)
set(SMITH_USE_MFEM @SMITH_USE_MFEM@)
Expand Down
74 changes: 40 additions & 34 deletions cmake/thirdparty/SetupSmithThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,40 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
endif()
message(STATUS "ARPACK support is ${ARPACK_FOUND}")

#------------------------------------------------------------------------------
# Enzyme
#------------------------------------------------------------------------------
if (ENZYME_DIR)
smith_assert_is_directory(DIR_VARIABLE ENZYME_DIR)
set(Enzyme_ROOT ${ENZYME_DIR} CACHE PATH "")
find_dependency(Enzyme REQUIRED)

smith_assert_find_succeeded(PROJECT_NAME Enzyme
TARGET ClangEnzymeFlags
DIR_VARIABLE ENZYME_DIR)

message(STATUS "Checking for Target 'ClangEnzymeFlags' plugin target exists..")
get_target_property(_clangenzyme_opts ClangEnzymeFlags INTERFACE_COMPILE_OPTIONS)
if("${_clangenzyme_opts}" MATCHES "\\$<TARGET_FILE:([^>]+)>")
set(_enzyme_target "${CMAKE_MATCH_1}")

# Check if the extracted target exists
if(TARGET "${_enzyme_target}")
message(STATUS "Found 'ClangEnzymeFlags' plugin target: ${_enzyme_target}")
else()
message(FATAL_ERROR "'ClangEnzymeFlags' plugin target '${_enzyme_target}' referenced in INTERFACE_COMPILE_OPTIONS does not exist.")
endif()
else()
message(STATUS "Skipped check. `ClangEnzymeFlags` target does not reference another target")
endif()

message(STATUS "Enzyme support is ON")
set(ENZYME_FOUND TRUE)
else()
message(STATUS "Enzyme support is OFF")
set(ENZYME_FOUND FALSE)
endif()

#------------------------------------------------------------------------------
# MFEM
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -294,6 +328,12 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
endif()
set(MFEM_USE_UMPIRE OFF CACHE BOOL "")
set(MFEM_USE_ZLIB ON CACHE BOOL "")
if(ENZYME_DIR)
smith_assert_is_directory(DIR_VARIABLE ENZYME_DIR)
set(MFEM_USE_ENZYME ON CACHE BOOL "")
else()
set(MFEM_USE_ENZYME OFF CACHE BOOL "")
endif()

#### MFEM Configuration Options

Expand Down Expand Up @@ -508,40 +548,6 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
set(ENABLE_FORTRAN ON CACHE BOOL "" FORCE)
endif()

#------------------------------------------------------------------------------
# Enzyme
#------------------------------------------------------------------------------
if (ENZYME_DIR)
smith_assert_is_directory(DIR_VARIABLE ENZYME_DIR)
set(Enzyme_ROOT ${ENZYME_DIR} CACHE PATH "")
find_dependency(Enzyme REQUIRED)

smith_assert_find_succeeded(PROJECT_NAME Enzyme
TARGET ClangEnzymeFlags
DIR_VARIABLE ENZYME_DIR)

message(STATUS "Checking for Target 'ClangEnzymeFlags' plugin target exists..")
get_target_property(_clangenzyme_opts ClangEnzymeFlags INTERFACE_COMPILE_OPTIONS)
if("${_clangenzyme_opts}" MATCHES "\\$<TARGET_FILE:([^>]+)>")
set(_enzyme_target "${CMAKE_MATCH_1}")

# Check if the extracted target exists
if(TARGET "${_enzyme_target}")
message(STATUS "Found 'ClangEnzymeFlags' plugin target: ${_enzyme_target}")
else()
message(FATAL_ERROR "'ClangEnzymeFlags' plugin target '${_enzyme_target}' referenced in INTERFACE_COMPILE_OPTIONS does not exist.")
endif()
else()
message(STATUS "Skipped check. `ClangEnzymeFlags` target does not reference another target")
endif()

message(STATUS "Enzyme support is ON")
set(ENZYME_FOUND TRUE)
else()
message(STATUS "Enzyme support is OFF")
set(ENZYME_FOUND FALSE)
endif()

#------------------------------------------------------------------------------
# Tribol
#------------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ add_subdirectory(contact)
# Add the buckling examples
add_subdirectory(buckling)

# Add the explicit dynamics examples
add_subdirectory(explicit)

# Add the uniaxial examples
add_subdirectory(uniaxial)

Expand Down
34 changes: 34 additions & 0 deletions examples/explicit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) Lawrence Livermore National Security, LLC and
# other Smith Project Developers. See the top-level LICENSE file for
# details.
#
# SPDX-License-Identifier: (BSD-3-Clause)

if(SMITH_USE_DFEM)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like SMITH_USE_DFEM isn't associated with any package, but rather its to enable or disable certain tests/ examples. maybe SMITH_ENABLE_DFEM is more appropriate?

i still don't fully understand the difference between dfem and enzyme, so maybe this question doesn't make any sense, but could we use SMITH_USE_ENZYME here?

also last question, could this option be removed once #1477 merges?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this bugged me too. I like SMITH_ENABLE_DFEM more, but it looks so out of place here: https://github.com/LLNL/smith/blob/develop/src/smith/smith_config.hpp.in#L32-L55. Also, we can make it go away once #1477 is merged. Maybe we just keep it as SMITH_USE_DFEM for now and get rid the variable when #1477 merges?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more thoughts:

Re: SMITH_USE_ENZYME, you could use dFEM without Enzyme, so it doesn't quite make sense here.

Also, IMO, using the SMITH_ENABLE_DFEM name would make sense at the CMake level (i.e. do conditional header includes instead of doing a #cmakedefine SMITH_USE_DFEM), but it breaks the header check in CI.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its fine to leave it as is then, and we can remove it later. may be worth creating an issue to track it

set(EXPLICIT_DYNAMICS_EXAMPLES_SOURCES
dfem_gpu.cpp
dfem_force_gpu.cpp
)

foreach(filename ${EXPLICIT_DYNAMICS_EXAMPLES_SOURCES})
get_filename_component(example_name ${filename} NAME_WE)

blt_add_executable(NAME explicit_${example_name}
SOURCES ${filename}
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON smith_physics smith_mesh_utils)

smith_add_example_test(NAME explicit_${example_name}
COMMAND explicit_${example_name}
NUM_MPI_TASKS 4)

endforeach()

install(
FILES
${EXPLICIT_DYNAMICS_EXAMPLES_SOURCES}
DESTINATION
examples/smith/explicit
)

endif()
Loading