Skip to content

Commit

Permalink
chore: Update blt, RAJA, CHAI, Caliper, adiak, conduit (#3218)
Browse files Browse the repository at this point in the history
* update blt to 0.6.2

* update RAJA and CHAI to v2024.02.2

* update Caliper to 2.11.0

*update adiak to 0.4.0

* update conduit to 0.9.2

* change to new HDF import. use umpires fmt and add extra dependency to executable

* changes for change in raja interface

* move src/coreComponents/unitTests/dataRepository/testPacking.cpp to src/coreComponents/dataRepository/unitTests

* switched to syncronous packing/upacking to avoid test failures on CI image running on streak
  • Loading branch information
rrsettgast authored Jul 17, 2024
1 parent 9a144b8 commit 5fe43d6
Show file tree
Hide file tree
Showing 32 changed files with 119 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
"GEOS_TPL_TAG": "273-460"
"GEOS_TPL_TAG": "275-480"
}
},
"runArgs": [
Expand Down
2 changes: 1 addition & 1 deletion host-configs/apple/darwin-clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(ENABLE_OPENMP "OFF" CACHE PATH "" FORCE)

set(ENABLE_CALIPER "OFF" CACHE PATH "" FORCE )

set(GEOSX_BUILD_OBJ_LIBS ON CACHE BOOL "" FORCE)
#set(GEOSX_BUILD_OBJ_LIBS ON CACHE BOOL "" FORCE)

set( BLAS_LIBRARIES /usr/local/opt/openblas/lib/libblas.dylib CACHE PATH "" FORCE )
set( LAPACK_LIBRARIES /usr/local/opt/openblas/lib/liblapack.dylib CACHE PATH "" FORCE )
Expand Down
4 changes: 3 additions & 1 deletion host-configs/tpls.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ if(EXISTS ${GEOSX_TPL_DIR}/vtk)
endif()

if(EXISTS ${GEOSX_TPL_DIR}/fmt)
set(FMT_DIR ${GEOSX_TPL_DIR}/fmt CACHE PATH "" FORCE)
# set(FMT_DIR ${GEOSX_TPL_DIR}/fmt CACHE PATH "" FORCE)
set(FMT_DIR ${GEOSX_TPL_DIR}/chai CACHE PATH "" FORCE)
# /Users/settgast1/Codes/geos/thirdPartyLibs/install-macOS_arm-release/chai/lib/cmake/fmt/fmt-targets.cmake
endif()

#
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_build_and_test_in_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,4 @@ if [[ ! -z "${INTEGRATED_TEST_EXIT_STATUS+x}" ]]; then
else
echo "Exiting the build process with exit status 0."
exit 0
fi
fi
13 changes: 9 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,21 @@ endif()
blt_add_executable( NAME geosx
SOURCES main/main.cpp
DEPENDS_ON ${extraComponentsLinkList}
${externalComponentsLinkList} )
${externalComponentsLinkList} fmt::fmt-header-only HDF5::HDF5 )

# blt_print_target_properties(TARGET geosx
# CHILDREN TRUE
# PROPERTY_NAME_REGEX "LINK_LIBRARIES"
# )

# blt_print_target_properties(TARGET HDF5::HDF5
# CHILDREN TRUE )

# Seems to be required on some CMake versions (e.g. 3.16) to get enforce device linking
if( ${ENABLE_HYPRE_DEVICE} STREQUAL "CUDA" )
set_target_properties( geosx PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS TRUE )
endif()

# Removing all transitive link dependencies from geosx_core target to circumvent
# the BLT behavior which imposes all dependencies to be public
#set_target_properties(geosx_core PROPERTIES INTERFACE_LINK_LIBRARIES "")

target_include_directories( geosx PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents )

Expand Down
2 changes: 1 addition & 1 deletion src/cmake/blt
Submodule blt updated 188 files
27 changes: 0 additions & 27 deletions src/cmake/thirdparty/FindHDF5.cmake

This file was deleted.

28 changes: 9 additions & 19 deletions src/cmake/thirdparty/SetupGeosxThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -216,27 +216,16 @@ endif()
if(DEFINED HDF5_DIR)
message(STATUS "HDF5_DIR = ${HDF5_DIR}")

set(HDF5_ROOT ${HDF5_DIR})
set(HDF5_USE_STATIC_LIBRARIES FALSE)
set(HDF5_NO_FIND_PACKAGE_CONFIG_FILE ON)
include(FindHDF5)

# On some platforms (Summit) HDF5 lists /usr/include in it's list of include directories.
# When this happens you can get really opaque include errors.
list(REMOVE_ITEM HDF5_INCLUDE_DIRS /usr/include)

