Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
86f6622
comment out assert calls which are not constexpr
rrsettgast Mar 16, 2025
5d873d1
make camp more optional
rrsettgast Mar 22, 2025
abed558
some cmake fixes
rrsettgast Mar 29, 2025
9c3f0d0
fixes for absolute paths in aggregateOrSplit.py
rrsettgast Mar 29, 2025
6ff1f74
updated pmpl for data transfer
rrsettgast Apr 7, 2025
e6991d1
Merge branch 'main' into feature/integrationIntoProxySEM
rrsettgast Apr 9, 2025
34c55b6
Merge branch 'feature/integrationIntoProxySEM' of github.com:GEOS-DEV…
rrsettgast Apr 9, 2025
6d655d5
Merge branch 'main' into feature/integrationIntoProxySEM
rrsettgast Apr 10, 2025
0582eed
use html url for submodules to avoid issues TotalEnergies staff were …
rrsettgast May 10, 2025
64a16a7
change looping strategy for jacobian to static
rrsettgast May 20, 2025
8abcdf3
templatize hard coded real types
rrsettgast May 21, 2025
ece7de7
some code review suggestions
rrsettgast Sep 10, 2025
1c19a83
fix bug
rrsettgast Sep 10, 2025
f9232c3
try to fix bug again
rrsettgast Sep 10, 2025
a70ffbe
try to fix bug again
rrsettgast Sep 10, 2025
8b0f231
try to fix bug again
rrsettgast Sep 10, 2025
b9cb71c
try to fix bug again
rrsettgast Sep 10, 2025
7de0c15
cuda/std/tuple workaround and uncrustify
rrsettgast Sep 11, 2025
3b4b89b
try again
rrsettgast Sep 11, 2025
8598f07
try again
rrsettgast Sep 11, 2025
2d82182
remove a bunch of crap...just don't use the bindings for cuda wihtout…
rrsettgast Sep 11, 2025
3cba8eb
add cuda version through cmake
rrsettgast Sep 11, 2025
a34ddcf
try again buddy
rrsettgast Sep 11, 2025
93cd3aa
stop listening to chat
rrsettgast Sep 11, 2025
723a02c
fix some issues
rrsettgast Sep 11, 2025
cbca43c
add maple hostconfig
rrsettgast Sep 11, 2025
85e40e0
some fixes
rrsettgast Sep 12, 2025
28880b2
doxygen
rrsettgast Sep 12, 2025
63d667d
Apply suggestions from code review
rrsettgast Sep 12, 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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "cmake/blt"]
path = cmake/blt
url = ../../LLNL/blt.git
url = https://github.com/LLNL/blt.git
Comment thread
rrsettgast marked this conversation as resolved.
Outdated
[submodule "tpl/camp"]
path = tpl/camp
url = ../../LLNL/camp.git
url = https://github.com/LLNL/camp.git
Comment thread
rrsettgast marked this conversation as resolved.
Outdated
24 changes: 17 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ set( SHIVA_VERSION_PATCHLEVEL 0 )
# check if Shiva is build as a submodule or a separate project
get_directory_property( parent_dir PARENT_DIRECTORY )
if(parent_dir)
set( is_submodule ON )
set( SHIVA_IS_SUBMODULE ON )
else()
set( is_submodule OFF )
set( SHIVA_IS_SUBMODULE OFF )
endif()

if( NOT is_submodule )
if( NOT SHIVA_IS_SUBMODULE )
message( "not a submodule")
project( Shiva LANGUAGES CXX C )

Expand Down Expand Up @@ -66,12 +66,22 @@ include( cmake/Macros.cmake )
include( cmake/Config.cmake )


set(SHIVA_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
set(SHIVA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} )

message( STATUS "SHIVA_BINARY_DIR: ${SHIVA_BINARY_DIR}" )
message( STATUS "SHIVA_SOURCE_DIR: ${SHIVA_SOURCE_DIR}" )


add_subdirectory( src )
add_subdirectory( tpl/camp )
target_compile_options( camp PRIVATE "-Wno-shadow")

configure_file(tpl/camp/include/camp/config.in.hpp
${PROJECT_BINARY_DIR}/include/camp/config.hpp)
if( SHIVA_ENABLE_CAMP )
add_subdirectory( tpl/camp )
target_compile_options( camp PRIVATE "-Wno-shadow")

configure_file(tpl/camp/include/camp/config.in.hpp
${PROJECT_BINARY_DIR}/include/camp/config.hpp)
endif()