blt_import_library(NAME hdf5
INCLUDES ${HDF5_INCLUDE_DIRS}
LIBRARIES ${HDF5_LIBRARIES}
TREAT_INCLUDES_AS_SYSTEM ON)
find_package(HDF5 REQUIRED
PATHS ${HDF5_DIR}
NO_DEFAULT_PATH)

file(READ "${HDF5_DIR}/include/H5public.h" header_file )
string(REGEX MATCH "version: *([0-9]+.[0-9]+.[0-9]+)" _ ${header_file})
set( HDF5_VERSION "${CMAKE_MATCH_1}" CACHE STRING "" FORCE )
message( " ----> HDF5 version ${HDF5_VERSION}")

blt_convert_to_system_includes(TARGET HDF5::HDF5)

set(ENABLE_HDF5 ON CACHE BOOL "")
set(thirdPartyLibs ${thirdPartyLibs} hdf5)
set(thirdPartyLibs ${thirdPartyLibs} HDF5::HDF5 )
else()
mandatory_tpl_doesnt_exist("hdf5" HDF5_DIR)
endif()
Expand All @@ -252,7 +241,7 @@ if(DEFINED SILO_DIR AND ENABLE_SILO)
LIBRARY_DIRECTORIES ${SILO_DIR}/lib
HEADER silo.h
LIBRARIES siloh5
DEPENDS hdf5)
DEPENDS HDF5::HDF5 )


set(ENABLE_SILO ON CACHE BOOL "")
Expand Down Expand Up @@ -344,7 +333,7 @@ endif()
if(DEFINED FMT_DIR)
message(STATUS "FMT_DIR = ${FMT_DIR}")

find_package(fmt REQUIRED
find_package(FMT REQUIRED
PATHS ${FMT_DIR}
NO_DEFAULT_PATH)

Expand All @@ -356,6 +345,7 @@ if(DEFINED FMT_DIR)
APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
${includeDirs})


set(ENABLE_FMT ON CACHE BOOL "")

set(thirdPartyLibs ${thirdPartyLibs} fmt::fmt-header-only )
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if( GEOSX_BUILD_SHARED_LIBS AND GEOSX_BUILD_OBJ_LIBS )
message( "Building shared geosx_core library with object coreComponents, executables link to geosx_core" )
blt_add_library ( NAME geosx_core
SOURCES dummy.cpp
DEPENDS_ON mainInterface physicsSolvers
DEPENDS_ON mainInterface physicsSolvers HDF5::HDF5
SHARED TRUE )

elseif( GEOSX_BUILD_SHARED_LIBS AND NOT GEOSX_BUILD_OBJ_LIBS )
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/LvArray
4 changes: 2 additions & 2 deletions src/coreComponents/common/GEOS_RAJA_Interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ struct PolicyMap< RAJA::omp_parallel_for_exec >
#endif

#if defined(GEOS_USE_CUDA)
template< typename X, typename Y, size_t BLOCK_SIZE, bool ASYNC >
struct PolicyMap< RAJA::policy::cuda::cuda_exec_explicit< X, Y, BLOCK_SIZE, ASYNC > >
template< typename X, typename Y, typename C, size_t BLOCK_SIZE, bool ASYNC >
struct PolicyMap< RAJA::policy::cuda::cuda_exec_explicit< X, Y, C, BLOCK_SIZE, ASYNC > >
{
using atomic = RAJA::cuda_atomic;
using reduce = RAJA::cuda_reduce;
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/common/unitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if ( ENABLE_CALIPER )
testCaliperSmoke.cpp )
endif()

set( dependencyList ${parallelDeps} common hdf5 gtest )
set( dependencyList ${parallelDeps} common HDF5::HDF5 gtest )

# Add gtest C++ based tests
foreach(test ${gtest_geosx_tests})
Expand Down
4 changes: 2 additions & 2 deletions src/coreComponents/common/unitTests/testLifoStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ struct RAJAHelper< parallelHostPolicy >
template< unsigned long THREADS_PER_BLOCK >
using devicePolicy = RAJA::cuda_exec< THREADS_PER_BLOCK >;