if( SHIVA_ENABLE_DOCS )
Expand Down
1 change: 1 addition & 0 deletions cmake/CMakeBasics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS_DEBUG
CLANG "-fstandalone-debug"
)

set( SHIVA_ENABLE_CAMP OFF CACHE BOOL "")

set( CAMP_ENABLE_TESTS OFF CACHE BOOL "")
1 change: 1 addition & 0 deletions cmake/Config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#
set( PREPROCESSOR_DEFINES CUDA
HIP
CAMP
BOUNDS_CHECK
)

Expand Down
2 changes: 2 additions & 0 deletions docs/doxygen/ShivaConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@

/* #undef SHIVA_USE_CALIPER */

/* #undef SHIVA_USE_CAMP */

#define SHIVA_USE_BOUNDS_CHECK
17 changes: 13 additions & 4 deletions scripts/aggregateOrSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ def create_dependency_graph(self, header, include_paths=None):
if include_paths is None:
include_paths = []

header = os.path.abspath(header) # Normalize here

if header in self.dependencies:
return # Already processed

self.dependencies[header] = set()
base_path = os.path.dirname(os.path.abspath(header)) # Base directory of the current header
base_path = os.path.dirname(header) # Base directory of the current header

try:
with open(header, 'r') as file:
Expand All @@ -34,10 +36,10 @@ def create_dependency_graph(self, header, include_paths=None):
included_file = include_match.group(1)

if included_file != self.config_file:
resolved_path = self.resolve_path(
included_file, base_path, include_paths)
resolved_path = self.resolve_path( included_file, base_path, include_paths)

if resolved_path:
resolved_path = os.path.abspath(resolved_path)
self.dependencies[header].add(resolved_path)

if os.path.exists(resolved_path):
Expand Down Expand Up @@ -82,16 +84,21 @@ def resolve_path(self, included_file, base_path, include_paths):

return None # Return None if no resolution was possible


def generate_header_list(self):
remaining_dependencies = self.dependencies.copy()
size_of_remaining_dependencies = len(remaining_dependencies)
unique_files = set() # Track unique files by absolute path

while size_of_remaining_dependencies > 0:
local_included = []

for key in remaining_dependencies:
if len(remaining_dependencies[key]) == 0:
self.included_list.append(key)
abs_key = os.path.abspath(key)
if abs_key not in unique_files:
self.included_list.append(abs_key)
unique_files.add(abs_key)
local_included.append(key)

for included_key in local_included:
Expand All @@ -111,6 +118,7 @@ def process_header(header_path, output):
"""
Processes a single header file, commenting out includes and pragmas.
"""
header_path = os.path.abspath(header_path)
if header_path in self.included:
return # Avoid duplicate processing
self.included.add(header_path)
Expand All @@ -133,6 +141,7 @@ def process_header(header_path, output):

with open(output_file, 'w') as output:
for header in headers:
header = os.path.abspath(header)
self.create_dependency_graph(header, include_paths)

for header in self.dependencies:
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ blt_add_library( NAME shiva

target_include_directories( shiva
INTERFACE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<BUILD_INTERFACE:${SHIVA_BINARY_DIR}/include>
$<BUILD_INTERFACE:${SHIVA_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include> )

install( FILES ${shiva_headers}
Expand Down
2 changes: 2 additions & 0 deletions src/ShivaConfig.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@

#cmakedefine SHIVA_USE_CALIPER

#cmakedefine SHIVA_USE_CAMP

#cmakedefine SHIVA_USE_BOUNDS_CHECK
8 changes: 4 additions & 4 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ blt_add_library( NAME common

target_include_directories( common
INTERFACE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${SHIVA_BINARY_DIR}/include>
$<BUILD_INTERFACE:${SHIVA_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include> )

target_include_directories( common
SYSTEM INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/tpl/camp/include>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/tpl/camp/include> )
$<BUILD_INTERFACE:${SHIVA_SOURCE_DIR}/tpl/camp/include>
$<BUILD_INTERFACE:${SHIVA_BINARY_DIR}/tpl/camp/include> )

install( FILES ${common_headers}
DESTINATION include/common )
Expand Down
3 changes: 2 additions & 1 deletion src/common/pmpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void genericKernelWrapper( LAMBDA && func, bool const abortOnError = true )
#if defined(SHIVA_USE_DEVICE)
// UNCRUSTIFY-OFF
genericKernel <<< 1, 1 >>> ( std::forward< LAMBDA >( func ) );
//UNCRUSTIFY-ON
// UNCRUSTIFY-ON
deviceError_t err = deviceDeviceSynchronize();
if ( err != cudaSuccess )
{
Expand Down Expand Up @@ -157,6 +157,7 @@ void genericKernelWrapper( int const N, DATA_TYPE * const hostData, LAMBDA && fu
#if defined(SHIVA_USE_DEVICE)
DATA_TYPE * deviceData;
deviceMalloc( &deviceData, N * sizeof(DATA_TYPE) );
deviceMemCpy( deviceData, hostData, N * sizeof(DATA_TYPE), cudaMemcpyHostToDevice );
Comment thread
rrsettgast marked this conversation as resolved.
// UNCRUSTIFY-OFF
genericKernel <<< 1, 1 >>> ( std::forward< LAMBDA >( func ), deviceData );
// UNCRUSTIFY-ON
Expand Down
1 change: 0 additions & 1 deletion src/common/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "common/ShivaMacros.hpp"

/// @brief Macro to define whether or not to use camp.
#define SHIVA_USE_CAMP
#if defined(SHIVA_USE_CAMP)
#include <camp/camp.hpp>
#else
Expand Down
12 changes: 6 additions & 6 deletions src/functions/quadrature/Quadrature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ struct QuadratureGaussLegendre : public GaussLegendreSpacing< REAL_TYPE, N >
}
else if constexpr ( N == 3 )
{
assert( index >= 0 && index < 3 );
//assert( index >= 0 && index < 3 );
return 0.5555555555555555555555555555555556 +
0.3333333333333333333333333333333333 * ( index & 1 );
}
else if constexpr ( N == 4 )
{
assert( index >= 0 && index < 4 );
//assert( index >= 0 && index < 4 );
return 0.5 + ( -1 + ( ( ( index + 1 ) & 2 ) ) ) * 0.15214515486254614262693605077800059277;
}
return std::numeric_limits< REAL_TYPE >::max();
Expand Down Expand Up @@ -145,20 +145,20 @@ struct QuadratureGaussLobatto : public GaussLobattoSpacing< REAL_TYPE, N >
}
else if constexpr ( N == 3 )
{
assert( index >= 0 && index < 3 );
//assert( index >= 0 && index < 3 );
return 0.3333333333333333333333333333333333 + ( index & 1 );
}
else if constexpr ( N == 4 )
{
assert( index >= 0 && index < 4 );
//assert( index >= 0 && index < 4 );
return 0.1666666666666666666666666666666667 + ( ((index + 1) & 2) >> 1 ) * 0.6666666666666666666666666666666667;
}
else if constexpr ( N == 5 )
{
assert( index >= 0 && index < 5 );
//assert( index >= 0 && index < 5 );
return 0.1 + (index & 1) * 0.4444444444444444444444444444444444 + !( index - 2 ) * 0.6111111111111111111111111111111111;
}
return std::numeric_limits< REAL_TYPE >::max();
return 0;//std::numeric_limits< REAL_TYPE >::max();
Comment thread
rrsettgast marked this conversation as resolved.
Outdated
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/geometry/mapping/LinearTransform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,19 @@ SHIVA_STATIC_CONSTEXPR_HOSTDEVICE_FORCEINLINE void
jacobian( LinearTransform< REAL_TYPE, INTERPOLATED_SHAPE > const & transform,
typename LinearTransform< REAL_TYPE, INTERPOLATED_SHAPE >::JacobianType & J )
{
using Transform = std::remove_reference_t< decltype(transform) >;
using Transform = LinearTransform< REAL_TYPE, INTERPOLATED_SHAPE >;
using InterpolatedShape = typename Transform::InterpolatedShape;
constexpr int DIMS = Transform::numDims;

auto const & nodeCoords = transform.getData();
constexpr double qcoords[3] = { ( QUADRATURE::template coordinate< QA >() )... };
constexpr REAL_TYPE qcoords[3] = { ( QUADRATURE::template coordinate< QA >() )... };

InterpolatedShape::supportLoop( [&] ( auto const ... ic_spIndices ) constexpr
{
constexpr CArrayNd< REAL_TYPE, DIMS > dNadXi = InterpolatedShape::template gradient< decltype(ic_spIndices)::value ... >( qcoords );

// dimensional loop from domain to codomain
#if 0
#if 1
forNestedSequence< DIMS, DIMS >( [&] ( auto const ici, auto const icj ) constexpr
{
constexpr int i = decltype(ici)::value;
Expand Down