template< typename X, typename Y, size_t BLOCK_SIZE, bool ASYNC >
struct RAJAHelper< RAJA::policy::cuda::cuda_exec_explicit< X, Y, BLOCK_SIZE, ASYNC > >
template< typename X, typename Y, typename C, size_t BLOCK_SIZE, bool ASYNC >
struct RAJAHelper< RAJA::policy::cuda::cuda_exec_explicit< X, Y, C, BLOCK_SIZE, ASYNC > >
{
using ReducePolicy = RAJA::cuda_reduce;
using AtomicPolicy = RAJA::cuda_atomic;
Expand Down
18 changes: 10 additions & 8 deletions src/coreComponents/dataRepository/BufferOpsDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ template< bool DO_PACKING, typename T, int NDIM, int USD >
typename std::enable_if< can_memcpy< T >, localIndex >::type
PackDataDevice( buffer_unit_type * & buffer,
ArrayView< T const, NDIM, USD > const & var,
parallelDeviceEvents & events )
parallelDeviceEvents & GEOS_UNUSED_PARAM( events ) )
{
if( DO_PACKING )
{
parallelDeviceStream stream;
events.emplace_back( forAll< parallelDeviceAsyncPolicy<> >( stream, var.size(), [=] GEOS_DEVICE ( localIndex ii )
// parallelDeviceStream stream;
// events.emplace_back( forAll< parallelDeviceAsyncPolicy<> >( stream, var.size(), [=] GEOS_DEVICE ( localIndex ii )
forAll< parallelDevicePolicy<> >( var.size(), [=] GEOS_DEVICE ( localIndex ii )
{
reinterpret_cast< std::remove_const_t< T > * >( buffer )[ ii ] = var.data()[ ii ];
} ) );
} );
}
localIndex packedSize = var.size() * sizeof(T);
if( DO_PACKING )
Expand All @@ -121,13 +122,14 @@ template< typename T, int NDIM, int USD >
typename std::enable_if< can_memcpy< T >, localIndex >::type
UnpackDataDevice( buffer_unit_type const * & buffer,
ArrayView< T, NDIM, USD > const & var,
parallelDeviceEvents & events )
parallelDeviceEvents & GEOS_UNUSED_PARAM( events ) )
{
parallelDeviceStream stream;
events.emplace_back( forAll< parallelDeviceAsyncPolicy<> >( stream, var.size(), [=] GEOS_DEVICE ( localIndex ii )
// parallelDeviceStream stream;
// events.emplace_back( forAll< parallelDeviceAsyncPolicy<> >( stream, var.size(), [=] GEOS_DEVICE ( localIndex ii )
forAll< parallelDevicePolicy<> >( var.size(), [=] GEOS_DEVICE ( localIndex ii )
{
var.data()[ ii ] = reinterpret_cast< const T * >( buffer )[ ii ];
} ) );
} );
localIndex packedSize = var.size() * sizeof(T);
buffer += var.size() * sizeof(T);
return packedSize;
Expand Down
1 change: 1 addition & 0 deletions src/coreComponents/dataRepository/unitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Specify list of tests
set( dataRepository_tests
testDefaultValue.cpp
testPacking.cpp
testWrapper.cpp
testXmlWrapper.cpp
testBufferOps.cpp )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
#include "LvArray/src/Array.hpp"
#include "dataRepository/BufferOps.hpp"
#include "dataRepository/BufferOpsDevice.hpp"
#include "mainInterface/initialization.hpp"
#include "mesh/mpiCommunications/CommunicationTools.hpp"

#include "dataRepository/wrapperHelpers.hpp"

#include <ctime>
#include <cstdlib>
#include <unistd.h>

using namespace geos;

Expand Down Expand Up @@ -116,6 +114,32 @@ TEST( testPacking, testTensorPacking )
EXPECT_TRUE( tns[0][ii] = unp[0][ii] );
}

// void printArray( arrayView1d< R1Tensor const > const & arr,
// arrayView1d< R1Tensor const > const & unpackArray )
// {
// printf( "arr.size() = %d\n", arr.size() );
// printf( "unpackArray.size() = %d\n", unpackArray.size() );

// for( localIndex ii = 0; ii < unpackArray.size(); ++ii )
// {
// if( !( arr[ii] == unpackArray[ii] ) )
// {
// printf( "arr[%d] = ( %f, %f, %f )\n", ii, arr[ii][0], arr[ii][1], arr[ii][2] );
// printf( "unPackarray[%d] = ( %f, %f, %f ) : ", ii, unpackArray[ii][0], unpackArray[ii][1], unpackArray[ii][2] );

// forAll< geos::parallelDevicePolicy<1> >( 1, [=] GEOS_DEVICE ( localIndex )
// {
// printf( "( %f, %f, %f ) : ", unpackArray[ii][0], unpackArray[ii][1], unpackArray[ii][2] );
// } );

// forAll< serialPolicy >( 1, [=]( localIndex )
// {
// printf( "( %f, %f, %f )\n", unpackArray[ii][0], unpackArray[ii][1], unpackArray[ii][2] );
// } );
// }
// }
// }

TEST( testPacking, testPackingDevice )
{
std::srand( std::time( nullptr ));
Expand All @@ -134,15 +158,32 @@ TEST( testPacking, testPackingDevice )
buffer_type buf( calc_size );
buffer_unit_type * buffer = &buf[0];
bufferOps::PackDevice< true >( buffer, veloc.toViewConst(), packEvents );
waitAllDeviceEvents( packEvents );
// waitAllDeviceEvents( packEvents );

// R1Tensor const * const castedBuffer = reinterpret_cast< R1Tensor const * >( &buf[16] );
// for( localIndex ii = 0; ii < size; ++ii )
// {
// printf( " %d = ( %f, %f, %f ) != ( %f, %f, %f )\n", ii, veloc[ii][0], veloc[ii][1], veloc[ii][2], castedBuffer[ii][0],
// castedBuffer[ii][1], castedBuffer[ii][2] );
// }

buffer_unit_type const * cbuffer = &buf[0];
parallelDeviceEvents unpackEvents;
bufferOps::UnpackDevice( cbuffer, unpacked.toView(), unpackEvents );
waitAllDeviceEvents( unpackEvents );
unpacked.move( hostMemorySpace );

// printArray( veloc, unpacked.toViewConst() );

for( localIndex ii = 0; ii < size; ++ii )
{
EXPECT_EQ( veloc[ii], unpacked[ii] );
// if( !(veloc[ii] == unpacked[ii]) )
// {
// printf( " veloc[%d] = ( %f, %f, %f )\n", ii, veloc[ii][0], veloc[ii][1], veloc[ii][2] );
// printf( " unpacked[%d] = ( %f, %f, %f )\n", ii, unpacked[ii][0], unpacked[ii][1], unpacked[ii][2] );
// }
}
}

TEST( testPacking, testPackingDeviceHelper )
Expand Down Expand Up @@ -221,8 +262,6 @@ TEST( testPacking, testPackByIndexDevice )
int main( int ac, char * av[] )
{
::testing::InitGoogleTest( &ac, av );
geos::basicSetup( ac, av );
int const result = RUN_ALL_TESTS();
geos::basicCleanup();
return result;
}
6 changes: 3 additions & 3 deletions src/coreComponents/fileIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set( fileIO_sources
timeHistory/PackCollection.cpp
timeHistory/HDFHistoryIO.cpp )

set( dependencyList ${parallelDeps} mesh constitutive hdf5 )
set( dependencyList ${parallelDeps} mesh constitutive HDF5::HDF5 )
if( ENABLE_PYGEOSX )
list( APPEND fileIO_headers
python/PyHistoryCollectionType.hpp
Expand All @@ -50,13 +50,13 @@ endif()

if( ENABLE_MPI )
add_subdirectory( coupling/hdf5_interface )
list( APPEND dependencyList mpi hdf5_interface )
list( APPEND dependencyList mpi hdf5_interface HDF5::HDF5 )
list( APPEND fileIO_headers coupling/ChomboCoupler.hpp Outputs/ChomboIO.hpp )
list( APPEND fileIO_sources coupling/ChomboCoupler.cpp Outputs/ChomboIO.cpp )
endif()

if( ENABLE_SILO )
list( APPEND dependencyList silo )
list( APPEND dependencyList silo HDF5::HDF5)
list( APPEND fileIO_headers
silo/SiloFile.hpp
Outputs/SiloOutput.hpp )
Expand Down
2 changes: 1 addition & 1 deletion src/coreComponents/fileIO/coupling/hdf5_interface
Submodule hdf5_interface updated 1 files
+1 −1 CMakeLists.txt
4 changes: 2 additions & 2 deletions src/coreComponents/unitTests/constitutiveTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ set( gtest_reactivefluid_xmls
set( dependencyList ${parallelDeps} gtest )

if ( GEOSX_BUILD_SHARED_LIBS )
list( APPEND dependencyList geosx_core )
list( APPEND dependencyList geosx_core HDF5::HDF5 )
else()
list( APPEND dependencyList ${geosx_core_libs} )
list( APPEND dependencyList ${geosx_core_libs} HDF5::HDF5 )
endif()

if( ENABLE_PVTPackage )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ set( dataRepository_tests
testObjectCatalog.cpp
testRestartBasic.cpp
testRestartExtended.cpp
testPacking.cpp
testWrapperHelpers.cpp
testGroupPath.cpp )

set( dependencyList ${parallelDeps} gtest )

if ( GEOSX_BUILD_SHARED_LIBS )
list( APPEND dependencyList geosx_core )
list( APPEND dependencyList geosx_core HDF5::HDF5 )
else()
list( APPEND dependencyList ${geosx_core_libs} )
list( APPEND dependencyList ${geosx_core_libs} HDF5::HDF5 )
endif()

if (TARGET pugixml::pugixml)
Expand Down
Loading

0 comments on commit 5fe43d6

Please sign in to comment.