diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8ead3e27623..227573cf267 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "GEOS_TPL_TAG": "359-1057" + "GEOS_TPL_TAG": "361-1064" } }, "runArgs": [ diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4b746e51a9a..93d8bf31e42 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -103,7 +103,7 @@ jobs: # frozen at the time the workflow was first triggered, so labels # added after that first run are invisible to re-runs. The curl # call below always returns current state, which is required for - # CI re-runs to pick up newly added labels (e.g. "ci: run CUDA + # CI re-runs to pick up newly added labels (e.g. "ci: run device # builds"). Do not replace with github.event.pull_request.labels. # The Authorization header is required for private repos/forks; # GITHUB_TOKEN is provided automatically to every workflow run. diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 27d9f1f9cdc..1f3e953828d 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -333,7 +333,7 @@ jobs: # - run: sysctl -n machdep.cpu.brand_string - # If the 'ci: run CUDA builds' PR label is found, the cuda jobs run immediately along side linux jobs. + # If the 'ci: run device builds' PR label is found, the CUDA jobs run immediately along side linux jobs. # Note: CUDA jobs should only be run if PR is ready to merge. cuda_builds: name: ${{ matrix.name }} @@ -433,10 +433,57 @@ jobs: NPROC: ${{ matrix.NPROC }} CTEST_PARALLEL_LEVEL: ${{ matrix.CTEST_PARALLEL_LEVEL || matrix.NPROC }} RUNS_ON: ${{ matrix.RUNS_ON }} - REQUIRED_LABEL: "ci: run CUDA builds" + REQUIRED_LABEL: "ci: run device builds" secrets: inherit - # Convenience job - passes when all other jobs have passed (must pass the CUDA jobs). + # If the 'ci: run device builds' PR label is found, the ROCm job runs alongside + # the CPU and CUDA jobs. This is a build-only job, so the runner does not need + # an AMD GPU; the image supplies the amdclang 19/ROCm 6.4.3 toolchain and the + # generated /spack-generated.cmake host-config. + rocm_builds: + name: ${{ matrix.name }} + needs: + - is_not_draft_pull_request + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu 24.04 - amdclang 19 + ROCm 6.4.3 + BUILD_AND_TEST_CLI_ARGS: "--build-exe-only --no-install-schema" + CMAKE_BUILD_TYPE: Release + BUILD_GENERATOR: "--ninja" + DOCKER_REPOSITORY: geosx/ubuntu24.04-amdclang19.0.0-rocm6.4.3 + ENABLE_HYPRE_DEVICE: HIP + ENABLE_HYPRE: ON + ENABLE_HYPREDRV: ON + ENABLE_TRILINOS: OFF + GEOS_ENABLE_BOUNDS_CHECK: OFF + RUNS_ON: streak2 + NPROC: 8 + DOCKER_RUN_ARGS: "--cpus=8 --memory=128g -e ROCM_PATH=/opt/rocm-6.4.3 -e HIP_PATH=/opt/rocm-6.4.3 -v /etc/pki/tls/certs/ca-bundle.crt:/etc/pki/tls/certs/ca-bundle.crt:ro -v /etc/pki/tls/certs/ca-bundle.crt:/certs/ca-bundle.crt:ro" + HOST_CONFIG: /spack-generated.cmake + + uses: ./.github/workflows/build_and_test.yml + with: + BUILD_AND_TEST_CLI_ARGS: ${{ matrix.BUILD_AND_TEST_CLI_ARGS }} + CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }} + BUILD_GENERATOR: ${{ matrix.BUILD_GENERATOR }} + DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }} + DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }} + DOCKER_RUN_ARGS: ${{ matrix.DOCKER_RUN_ARGS }} + ENABLE_HYPRE_DEVICE: ${{ matrix.ENABLE_HYPRE_DEVICE }} + ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }} + ENABLE_HYPREDRV: ${{ matrix.ENABLE_HYPREDRV }} + ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }} + GEOS_ENABLE_BOUNDS_CHECK: ${{ matrix.GEOS_ENABLE_BOUNDS_CHECK }} + HOST_CONFIG: ${{ matrix.HOST_CONFIG }} + NPROC: ${{ matrix.NPROC }} + CTEST_PARALLEL_LEVEL: ${{ matrix.CTEST_PARALLEL_LEVEL || matrix.NPROC }} + RUNS_ON: ${{ matrix.RUNS_ON }} + REQUIRED_LABEL: "ci: run device builds" + secrets: inherit + + # Convenience job - passes when all other jobs have passed (including the GPU jobs). check_that_all_jobs_succeeded: runs-on: ubuntu-22.04 needs: @@ -446,6 +493,7 @@ jobs: - check_code_rules - cpu_builds - cuda_builds + - rocm_builds - run_integrated_tests if: ${{ always() }} steps: @@ -455,6 +503,7 @@ jobs: echo "check_code_style_and_documentation: ${{needs.check_code_style_and_documentation.result}}" echo "cpu_builds: ${{needs.cpu_builds.result}}" echo "cuda_builds: ${{needs.cuda_builds.result}}" + echo "rocm_builds: ${{needs.rocm_builds.result}}" echo "run_integrated_tests: ${{needs.run_integrated_tests.result}} " ${{ needs.if_not_unassigned_pull_request.result == 'success' && @@ -462,5 +511,6 @@ jobs: needs.check_code_style_and_documentation.result == 'success' && needs.cpu_builds.result == 'success' && needs.cuda_builds.result == 'success' && + needs.rocm_builds.result == 'success' && needs.run_integrated_tests.result == 'success' }} diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index 78819e860b8..337212abedb 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr3884-17320-39debdc + baseline: integratedTests/baseline_integratedTests-pr4127-17399-63445db allow_fail: all: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index f01cc4a708d..75cecd23dc1 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,34 +5,48 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). +PR #4127 (2026-08-23) +===================== +Rebaseline five restart checks after the TPL update changed VTK/Scotch mesh partitioning. Global mesh topology and fields are unchanged. + PR #3884 (2026-08-16) +===================== Total stress fix in the thermo-poromechanics model PR #4114 (2026-08-14) +===================== Stop dumping linear systems from ATS decks (`writeLinearSystem` no longer set). That flag is stored in restart files, so `perf_status_test` restartchecks need a new baseline. PR #4088 (2026-07-27) +===================== Fluid reset after convergence failure PR #3972 (2026-07-28) -Well model refactor . Integrated test update due to schema changes +===================== +Well model refactor . Integrated test update due to schema changes PR #3836 (2026-05-20) +===================== Added statistics `Group` objects for each statistics `Task` instance PR #4040 (2026-06-16) +===================== Move relperm driver to use new constitutive driver framework PR #3705 (2026-06-12) +===================== Implement compositional enthalpy model PR #4074 (2026-06-10) +===================== Change triaxial driver to use restart for checks PR #4067 (2026-06-10) +===================== Add Coulomb friction/cohesion input from vtk mesh PR #4068 (2026-06-09) +===================== Add MPI runs for smoke tests with surfaceGenerator PR #4062 (2026-05-26) diff --git a/scripts/runIntegratedTests.sh b/scripts/runIntegratedTests.sh index a549824b19a..aef3010a9f7 100755 --- a/scripts/runIntegratedTests.sh +++ b/scripts/runIntegratedTests.sh @@ -76,7 +76,7 @@ Options: and hdf5 artifact the run produced, and pack the tarball named in develop's .integrated_tests.yaml into .integrated-test-baselines/. Cannot be used with --baselines. - --filter EXPR ATS name filter (tests whose name contains EXPR) + --filter EXPR ATS label filter (tests whose label contains EXPR) --cutoff TIME ATS cutoff (default ${CUTOFF}) --build-dir NAME Build directory name under the repo (default ${BUILD_DIR_NAME}) --no-pull Do not docker pull the image first @@ -671,7 +671,7 @@ else log "Using mounted baselines at /tmp/geos/baselines" fi if [[ -n "${FILTER}" ]]; then - ATS_CMD+=(-f "${FILTER}") + ATS_CMD+=(--ats filter "label.find('${FILTER}') >= 0") fi if [[ ${#EXTRA_ATS_ARGS[@]} -gt 0 ]]; then ATS_CMD+=("${EXTRA_ATS_ARGS[@]}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04ebce29ca6..aa505197086 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,12 @@ cmake_minimum_required( VERSION 3.24 ) -# At the moment we are manually passing the cuda arch flag. -cmake_policy(SET CMP0104 OLD) # when using nvcc populate CMAKE_CUDA_ARCHITECTURES, raise error if we can't +# CUDA architectures are supplied by the host configuration or CI. +cmake_policy(SET CMP0104 NEW) +# BLT 0.6.2 still uses FindCUDA while configuring its CUDA targets. +if(POLICY CMP0146) + cmake_policy(SET CMP0146 OLD) +endif() cmake_policy(SET CMP0074 NEW) # dont ignore _ROOT env vars when searching for packages via find_package() cmake_policy(SET CMP0066 NEW) # use CMAKE__FLAGS_ for try_compile() instead of only CMAKE__FLAGS cmake_policy(SET CMP0056 NEW) # use CMAKE_EXE_LINKER_FLAGS in try_compile() in addition to CMAKE__FLAGS @@ -12,7 +16,7 @@ cmake_policy(SET CMP0056 NEW) # use CMAKE_EXE_LINKER_FLAGS in try_compile() in a ################################ project( geosx LANGUAGES C CXX ) include(GNUInstallDirs) -set( BLT_CXX_STD "c++17" CACHE STRING "Version of C++ standard" ) +set( BLT_CXX_STD "c++20" CACHE STRING "Version of C++ standard" ) if(CMAKE_BUILD_TYPE EQUAL "Debug") set( ENABLE_WARNINGS_AS_ERRORS "OFF" CACHE PATH "") else() @@ -50,6 +54,18 @@ option( ENABLE_BENCHMARKS "Enables benchmarks" ON ) include( cmake/blt/SetupBLT.cmake ) set( BLT_SOURCE_DIR ${PROJECT_SOURCE_DIR}/cmake/blt/ ) +# BLT's bundled GoogleTest currently uses an implicit char8_t-to-char32_t +# conversion that Clang 22 diagnoses as -Wcharacter-conversion. Keep GEOS' +# warnings-as-errors policy intact while limiting the compatibility flag to +# the third-party test target. +if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 22 ) + foreach( _geos_gtest_target gtest gtest_main gmock gmock_main ) + if( TARGET ${_geos_gtest_target} ) + target_compile_options( ${_geos_gtest_target} PRIVATE -Wno-error=character-conversion ) + endif() + endforeach() +endif() + # use, i.e. don't skip the full RPATH for the build tree set( CMAKE_SKIP_BUILD_RPATH FALSE ) @@ -245,7 +261,7 @@ install( FILES ${CMAKE_BINARY_DIR}/schema.xsd ################################ # Add python environment setup ################################ -message(WARNING "Temporarily changing the geosPythonBranch to feature/remove-dndx-detj") +message(STATUS "Using geosPythonPackages branch feature/remove-dndx-detj") set(GEOS_PYTHON_PACKAGES_BRANCH "feature/remove-dndx-detj" CACHE STRING "" FORCE) @@ -321,14 +337,12 @@ endif() if ( ENABLE_ATS ) if (NOT DEFINED ATS_WORKING_DIR) - message( WARNING "ATS_WORKING_DIR is not defined (required for integrated testing system)" ) - message( WARNING "Defaulting to ${CMAKE_BINARY_DIR}/integratedTests/workingDir" ) + message( STATUS "ATS_WORKING_DIR is not defined; defaulting to ${CMAKE_BINARY_DIR}/integratedTests/workingDir" ) set( ATS_WORKING_DIR "${CMAKE_BINARY_DIR}/integratedTests/workingDir" CACHE PATH "") endif() if (NOT DEFINED ATS_BASELINE_DIR) - message( WARNING "ATS_BASELINE_DIR is not defined (required for integrated testing system)" ) - message( WARNING "Defaulting to ${CMAKE_SOURCE_DIR}/../integratedTests" ) + message( STATUS "ATS_BASELINE_DIR is not defined; defaulting to ${CMAKE_SOURCE_DIR}/../integratedTests" ) set( ATS_BASELINE_DIR "${CMAKE_SOURCE_DIR}/../integratedTests" CACHE PATH "") endif() diff --git a/src/cmake/GeosxOptions.cmake b/src/cmake/GeosxOptions.cmake index 3e41db757d2..27c28f9d141 100644 --- a/src/cmake/GeosxOptions.cmake +++ b/src/cmake/GeosxOptions.cmake @@ -150,9 +150,9 @@ option( GEOS_ENABLE_WAVEPROPAGATION "Enables wave propagation physics package" O #message( "SPHINX_FOUND = ${SPHINX_FOUND}" ) #message( "SPHINX_EXECUTABLE = ${SPHINX_EXECUTABLE}" ) -if( NOT BLT_CXX_STD STREQUAL c++17 ) - MESSAGE( FATAL_ERROR "c++17 is NOT enabled. GEOSX requires c++17" ) -endif( NOT BLT_CXX_STD STREQUAL c++17 ) +if( NOT BLT_CXX_STD STREQUAL c++20 ) + MESSAGE( FATAL_ERROR "c++20 is NOT enabled. GEOS requires c++20" ) +endif( NOT BLT_CXX_STD STREQUAL c++20 ) message( "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}" ) @@ -162,6 +162,13 @@ blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS CLANG "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wno-cast-align -Wcast-qual" ) +if( ENABLE_HIP ) + # amdclang compiles C++ sources through the HIP driver. GEOS has existing + # [=] lambdas that implicitly capture this; C++20 diagnoses that pattern. + blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS + CLANG "-Wno-deprecated-this-capture -Wno-unused-parameter -Wno-unused-variable -Wno-unused-lambda-capture -Wno-gpu-maybe-wrong-side" ) +endif() + blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS_DEBUG GNU "-Wno-unused-parameter -Wno-unused-variable" CLANG "-Wno-unused-parameter -Wno-unused-variable -fstandalone-debug" @@ -188,11 +195,17 @@ if (ENABLE_GBENCHMARK) endif() if( GEOS_ENABLE_FPE ) - check_cxx_compiler_flag( "-ffp-exception-behavior=strict" GEOS_CXX_HAS_FP_EXCEPTION_BEHAVIOR_STRICT) - if( GEOS_CXX_HAS_FP_EXCEPTION_BEHAVIOR_STRICT ) - blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS CLANG "-ffp-exception-behavior=strict" ) + # amdclang compiles HIP sources through the CXX driver. The host-only + # floating-point exception flag is rejected for the device compilation. + if( ENABLE_HIP ) + message( STATUS "GEOS_ENABLE_FPE is ON, but HIP builds do not support -ffp-exception-behavior=strict; skipping the flag." ) else() - message( WARNING "GEOS_ENABLE_FPE is ON, but ${CMAKE_CXX_COMPILER_ID} does not support -ffp-exception-behavior=strict." ) + check_cxx_compiler_flag( "-ffp-exception-behavior=strict" GEOS_CXX_HAS_FP_EXCEPTION_BEHAVIOR_STRICT) + if( GEOS_CXX_HAS_FP_EXCEPTION_BEHAVIOR_STRICT ) + blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS CLANG "-ffp-exception-behavior=strict" ) + else() + message( WARNING "GEOS_ENABLE_FPE is ON, but ${CMAKE_CXX_COMPILER_ID} does not support -ffp-exception-behavior=strict." ) + endif() endif() endif() diff --git a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake index eb0fb237187..904e2f7a37b 100644 --- a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake +++ b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake @@ -405,7 +405,7 @@ if(DEFINED UMPIRE_DIR) message( " ----> umpire_VERSION = ${umpire_VERSION}") set(ENABLE_UMPIRE ON CACHE BOOL "") - set(thirdPartyLibs ${thirdPartyLibs} umpire) + set(thirdPartyLibs ${thirdPartyLibs} umpire::umpire) else() mandatory_tpl_doesnt_exist("Umpire" UMPIRE_DIR) endif() @@ -695,7 +695,7 @@ if(DEFINED HYPRE_DIR AND ENABLE_HYPRE) get_filename_component( HYPRE_INSTALL_DIR "${HYPRE_DIR}/../../.." ABSOLUTE ) endif() - set( HYPRE_DEPENDS blas lapack umpire ) + set( HYPRE_DEPENDS blas lapack umpire::umpire ) if( ENABLE_SUPERLU_DIST ) list( APPEND HYPRE_DEPENDS superlu_dist ) endif() diff --git a/src/coreComponents/LvArray b/src/coreComponents/LvArray index 057b1229c4d..61cd9b4ab41 160000 --- a/src/coreComponents/LvArray +++ b/src/coreComponents/LvArray @@ -1 +1 @@ -Subproject commit 057b1229c4d3227971a546b07fdf28bbddf53be6 +Subproject commit 61cd9b4ab41410cbc81692214f01a475a38038f3 diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index d0143b9564b..6926ed2630b 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -90,7 +90,7 @@ set( common_sources Units.cpp ) -set( dependencyList ${parallelDeps} lvarray RAJA chai umpire) +set( dependencyList ${parallelDeps} lvarray RAJA chai umpire::umpire) if (TARGET conduit::conduit) set( dependencyList ${dependencyList} conduit::conduit ) diff --git a/src/coreComponents/common/LifoStorageCuda.hpp b/src/coreComponents/common/LifoStorageCuda.hpp index 22b901a3355..683d258537e 100644 --- a/src/coreComponents/common/LifoStorageCuda.hpp +++ b/src/coreComponents/common/LifoStorageCuda.hpp @@ -165,7 +165,7 @@ class LifoStorageCuda : public LifoStorageCommon< T, INDEX_TYPE > { LIFO_MARK_FUNCTION; // The copy to host will only start when the data is copied on device buffer - baseLifo::m_hostDeque.getStream().wait_for( const_cast< camp::resources::Event * >( &m_pushToDeviceEvents[id] ) ); + baseLifo::m_hostDeque.getStream().wait_for( m_pushToDeviceEvents[id] ); baseLifo::m_hostDeque.emplaceFrontFromBack( m_deviceDeque ); if( baseLifo::m_maxNumberOfBuffers - id > (int)(m_deviceDeque.capacity() + baseLifo::m_hostDeque.capacity()) ) diff --git a/src/coreComponents/common/format/Format.hpp b/src/coreComponents/common/format/Format.hpp index 917efb1e549..910b7aa99fa 100644 --- a/src/coreComponents/common/format/Format.hpp +++ b/src/coreComponents/common/format/Format.hpp @@ -19,9 +19,7 @@ #include #include -#if __cplusplus < 202002L #define GEOS_USE_FMT -#endif #ifdef GEOS_USE_FMT #ifndef FMT_HEADER_ONLY @@ -33,9 +31,6 @@ #include "../include/fmt/ranges.h" #include "../include/fmt/xchar.h" #define GEOS_FMT_NS fmt -#else // use C++20's -#include -#define GEOS_FMT_NS std #endif #ifdef GEOS_USE_FMT @@ -80,6 +75,12 @@ struct fmt::formatter< T, std::enable_if_t< std::is_enum< T >::value > > */ #define GEOS_FMT( msg, ... ) GEOS_FMT_NS::format( msg, __VA_ARGS__ ) +/** + * @brief Interpolate arguments into a run-time format string. + * @param msg the message format string, evaluated at run time + */ +#define GEOS_FMT_RUNTIME( msg, ... ) GEOS_FMT_NS::format( GEOS_FMT_NS::runtime( msg ), __VA_ARGS__ ) + /** * @brief Interpolate arguments into a message format string and write into an output iterator. * @param iter the output iterator to write to @@ -140,18 +141,8 @@ constexpr auto GEOS_FMT_NS::detail::has_const_formatter_impl< GEOS_FMT_NS::forma /** * Evaluates at compile time if a fmt::formatter exists for a given type */ -#if __cplusplus < 202002L -// fmt 11.2: has_formatter() no longer works. The second parameter -// is now Char (not format_context), and the type-trait form is deprecated. template< class T > static constexpr bool has_formatter_v = fmt::is_formattable< fmt::remove_cvref_t< T > >::value; -#else -template< typename T > -concept has_formatter_v = requires ( T& v, std::format_context ctx ) -{ - std::formatter< std::remove_cvref_t< T > >().format( v, ctx ); -}; -#endif namespace geos::format { diff --git a/src/coreComponents/common/format/table/TableData.cpp b/src/coreComponents/common/format/table/TableData.cpp index b9bfc885584..d52dca4ac6e 100644 --- a/src/coreComponents/common/format/table/TableData.cpp +++ b/src/coreComponents/common/format/table/TableData.cpp @@ -148,7 +148,7 @@ TableData2D::TableDataHolder TableData2D::buildTableData( string_view targetUnit for( auto const & columnValue : m_columnValues ) { - tableData1D.headerNames.push_back( GEOS_FMT( columnFmt, columnValue ) ); + tableData1D.headerNames.push_back( GEOS_FMT_RUNTIME( columnFmt, columnValue ) ); } for( auto const & error : *m_errors ) @@ -161,7 +161,7 @@ TableData2D::TableDataHolder TableData2D::buildTableData( string_view targetUnit { stdVector< TableData::CellData > currentRowValues; currentRowValues.reserve( rowMap.size() ); - currentRowValues.push_back( {CellType::Value, GEOS_FMT( rowFmt, rowValue )} ); + currentRowValues.push_back( {CellType::Value, GEOS_FMT_RUNTIME( rowFmt, rowValue )} ); std::set< real64 >::const_iterator columnIt = m_columnValues.begin(); for( auto const & [columnValue, cellValue] : rowMap ) diff --git a/src/coreComponents/common/logger/Logger.hpp b/src/coreComponents/common/logger/Logger.hpp index b23ba87a39d..442dc704d3c 100644 --- a/src/coreComponents/common/logger/Logger.hpp +++ b/src/coreComponents/common/logger/Logger.hpp @@ -189,7 +189,6 @@ { \ if( COND ) \ { \ - GEOS_UNUSED_VAR( GEOS_DETAIL_FIRST_ARG( __VA_ARGS__ ) ); \ constexpr char const * formatString = "***** ERROR\n" \ "***** LOCATION" LOCATION "\n" \ "***** BLOCK: [%u, %u, %u]\n" \ @@ -278,8 +277,6 @@ { \ if( COND ) \ { \ - ::geos::internal::DeviceNullStream __geosNullStream; \ - __geosNullStream << MSG; \ static char const formatString[] = "***** ERROR\n" \ "***** LOCATION" LOCATION "\n" \ "***** BLOCK: [%u, %u, %u]\n" \ diff --git a/src/coreComponents/common/unitTests/testFixedSizeDeque.cpp b/src/coreComponents/common/unitTests/testFixedSizeDeque.cpp index 05293b3fc6c..64ecd05f0db 100644 --- a/src/coreComponents/common/unitTests/testFixedSizeDeque.cpp +++ b/src/coreComponents/common/unitTests/testFixedSizeDeque.cpp @@ -195,7 +195,7 @@ TEST( FixedSizeDequeTest, emplace_and_pop_front_cuda ) for( int i = 0; i < elemCnt; i++ ) array[i] = i + j *maxArray; camp::resources::Event e = deque.emplace_front( array.toSliceConst() ); - stream.wait_for( &e ); + stream.wait_for( e ); if( j+1 < maxArray ) { EXPECT_EQ( false, deque.empty()); diff --git a/src/coreComponents/common/unitTests/testMpiWrapper.cpp b/src/coreComponents/common/unitTests/testMpiWrapper.cpp index 4881093f76d..b3161d9656e 100644 --- a/src/coreComponents/common/unitTests/testMpiWrapper.cpp +++ b/src/coreComponents/common/unitTests/testMpiWrapper.cpp @@ -53,7 +53,7 @@ string reductionTestFailureMsg( PairTestCase< FIRST, SECOND > const & testCase, int rankId, string_view opName ) { - return GEOS_FMT( "Test case '{}', rank {}:\n Error in {} reduction, incorrect first value in pair ({}, {}}).", + return GEOS_FMT( "Test case '{}', rank {}:\n Error in {} reduction, incorrect first value in pair ({}, {}).", testCase.testName, rankId, opName, pair.first, pair.second ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluidBase.cpp b/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluidBase.cpp index 098fcefacad..6eb023e05d9 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluidBase.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/blackOil/BlackOilFluidBase.cpp @@ -255,8 +255,8 @@ void BlackOilFluidBase::checkTablesParameters( real64 const pressure, m_formationVolFactorTables[iph]->checkCoord( pressure, 0 ); } catch( SimulationError const & ex ) { - string const exceptionMsg = GEOS_FMT( errorMsg, getCatalogName(), getDataContext(), - "formation volume factor", iph ); + string const exceptionMsg = GEOS_FMT_RUNTIME( errorMsg, getCatalogName(), getDataContext(), + "formation volume factor", iph ); ErrorLogger::global().modifyCurrentExceptionMessage() .addToMsg( exceptionMsg ) .addContextInfo( getDataContext().getContextInfo().setPriority( 2 ) ); @@ -268,8 +268,8 @@ void BlackOilFluidBase::checkTablesParameters( real64 const pressure, m_viscosityTables[iph]->checkCoord( pressure, 0 ); } catch( SimulationError const & ex ) { - string const exceptionMsg = GEOS_FMT( errorMsg, getCatalogName(), getDataContext(), - "viscosity", iph ); + string const exceptionMsg = GEOS_FMT_RUNTIME( errorMsg, getCatalogName(), getDataContext(), + "viscosity", iph ); ErrorLogger::global().modifyCurrentExceptionMessage() .addToMsg( exceptionMsg ) diff --git a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp index 7355dd8243d..0e3113acf6c 100644 --- a/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp +++ b/src/coreComponents/constitutive/relativePermeability/TableRelativePermeabilityHysteresis.cpp @@ -314,7 +314,7 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateWettingRelPer m_phaseMinVolumeFraction[ipWetting] = drainagePhaseMinVolFraction; - GEOS_LOG_LEVEL_RANK_0( logInfo::Init, GEOS_FMT( "Initializing wetting relperm curve with {(smin,krmin), (simax,krimax), (sdmax,krdmax)} : {({},{}),({},{}),({},{})}", + GEOS_LOG_LEVEL_RANK_0( logInfo::Init, GEOS_FMT( "Initializing wetting relperm curve with {{(smin,krmin), (simax,krimax), (sdmax,krdmax)}} : {{({},{}),({},{}),({},{})}}", m_wettingCurve.m_extremumPhaseVolFraction, m_wettingCurve.m_extremumValue, m_wettingCurve.m_criticalImbibitionPhaseVolFraction, m_wettingCurve.m_criticalImbibitionValue, m_wettingCurve.m_criticalDrainagePhaseVolFraction, m_wettingCurve.m_criticalDrainageValue @@ -360,24 +360,24 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateNonWettingRel imbibitionPhaseRelPermMaxEndPoint ); GEOS_THROW_IF( !isZero ( imbibitionPhaseMaxVolFraction - drainagePhaseMaxVolFraction ), - GEOS_FMT( string( "the maximum non-wetting-phase volume fraction (saturation) must be the same in drainage and imbibition.\n" ) - + string( "However, we found that the drainage maximum wetting-phase volume fraction is {}, " ) - + string( "whereas the imbibition maximum wetting-phase volume fraction is {}" ), - drainagePhaseMaxVolFraction, imbibitionPhaseMaxVolFraction ), + GEOS_FMT_RUNTIME( string( "the maximum non-wetting-phase volume fraction (saturation) must be the same in drainage and imbibition.\n" ) + + string( "However, we found that the drainage maximum wetting-phase volume fraction is {}, " ) + + string( "whereas the imbibition maximum wetting-phase volume fraction is {}" ), + drainagePhaseMaxVolFraction, imbibitionPhaseMaxVolFraction ), InputError, getDataContext() ); GEOS_THROW_IF( !isZero ( imbibitionPhaseRelPermMaxEndPoint - drainagePhaseRelPermMaxEndPoint ), - GEOS_FMT( string( "the non-wetting-phase relperm endpoint must be the same in drainage and imbibition.\n" ) - + string( "However, we found that the drainage endpoint wetting-phase relperm is {}, " ) - + string( "whereas the imbibition endpoint wetting-phase relperm is {}" ), - drainagePhaseRelPermMaxEndPoint, imbibitionPhaseRelPermMaxEndPoint ), + GEOS_FMT_RUNTIME( string( "the non-wetting-phase relperm endpoint must be the same in drainage and imbibition.\n" ) + + string( "However, we found that the drainage endpoint wetting-phase relperm is {}, " ) + + string( "whereas the imbibition endpoint wetting-phase relperm is {}" ), + drainagePhaseRelPermMaxEndPoint, imbibitionPhaseRelPermMaxEndPoint ), InputError, getDataContext() ); GEOS_THROW_IF( imbibitionPhaseMinVolFraction < drainagePhaseMinVolFraction, - GEOS_FMT( string( "the critical wetting-phase volume fraction (saturation) must be larger in imbibition (compared to the drainage value).\n" ) - + string( "However, we found that the drainage critical wetting-phase volume fraction is {}, " ) - + string( "whereas the imbibition critical wetting-phase volume fraction is {}" ), - drainagePhaseMinVolFraction, imbibitionPhaseMinVolFraction ), + GEOS_FMT_RUNTIME( string( "the critical wetting-phase volume fraction (saturation) must be larger in imbibition (compared to the drainage value).\n" ) + + string( "However, we found that the drainage critical wetting-phase volume fraction is {}, " ) + + string( "whereas the imbibition critical wetting-phase volume fraction is {}" ), + drainagePhaseMinVolFraction, imbibitionPhaseMinVolFraction ), InputError, getDataContext() ); } @@ -388,7 +388,7 @@ void TableRelativePermeabilityHysteresis::checkExistenceAndValidateNonWettingRel m_phaseMinVolumeFraction[ipNonWetting] = drainagePhaseMinVolFraction; - GEOS_LOG_LEVEL_RANK_0( logInfo::Init, GEOS_FMT( "Initializing non-wetting relperm curve with {(sdmin,krdmin), (simin,krimin), (smax,krmax)} : {({},{}),({},{}),({},{})}", + GEOS_LOG_LEVEL_RANK_0( logInfo::Init, GEOS_FMT( "Initializing non-wetting relperm curve with {{(sdmin,krdmin), (simin,krimin), (smax,krmax)}} : {{({},{}),({},{}),({},{})}}", m_nonWettingCurve.m_criticalDrainagePhaseVolFraction, m_nonWettingCurve.m_criticalDrainageValue, m_nonWettingCurve.m_criticalImbibitionPhaseVolFraction, m_nonWettingCurve.m_criticalImbibitionValue, m_nonWettingCurve.m_extremumPhaseVolFraction, m_nonWettingCurve.m_extremumValue diff --git a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp index 2126e23da78..dd4b591238c 100644 --- a/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp +++ b/src/coreComponents/constitutiveDrivers/ConstitutiveDriver.cpp @@ -217,7 +217,7 @@ void ConstitutiveDriver::outputToConsole() const { for( integer col = 0; col < numColumns; ++col ) { - tableRow[col].value = GEOS_FMT( format, m_table( step, col ) ); + tableRow[col].value = GEOS_FMT_RUNTIME( format, m_table( step, col ) ); } tableData.addRow( tableRow ); } diff --git a/src/coreComponents/dataRepository/Utilities.cpp b/src/coreComponents/dataRepository/Utilities.cpp index becf93827d8..81c0bd0f969 100644 --- a/src/coreComponents/dataRepository/Utilities.cpp +++ b/src/coreComponents/dataRepository/Utilities.cpp @@ -129,17 +129,17 @@ void printMemoryAllocation( Group const & group, integer const indent, real64 co { indentChars += 3; outputLine += "|--{:.<" + std::to_string( 83-indentChars ) + "} {:>9s} {:>9s} {:>9s}"; - GEOS_LOG_RANK_0( GEOS_FMT( outputLine.c_str(), - "[" + group.getName() + "]", - stringutilities::toMetricPrefixString( groupAllocations[0] ) + 'B', - stringutilities::toMetricPrefixString( groupAllocations[1] ) + 'B', - stringutilities::toMetricPrefixString( groupAllocations[2] ) + 'B' ) ); + GEOS_LOG_RANK_0( GEOS_FMT_RUNTIME( outputLine.c_str(), + "[" + group.getName() + "]", + stringutilities::toMetricPrefixString( groupAllocations[0] ) + 'B', + stringutilities::toMetricPrefixString( groupAllocations[1] ) + 'B', + stringutilities::toMetricPrefixString( groupAllocations[2] ) + 'B' ) ); } else // ...but we still need to output the group name to have a valid tree. { outputLine += "|--[{:<}]"; - GEOS_LOG_RANK_0( GEOS_FMT( outputLine.c_str(), - group.getName() ) ); + GEOS_LOG_RANK_0( GEOS_FMT_RUNTIME( outputLine.c_str(), + group.getName() ) ); } } @@ -159,11 +159,11 @@ void printMemoryAllocation( Group const & group, integer const indent, real64 co } indentChars += 5; outputLine += "| - {:.<" + std::to_string( 83-indentChars ) + "} {:>9s} {:>9s} {:>9s}"; - GEOS_LOG_RANK_0( GEOS_FMT( outputLine.c_str(), - view.second->getName(), - stringutilities::toMetricPrefixString( allocationReductions( viewCount, 0 ) ) + 'B', - stringutilities::toMetricPrefixString( allocationReductions( viewCount, 1 ) ) + 'B', - stringutilities::toMetricPrefixString( allocationReductions( viewCount, 2 ) ) + 'B' ) ); + GEOS_LOG_RANK_0( GEOS_FMT_RUNTIME( outputLine.c_str(), + view.second->getName(), + stringutilities::toMetricPrefixString( allocationReductions( viewCount, 0 ) ) + 'B', + stringutilities::toMetricPrefixString( allocationReductions( viewCount, 1 ) ) + 'B', + stringutilities::toMetricPrefixString( allocationReductions( viewCount, 2 ) ) + 'B' ) ); } ++viewCount; } diff --git a/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp b/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp index bb3c0182b12..cb199d66e11 100644 --- a/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp +++ b/src/coreComponents/fileIO/vtk/VTKPolyDataWriterInterface.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include // System includes @@ -308,7 +309,9 @@ getWell( WellElementSubRegion const & subRegion, localIndex const numPoints = subRegion.size() > 0 ? subRegion.size() + 1 : 0; points->SetNumberOfPoints( numPoints ); auto cellsArray = vtkSmartPointer< vtkCellArray >::New(); +#if VTK_VERSION_NUMBER < VTK_VERSION_CHECK( 9, 6, 0 ) cellsArray->SetNumberOfCells( subRegion.size() ); +#endif localIndex const numberOfNodesPerElement = subRegion.numNodesPerElement(); GEOS_ERROR_IF_NE( numberOfNodesPerElement, 2 ); stdVector< vtkIdType > connectivity( numberOfNodesPerElement ); @@ -358,7 +361,9 @@ getSurface( FaceElementSubRegion const & subRegion, auto & faceToNodes = faceManager.nodeList(); auto cellArray = vtkSmartPointer< vtkCellArray >::New(); +#if VTK_VERSION_NUMBER < VTK_VERSION_CHECK( 9, 6, 0 ) cellArray->SetNumberOfCells( subRegion.size() ); +#endif stdVector< int > cellTypes; cellTypes.reserve( subRegion.size() ); @@ -599,7 +604,9 @@ static ParticleData getVtkCells( ParticleRegion const & region ) { vtkSmartPointer< vtkCellArray > cellsArray = vtkCellArray::New(); +#if VTK_VERSION_NUMBER < VTK_VERSION_CHECK( 9, 6, 0 ) cellsArray->SetNumberOfCells( region.getNumberOfParticles< ParticleRegion >() ); +#endif stdVector< int > cellType; cellType.reserve( region.getNumberOfParticles< ParticleRegion >() ); diff --git a/src/coreComponents/functions/FunctionBase.hpp b/src/coreComponents/functions/FunctionBase.hpp index 4e921c6f83f..45b6b26faa6 100644 --- a/src/coreComponents/functions/FunctionBase.hpp +++ b/src/coreComponents/functions/FunctionBase.hpp @@ -225,7 +225,7 @@ void FunctionBase::evaluateT( dataRepository::Group const & group, getDataContext() ) ); arrayView1d< real64 const > const scale = m_inputVarScale.toViewConst(); - forAll< POLICY >( set.size(), [=]( localIndex const i ) + forAll< POLICY >( set.size(), [=, this]( localIndex const i ) { localIndex const index = set[i]; real64 input[MAX_VARS]{}; diff --git a/src/coreComponents/integrationTests/meshTests/testElementRegions.cpp b/src/coreComponents/integrationTests/meshTests/testElementRegions.cpp index bc50121e685..1b42720b8bd 100644 --- a/src/coreComponents/integrationTests/meshTests/testElementRegions.cpp +++ b/src/coreComponents/integrationTests/meshTests/testElementRegions.cpp @@ -72,9 +72,9 @@ TEST_P( ElementRegionTestFixture, testVTKImportRegionSyntaxes ) )xml"; - string const xmlInput = GEOS_FMT( pattern, - testMeshDir + "/box_hybrid_mesh.vtu", - testCase.xmlRegions ); + string const xmlInput = GEOS_FMT_RUNTIME( pattern, + testMeshDir + "/box_hybrid_mesh.vtu", + testCase.xmlRegions ); ProblemManager & problem = getGlobalState().getProblemManager(); problem.parseInputString( xmlInput ); diff --git a/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp b/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp index a2f13b88748..be4cd6baf7c 100644 --- a/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp +++ b/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -66,8 +67,8 @@ void TestMeshImport( string const & meshFilePath, V const & validate, string con {} /> )xml"; - string const meshNode = GEOS_FMT( pattern, meshFilePath, useGlobalIdsStr, - fractureName.empty() ? "" : "faceBlocks=\"{" + fractureName + "}\"" ); + string const meshNode = GEOS_FMT_RUNTIME( pattern, meshFilePath, useGlobalIdsStr, + fractureName.empty() ? "" : "faceBlocks=\"{" + fractureName + "}\"" ); xmlWrapper::xmlDocument xmlDocument; xmlDocument.loadString( meshNode ); @@ -188,7 +189,11 @@ class TestFractureImport : public ::testing::Test }; vtkNew< vtkPoints > points; +#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK( 9, 7, 0 ) + points->Reserve( numPoints ); +#else points->Allocate( numPoints ); +#endif for( double const * pointsCoord: pointsCoords ) { points->InsertNextPoint( pointsCoord ); @@ -239,7 +244,11 @@ class TestFractureImport : public ::testing::Test }; vtkNew< vtkPoints > points; +#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK( 9, 7, 0 ) + points->Reserve( numPoints ); +#else points->Allocate( numPoints ); +#endif for( double const * pointsCoord: pointsCoords ) { points->InsertNextPoint( pointsCoord ); diff --git a/src/coreComponents/linearAlgebra/CMakeLists.txt b/src/coreComponents/linearAlgebra/CMakeLists.txt index af5310e79ea..00f692bede0 100644 --- a/src/coreComponents/linearAlgebra/CMakeLists.txt +++ b/src/coreComponents/linearAlgebra/CMakeLists.txt @@ -188,7 +188,7 @@ if( ENABLE_HYPRE ) interfaces/hypre/HypreUtils.cpp interfaces/hypre/HypreVector.cpp ) - list( APPEND tplDependencyList hypre umpire ) + list( APPEND tplDependencyList hypre umpire::umpire ) if( ENABLE_HYPREDRV ) list( APPEND linearAlgebra_headers @@ -256,4 +256,3 @@ if( GEOS_ENABLE_TESTS ) add_subdirectory( unitTests ) add_subdirectory( utilities/unitTests ) endif( ) - diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMatrix.cpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMatrix.cpp index 5369f937f52..89843db1769 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMatrix.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreMatrix.cpp @@ -1361,8 +1361,8 @@ void HypreMatrix::print( std::ostream & os ) const int const numProcs = MpiWrapper::commSize( comm() ); char str[77]; - constexpr char const lineFormat[] = "{:>11}{:>18}{:>18}{:>28.16e}\n"; - constexpr char const headFormat[] = "{:>11}{:>18}{:>18}{:>28}\n"; + static constexpr char const lineFormat[] = "{:>11}{:>18}{:>18}{:>28.16e}\n"; + static constexpr char const headFormat[] = "{:>11}{:>18}{:>18}{:>28}\n"; if( myRank == 0 ) { diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreVector.cpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreVector.cpp index fd253d7a102..02a42271346 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreVector.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreVector.cpp @@ -315,8 +315,8 @@ void HypreVector::print( std::ostream & os ) const int const numProcs = MpiWrapper::commSize( comm() ); char str[77]; - constexpr char const lineFormat[] = "{:>11}{:>18}{:>28.16e}\n"; - constexpr char const headFormat[] = "{:>11}{:>18}{:>28}\n"; + static constexpr char const lineFormat[] = "{:>11}{:>18}{:>28.16e}\n"; + static constexpr char const headFormat[] = "{:>11}{:>18}{:>28}\n"; if( myRank == 0 ) { diff --git a/src/coreComponents/linearAlgebra/multiscale/MultiscalePreconditioner.cpp b/src/coreComponents/linearAlgebra/multiscale/MultiscalePreconditioner.cpp index 107d2cc3477..d61fbd809c7 100644 --- a/src/coreComponents/linearAlgebra/multiscale/MultiscalePreconditioner.cpp +++ b/src/coreComponents/linearAlgebra/multiscale/MultiscalePreconditioner.cpp @@ -42,7 +42,7 @@ void MultiscalePreconditioner< LAI >::printLevelInfo() const constexpr char const headFormat[] = "{:>2} {:>10} {:>12} {:>7} {:>7} {:>7}\n"; std::ostringstream os; - string const header = GEOS_FMT( headFormat, "L", "rows", "entries", "sparse", "nnz/row", "ratio" ); + string const header = GEOS_FMT_RUNTIME( headFormat, "L", "rows", "entries", "sparse", "nnz/row", "ratio" ); os << "\nOperators:\n" << header; os << string( header.length() - 1, '=' ) << "\n"; @@ -56,7 +56,7 @@ void MultiscalePreconditioner< LAI >::printLevelInfo() const globalIndex const nrow = level.matrix->numGlobalRows(); globalIndex const nnz = level.matrix->numGlobalNonzeros(); globalIndex const prevNrow = levelIndex > 0 ? m_levels[levelIndex-1].matrix->numGlobalRows() : nrow; - os << GEOS_FMT( lineFormat, levelIndex, nrow, nnz, real64( nnz ) / ( nrow * nrow ), real64( nnz ) / nrow, real64( prevNrow ) / nrow ); + os << GEOS_FMT_RUNTIME( lineFormat, levelIndex, nrow, nnz, real64( nnz ) / ( nrow * nrow ), real64( nnz ) / nrow, real64( prevNrow ) / nrow ); totalNumRows += nrow; totalNumNonzeros += nnz; @@ -70,9 +70,9 @@ void MultiscalePreconditioner< LAI >::printLevelInfo() const Matrix const & fineMat = *m_levels[0].matrix; constexpr char const compFormat[] = " {:>8} = {:>6.4f}\n"; os << "\nComplexities:\n"; - os << GEOS_FMT( compFormat, "grid", real64( totalNumRows ) / fineMat.numGlobalRows() ); - os << GEOS_FMT( compFormat, "operator", real64( totalNumNonzeros ) / fineMat.numGlobalNonzeros() ); - os << GEOS_FMT( compFormat, "memory", real64( totalMemory ) / fineMat.numGlobalNonzeros() ); + os << GEOS_FMT_RUNTIME( compFormat, "grid", real64( totalNumRows ) / fineMat.numGlobalRows() ); + os << GEOS_FMT_RUNTIME( compFormat, "operator", real64( totalNumNonzeros ) / fineMat.numGlobalNonzeros() ); + os << GEOS_FMT_RUNTIME( compFormat, "memory", real64( totalMemory ) / fineMat.numGlobalNonzeros() ); GEOS_LOG_RANK_0( os.str() ); } diff --git a/src/coreComponents/linearAlgebra/multiscale/mesh/coarsening/SemistructuredPartitioner.cpp b/src/coreComponents/linearAlgebra/multiscale/mesh/coarsening/SemistructuredPartitioner.cpp index e7b58e1c508..ab0ffda585e 100644 --- a/src/coreComponents/linearAlgebra/multiscale/mesh/coarsening/SemistructuredPartitioner.cpp +++ b/src/coreComponents/linearAlgebra/multiscale/mesh/coarsening/SemistructuredPartitioner.cpp @@ -118,8 +118,8 @@ localIndex SemistructuredPartitioner::generate( MeshLevel const & mesh, // Special treatment for ranks that don't have a piece of the mesh if( numCells == 0 ) { - loZIndex = 0; - hiZIndex = -1; + loZIndex.reset( 0 ); + hiZIndex.reset( -1 ); } integer const numCellsZ = hiZIndex - loZIndex + 1; diff --git a/src/coreComponents/linearAlgebra/multiscale/msrsb/MsrsbUtils.cpp b/src/coreComponents/linearAlgebra/multiscale/msrsb/MsrsbUtils.cpp index 3b7d906ab12..081f1c7a489 100644 --- a/src/coreComponents/linearAlgebra/multiscale/msrsb/MsrsbUtils.cpp +++ b/src/coreComponents/linearAlgebra/multiscale/msrsb/MsrsbUtils.cpp @@ -191,7 +191,7 @@ makeSeededPartition( ArrayOfSetsView< localIndex const > const & connectivity, newPart.setValues< parallelHostPolicy >( -1 ); // 2. Assign partitions to the front nodes based on majority among neighbors - RAJA::ReduceSum< parallelHostReduce, localIndex > numAssigned = 0; + RAJA::ReduceSum< parallelHostReduce, localIndex > numAssigned( 0 ); forAll< parallelHostPolicy >( front.size(), [connectivity, supports, numAssigned, front = front.toViewConst(), part = part.toViewConst(), diff --git a/src/coreComponents/linearAlgebra/solvers/KrylovSolver.cpp b/src/coreComponents/linearAlgebra/solvers/KrylovSolver.cpp index 326e09ce347..b4158708a14 100644 --- a/src/coreComponents/linearAlgebra/solvers/KrylovSolver.cpp +++ b/src/coreComponents/linearAlgebra/solvers/KrylovSolver.cpp @@ -95,12 +95,12 @@ void KrylovSolver< VECTOR >::logProgress() const if( iter == 0 ) { GEOS_LOG_RANK_0( GEOS_FMT( "[{}] start iteration", methodName() ) ); - GEOS_LOG_RANK_0( GEOS_FMT( headFormat, "iter", "resid.norm", "conv.rate", "rel.res.norm" ) ); + GEOS_LOG_RANK_0( GEOS_FMT_RUNTIME( headFormat, "iter", "resid.norm", "conv.rate", "rel.res.norm" ) ); } real64 const norm = m_residualNorms[iter]; real64 const relNorm = m_residualNorms[0] > 0.0 ? norm / m_residualNorms[0] : 0.0; real64 const convRate = iter > 0 ? norm / m_residualNorms[iter - 1] : 1.0; - GEOS_LOG_RANK_0( GEOS_FMT( lineFormat, iter, norm, convRate, relNorm ) ); + GEOS_LOG_RANK_0( GEOS_FMT_RUNTIME( lineFormat, iter, norm, convRate, relNorm ) ); } } diff --git a/src/coreComponents/mesh/CMakeLists.txt b/src/coreComponents/mesh/CMakeLists.txt index 65db05207f1..05292a2393b 100644 --- a/src/coreComponents/mesh/CMakeLists.txt +++ b/src/coreComponents/mesh/CMakeLists.txt @@ -264,6 +264,13 @@ install( TARGETS mesh LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) if( ENABLE_VTK ) # Avoid compiling with nvcc which sometimes segfaults in debug set_source_files_properties( generators/VTKMeshGeneratorTools.cpp PROPERTIES LANGUAGE CXX ) + + # GCC 12 incorrectly diagnoses a use-after-free in VTK's header-only DIY + # reduction implementation when the all-to-all calls in this source are + # inlined. Suppress this third-party false positive for this source only. + if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13 ) + set_source_files_properties( generators/VTKMeshGeneratorTools.cpp PROPERTIES COMPILE_OPTIONS "-Wno-use-after-free" ) + endif() endif() if( GEOS_ENABLE_TESTS ) diff --git a/src/coreComponents/mesh/CellElementSubRegion.cpp b/src/coreComponents/mesh/CellElementSubRegion.cpp index 64e82d1da65..3435cbdd775 100644 --- a/src/coreComponents/mesh/CellElementSubRegion.cpp +++ b/src/coreComponents/mesh/CellElementSubRegion.cpp @@ -409,7 +409,7 @@ void CellElementSubRegion::calculateElementGeometricQuantities( NodeManager cons arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const X = nodeManager.referencePosition(); - forAll< parallelHostPolicy >( this->size(), [=] ( localIndex const k ) + forAll< parallelHostPolicy >( this->size(), [=, this] ( localIndex const k ) { calculateElementCenterAndVolume( k, X ); } ); diff --git a/src/coreComponents/mesh/ElementSubRegionBase.hpp b/src/coreComponents/mesh/ElementSubRegionBase.hpp index 3af0767c53b..81fae19c6a2 100644 --- a/src/coreComponents/mesh/ElementSubRegionBase.hpp +++ b/src/coreComponents/mesh/ElementSubRegionBase.hpp @@ -277,7 +277,7 @@ class ElementSubRegionBase : public ObjectManagerBase arrayView2d< real64 > const & elementCenters = m_elementCenter; auto const e2n = toNodesRelation.toViewConst(); - forAll< parallelHostPolicy >( size(), [=]( localIndex const k ) + forAll< parallelHostPolicy >( size(), [=, this]( localIndex const k ) { // collect node coordinates for element k localIndex const numNodes = this->numNodesPerElement( k ); diff --git a/src/coreComponents/mesh/EmbeddedSurfaceNodeManager.cpp b/src/coreComponents/mesh/EmbeddedSurfaceNodeManager.cpp index d8d053b7951..6be18d6eb8a 100644 --- a/src/coreComponents/mesh/EmbeddedSurfaceNodeManager.cpp +++ b/src/coreComponents/mesh/EmbeddedSurfaceNodeManager.cpp @@ -90,7 +90,7 @@ void EmbeddedSurfaceNodeManager::setElementMaps( ElementRegionManager const & el array1d< localIndex > elemsPerNode( numNodes ); // The total number of elements, the sum of elemsPerNode. - RAJA::ReduceSum< parallelHostReduce, localIndex > totalNodeElems = 0; + RAJA::ReduceSum< parallelHostReduce, localIndex > totalNodeElems( 0 ); elementRegionManager. forElementSubRegions< EmbeddedSurfaceSubRegion >( [&elemsPerNode, &totalNodeElems]( EmbeddedSurfaceSubRegion const & subRegion ) diff --git a/src/coreComponents/mesh/EmbeddedSurfaceSubRegion.cpp b/src/coreComponents/mesh/EmbeddedSurfaceSubRegion.cpp index 67ed74c2f87..bb585835c48 100644 --- a/src/coreComponents/mesh/EmbeddedSurfaceSubRegion.cpp +++ b/src/coreComponents/mesh/EmbeddedSurfaceSubRegion.cpp @@ -81,7 +81,7 @@ void EmbeddedSurfaceSubRegion::calculateElementGeometricQuantities( NodeManager FaceManager const & GEOS_UNUSED_PARAM( facemanager ) ) { // loop over the elements - forAll< parallelHostPolicy >( this->size(), [=] ( localIndex const k ) + forAll< parallelHostPolicy >( this->size(), [=, this] ( localIndex const k ) { m_elementVolume[k] = m_elementAperture[k] * m_elementArea[k]; } ); diff --git a/src/coreComponents/mesh/FaceElementSubRegion.cpp b/src/coreComponents/mesh/FaceElementSubRegion.cpp index 877a559633b..0f0f5c62f52 100644 --- a/src/coreComponents/mesh/FaceElementSubRegion.cpp +++ b/src/coreComponents/mesh/FaceElementSubRegion.cpp @@ -236,7 +236,7 @@ void FaceElementSubRegion::calculateElementGeometricQuantities( NodeManager cons { arrayView1d< real64 const > const & faceArea = faceManager.faceArea(); - forAll< parallelHostPolicy >( this->size(), [=] ( localIndex const k ) + forAll< parallelHostPolicy >( this->size(), [=, this] ( localIndex const k ) { calculateSingleElementGeometricQuantities( k, faceArea ); } ); @@ -497,7 +497,7 @@ void fixNeighborMappingsInconsistency( GEOS_MAYBE_UNUSED string const & fracture } else { - GEOS_ERROR_IF( !matchStraight, GEOS_FMT( mappingInconsistency, fractureName ) ); + GEOS_ERROR_IF( !matchStraight, GEOS_FMT_RUNTIME( mappingInconsistency, fractureName ) ); } } } diff --git a/src/coreComponents/mesh/FaceManager.cpp b/src/coreComponents/mesh/FaceManager.cpp index f44527ec227..3aab1cee468 100644 --- a/src/coreComponents/mesh/FaceManager.cpp +++ b/src/coreComponents/mesh/FaceManager.cpp @@ -198,13 +198,13 @@ void FaceManager::setGeometricalRelations( CellBlockManagerABC const & cellBlock { if( faceIndex != -1 ) { - GEOS_ERROR_IF_EQ_MSG( m_toElements.m_toElementRegion( faceIndex, 0 ), -1, GEOS_FMT( err, faceIndex ) ); - GEOS_ERROR_IF_EQ_MSG( m_toElements.m_toElementSubRegion( faceIndex, 0 ), -1, GEOS_FMT( err, faceIndex ) ); - GEOS_ERROR_IF_EQ_MSG( m_toElements.m_toElementIndex( faceIndex, 0 ), -1, GEOS_FMT( err, faceIndex ) ); + GEOS_ERROR_IF_EQ_MSG( m_toElements.m_toElementRegion( faceIndex, 0 ), -1, GEOS_FMT_RUNTIME( err, faceIndex ) ); + GEOS_ERROR_IF_EQ_MSG( m_toElements.m_toElementSubRegion( faceIndex, 0 ), -1, GEOS_FMT_RUNTIME( err, faceIndex ) ); + GEOS_ERROR_IF_EQ_MSG( m_toElements.m_toElementIndex( faceIndex, 0 ), -1, GEOS_FMT_RUNTIME( err, faceIndex ) ); - GEOS_ERROR_IF_NE_MSG( m_toElements.m_toElementRegion( faceIndex, 1 ), -1, GEOS_FMT( err, faceIndex ) ); - GEOS_ERROR_IF_NE_MSG( m_toElements.m_toElementSubRegion( faceIndex, 1 ), -1, GEOS_FMT( err, faceIndex ) ); - GEOS_ERROR_IF_NE_MSG( m_toElements.m_toElementIndex( faceIndex, 1 ), -1, GEOS_FMT( err, faceIndex ) ); + GEOS_ERROR_IF_NE_MSG( m_toElements.m_toElementRegion( faceIndex, 1 ), -1, GEOS_FMT_RUNTIME( err, faceIndex ) ); + GEOS_ERROR_IF_NE_MSG( m_toElements.m_toElementSubRegion( faceIndex, 1 ), -1, GEOS_FMT_RUNTIME( err, faceIndex ) ); + GEOS_ERROR_IF_NE_MSG( m_toElements.m_toElementIndex( faceIndex, 1 ), -1, GEOS_FMT_RUNTIME( err, faceIndex ) ); m_toElements.m_toElementRegion( faceIndex, 1 ) = er; m_toElements.m_toElementSubRegion( faceIndex, 1 ) = esr; @@ -285,7 +285,7 @@ void FaceManager::sortAllFaceNodes( NodeManager const & nodeManager, ElementRegionManager::ElementViewAccessor< arrayView2d< real64 const > > elemCenter = elemManager.constructArrayViewAccessor< real64, 2 >( ElementSubRegionBase::viewKeyStruct::elementCenterString() ); - forAll< parallelHostPolicy >( size(), [=, elemCenter = elemCenter.toNestedViewConst()]( localIndex const faceIndex ) + forAll< parallelHostPolicy >( size(), [=, elemCenter = elemCenter.toNestedViewConst(), this]( localIndex const faceIndex ) { // The face should be connected to at least one element. if( facesToElements( faceIndex, 0 ) < 0 && facesToElements( faceIndex, 1 ) < 0 ) diff --git a/src/coreComponents/mesh/generators/CellBlockUtilities.cpp b/src/coreComponents/mesh/generators/CellBlockUtilities.cpp index f454529f6f4..a2e49f45624 100644 --- a/src/coreComponents/mesh/generators/CellBlockUtilities.cpp +++ b/src/coreComponents/mesh/generators/CellBlockUtilities.cpp @@ -39,7 +39,7 @@ static localIndex getFaceNodesHex( localIndex const faceNum, arraySlice1d< localIndex const, cells::NODE_MAP_USD-1 > const & elemNodes, Span< localIndex > const faceNodes ) { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( nodeCountError, "Hexahedron", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT_RUNTIME( nodeCountError, "Hexahedron", faceNum ) ); switch( faceNum ) { case 0: @@ -92,7 +92,7 @@ static localIndex getFaceNodesHex( localIndex const faceNum, } default: { - GEOS_ERROR( GEOS_FMT( faceIndexError, "Hexahedron", faceNum ) ); + GEOS_ERROR( GEOS_FMT_RUNTIME( faceIndexError, "Hexahedron", faceNum ) ); } } return 4; @@ -106,7 +106,7 @@ static localIndex getFaceNodesWedge( localIndex const faceNum, { case 0: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( nodeCountError, "Wedge", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT_RUNTIME( nodeCountError, "Wedge", faceNum ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[1]; faceNodes[2] = elemNodes[5]; @@ -115,7 +115,7 @@ static localIndex getFaceNodesWedge( localIndex const faceNum, } case 1: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( nodeCountError, "Wedge", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT_RUNTIME( nodeCountError, "Wedge", faceNum ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[2]; faceNodes[2] = elemNodes[3]; @@ -124,7 +124,7 @@ static localIndex getFaceNodesWedge( localIndex const faceNum, } case 2: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT( nodeCountError, "Wedge", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT_RUNTIME( nodeCountError, "Wedge", faceNum ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[4]; faceNodes[2] = elemNodes[2]; @@ -132,7 +132,7 @@ static localIndex getFaceNodesWedge( localIndex const faceNum, } case 3: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT( nodeCountError, "Wedge", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT_RUNTIME( nodeCountError, "Wedge", faceNum ) ); faceNodes[0] = elemNodes[1]; faceNodes[1] = elemNodes[3]; faceNodes[2] = elemNodes[5]; @@ -140,7 +140,7 @@ static localIndex getFaceNodesWedge( localIndex const faceNum, } case 4: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( nodeCountError, "Wedge", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT_RUNTIME( nodeCountError, "Wedge", faceNum ) ); faceNodes[0] = elemNodes[2]; faceNodes[1] = elemNodes[4]; faceNodes[2] = elemNodes[5]; @@ -149,7 +149,7 @@ static localIndex getFaceNodesWedge( localIndex const faceNum, } default: { - GEOS_ERROR( GEOS_FMT( faceIndexError, "Wedge", faceNum ) ); + GEOS_ERROR( GEOS_FMT_RUNTIME( faceIndexError, "Wedge", faceNum ) ); return 0; } } @@ -159,7 +159,7 @@ static localIndex getFaceNodesTet( localIndex const faceNum, arraySlice1d< localIndex const, cells::NODE_MAP_USD-1 > const & elemNodes, Span< localIndex > const faceNodes ) { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT( nodeCountError, "Tetrahedron", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT_RUNTIME( nodeCountError, "Tetrahedron", faceNum ) ); switch( faceNum ) { case 0: @@ -192,7 +192,7 @@ static localIndex getFaceNodesTet( localIndex const faceNum, } default: { - GEOS_ERROR( GEOS_FMT( faceIndexError, "Tetrahedron", faceNum ) ); + GEOS_ERROR( GEOS_FMT_RUNTIME( faceIndexError, "Tetrahedron", faceNum ) ); } } return 3; @@ -206,7 +206,7 @@ static localIndex getFaceNodesPyramid( localIndex const faceNum, { case 0: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT( nodeCountError, "Pyramid", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT_RUNTIME( nodeCountError, "Pyramid", faceNum ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[1]; faceNodes[2] = elemNodes[4]; @@ -214,7 +214,7 @@ static localIndex getFaceNodesPyramid( localIndex const faceNum, } case 1: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( nodeCountError, "Pyramid", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT_RUNTIME( nodeCountError, "Pyramid", faceNum ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[2]; faceNodes[2] = elemNodes[3]; @@ -223,7 +223,7 @@ static localIndex getFaceNodesPyramid( localIndex const faceNum, } case 2: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT( nodeCountError, "Pyramid", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT_RUNTIME( nodeCountError, "Pyramid", faceNum ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[4]; faceNodes[2] = elemNodes[2]; @@ -231,7 +231,7 @@ static localIndex getFaceNodesPyramid( localIndex const faceNum, } case 3: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT( nodeCountError, "Pyramid", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT_RUNTIME( nodeCountError, "Pyramid", faceNum ) ); faceNodes[0] = elemNodes[1]; faceNodes[1] = elemNodes[3]; faceNodes[2] = elemNodes[4]; @@ -239,7 +239,7 @@ static localIndex getFaceNodesPyramid( localIndex const faceNum, } case 4: { - GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT( nodeCountError, "Pyramid", faceNum ) ); + GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 3, GEOS_FMT_RUNTIME( nodeCountError, "Pyramid", faceNum ) ); faceNodes[0] = elemNodes[2]; faceNodes[1] = elemNodes[4]; faceNodes[2] = elemNodes[3]; @@ -247,7 +247,7 @@ static localIndex getFaceNodesPyramid( localIndex const faceNum, } default: { - GEOS_ERROR( GEOS_FMT( faceIndexError, "Pyramid", faceNum ) ); + GEOS_ERROR( GEOS_FMT_RUNTIME( faceIndexError, "Pyramid", faceNum ) ); return 0; } } diff --git a/src/coreComponents/mesh/generators/PrismUtilities.hpp b/src/coreComponents/mesh/generators/PrismUtilities.hpp index da62a4eb648..0ef0ff229cc 100644 --- a/src/coreComponents/mesh/generators/PrismUtilities.hpp +++ b/src/coreComponents/mesh/generators/PrismUtilities.hpp @@ -47,7 +47,7 @@ localIndex getFaceNodesPrism( localIndex const faceNum, { GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( "{}{}", - GEOS_FMT( nodeCountError, N, faceNum ), + GEOS_FMT_RUNTIME( nodeCountError, N, faceNum ), generalMeshErrorAdvice ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[1]; @@ -59,7 +59,7 @@ localIndex getFaceNodesPrism( localIndex const faceNum, { GEOS_ERROR_IF_LT_MSG( faceNodes.size(), N, GEOS_FMT( "{}{}", - GEOS_FMT( nodeCountError, N, faceNum ), + GEOS_FMT_RUNTIME( nodeCountError, N, faceNum ), generalMeshErrorAdvice ) ); faceNodes[0] = elemNodes[0]; for( localIndex i = 1; i < N; ++i ) @@ -72,7 +72,7 @@ localIndex getFaceNodesPrism( localIndex const faceNum, { GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( "{}{}", - GEOS_FMT( nodeCountError, N, faceNum ), + GEOS_FMT_RUNTIME( nodeCountError, N, faceNum ), generalMeshErrorAdvice ) ); faceNodes[0] = elemNodes[0]; faceNodes[1] = elemNodes[N]; @@ -84,7 +84,7 @@ localIndex getFaceNodesPrism( localIndex const faceNum, { GEOS_ERROR_IF_LT_MSG( faceNodes.size(), 4, GEOS_FMT( "{}{}", - GEOS_FMT( nodeCountError, N, faceNum ), + GEOS_FMT_RUNTIME( nodeCountError, N, faceNum ), generalMeshErrorAdvice ) ); faceNodes[0] = elemNodes[faceNum-2]; faceNodes[1] = elemNodes[faceNum-1]; @@ -96,7 +96,7 @@ localIndex getFaceNodesPrism( localIndex const faceNum, { GEOS_ERROR_IF_LT_MSG( faceNodes.size(), N, GEOS_FMT( "{}{}", - GEOS_FMT( nodeCountError, N, faceNum ), + GEOS_FMT_RUNTIME( nodeCountError, N, faceNum ), generalMeshErrorAdvice ) ); for( localIndex i = 0; i < N; ++i ) { diff --git a/src/coreComponents/mesh/generators/VTKSuperCellPartitioning.cpp b/src/coreComponents/mesh/generators/VTKSuperCellPartitioning.cpp index 679cdc95f11..263ee6872cf 100644 --- a/src/coreComponents/mesh/generators/VTKSuperCellPartitioning.cpp +++ b/src/coreComponents/mesh/generators/VTKSuperCellPartitioning.cpp @@ -891,9 +891,8 @@ void validateSuperCellGraph( isolated++; if( isolated <= 5 ) { - pmet_idx_t globalId = localStart + i; GEOS_LOG_RANK( GEOS_FMT( "WARNING: Super-cell {} (global {}) has no neighbors (isolated)", - i, globalId ) ); + i, localStart + i ) ); } } } diff --git a/src/coreComponents/mesh/generators/VTKUtilities.cpp b/src/coreComponents/mesh/generators/VTKUtilities.cpp index 6f82154c03f..e7cc97ac258 100644 --- a/src/coreComponents/mesh/generators/VTKUtilities.cpp +++ b/src/coreComponents/mesh/generators/VTKUtilities.cpp @@ -34,6 +34,16 @@ #include #include #include +#include +#if VTK_VERSION_NUMBER == VTK_VERSION_CHECK( 9, 7, 0 ) +#include +#include +#endif +#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK( 9, 5, 0 ) +#include +#else +#include +#endif #include #include #include @@ -434,18 +444,39 @@ loadMesh( Path const & filePath, // Looking for the _first_ block that matches the requested name. // No check is performed to validate that there is not name duplication. + stdVector< string > deferredBlockNames; + stdVector< vtkSmartPointer< vtkDataSet > > deferredMeshes; for( unsigned int i = 0; i < multiBlockDataSet->GetNumberOfBlocks(); ++i ) { - string const dataSetName = multiBlockDataSet->GetMetaData( i )->Get( multiBlockDataSet->NAME() ); - if( dataSetName == blockName ) + vtkInformation * metadata = multiBlockDataSet->GetMetaData( i ); + vtkDataObject * block = multiBlockDataSet->GetBlock( i ); + bool const hasName = metadata != nullptr && metadata->Has( multiBlockDataSet->NAME() ); + if( hasName ) { - vtkDataObject * block = multiBlockDataSet->GetBlock( i ); - if( block->IsA( "vtkDataSet" ) ) + string const dataSetName = metadata->Get( multiBlockDataSet->NAME() ); + if( dataSetName == blockName && block != nullptr && block->IsA( "vtkDataSet" ) ) + { + return vtkDataSet::SafeDownCast( block ); + } + if( block == nullptr ) { - vtkSmartPointer< vtkDataSet > mesh = vtkDataSet::SafeDownCast( block ); - return mesh; + deferredBlockNames.emplace_back( dataSetName ); } } + if( block != nullptr && block->IsA( "vtkDataSet" ) && !hasName ) + { + deferredMeshes.emplace_back( vtkDataSet::SafeDownCast( block ) ); + } + } + + // VTK 9.7 stores names and external datasets in separate entries. Pair + // the named, empty entries with the non-empty dataset entries in order. + for( std::size_t i = 0; i < deferredBlockNames.size(); ++i ) + { + if( deferredBlockNames[i] == blockName && i < deferredMeshes.size() ) + { + return deferredMeshes[i]; + } } GEOS_ERROR( GEOS_FMT( "Could not find mesh \"{}\" in multi-block vtk file \"{}\".\n{}", blockName, @@ -980,7 +1011,11 @@ static void classifyCellsByDimension( vtkDataSet & mesh, // Single pass: classify and populate for( vtkIdType i = 0; i < numCells; ++i ) { +#if VTK_VERSION_NUMBER >= VTK_VERSION_CHECK( 9, 5, 0 ) + int const dim = vtkCellTypeUtilities::GetDimension( mesh.GetCellType( i ) ); +#else int const dim = vtkCellTypes::GetDimension( mesh.GetCellType( i ) ); +#endif if( dim == 3 ) { cells3DIndices.emplace_back( i ); @@ -1802,6 +1837,48 @@ redistributeByKdTree( vtkDataSet & mesh ) vtkNew< vtkRedistributeDataSetFilter > rdsf; rdsf->SetInputDataObject( &mesh ); rdsf->SetNumberOfPartitions( MpiWrapper::commSize() ); + vtkSmartPointer< vtkMultiProcessController > controller = getController(); + rdsf->SetController( controller ); +#if VTK_VERSION_NUMBER == VTK_VERSION_CHECK( 9, 7, 0 ) + // VTK 9.7 computes its cuts from dataset bounds but balances cell centers. + // Some valid GEOS meshes have cell centers outside those bounds, which makes + // VTK's DIY KdTree abort while building its local histogram. Extend VTK's + // normal inflated domain to include those centers before generating cuts. + vtkNew< vtkCellCenters > cellCenters; + cellCenters->SetInputData( &mesh ); + cellCenters->Update(); + double cellCenterBounds[6]; + cellCenters->GetOutput()->GetBounds( cellCenterBounds ); + vtkBoundingBox localBounds; + localBounds.AddBounds( mesh.GetBounds() ); + if( localBounds.IsValid() ) + { + double constexpr boundingBoxLengthTolerance = 0.01; + double constexpr boundingBoxInflationRatio = 0.01; + double const xInflate = localBounds.GetLength( 0 ) < boundingBoxLengthTolerance + ? boundingBoxLengthTolerance + : boundingBoxInflationRatio * localBounds.GetLength( 0 ); + double const yInflate = localBounds.GetLength( 1 ) < boundingBoxLengthTolerance + ? boundingBoxLengthTolerance + : boundingBoxInflationRatio * localBounds.GetLength( 1 ); + double const zInflate = localBounds.GetLength( 2 ) < boundingBoxLengthTolerance + ? boundingBoxLengthTolerance + : boundingBoxInflationRatio * localBounds.GetLength( 2 ); + localBounds.Inflate( xInflate, yInflate, zInflate ); + } + localBounds.AddBounds( cellCenterBounds ); + double correctedBounds[6]; + double const * correctedBoundsPtr = nullptr; + if( localBounds.IsValid() ) + { + localBounds.GetBounds( correctedBounds ); + correctedBoundsPtr = correctedBounds; + } + auto const cuts = vtkDIYKdTreeUtilities::GenerateCuts( + &mesh, MpiWrapper::commSize(), true, controller, correctedBoundsPtr ); + rdsf->SetUseExplicitCuts( true ); + rdsf->SetExplicitCuts( cuts ); +#endif { // vtkRedistributeDataSetFilter uses VTK's XML writer internally to // serialize datasets exchanged by DIY. The writer may raise floating-point diff --git a/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp b/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp index b4144750e23..f20b84a3cca 100644 --- a/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp +++ b/src/coreComponents/mesh/mpiCommunications/SpatialPartition.cpp @@ -285,7 +285,7 @@ void SpatialPartition::setSizes( real64 const ( &min )[ 3 ], { nbPartitions *= this->m_Partitions( i ); } - GEOS_ERROR_IF_NE_MSG( nbPartitions, m_size, GEOS_FMT( partitionsLogMessage, m_size, nbPartitions ) ); + GEOS_ERROR_IF_NE_MSG( nbPartitions, m_size, GEOS_FMT_RUNTIME( partitionsLogMessage, m_size, nbPartitions ) ); } //get communicator, rank, and coordinates diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp index 41ccbe71b93..ea08eb68627 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp @@ -1844,9 +1844,9 @@ void CompositionalMultiphaseBase::applySourceFluxBC( real64 const time, { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( targetSet.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( bcLogMessage, - getName(), time+dt, fs.getCatalogName(), fs.getName(), - setName, subRegion.getName(), fs.getScale(), numTargetElems ), + GEOS_FMT_RUNTIME( bcLogMessage, + getName(), time+dt, fs.getCatalogName(), fs.getName(), + setName, subRegion.getName(), fs.getScale(), numTargetElems ), fs ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp index 9e40db7e20c..5fd4f484ac6 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM.cpp @@ -1439,9 +1439,9 @@ void CompositionalMultiphaseFVM::applyAquiferBC( real64 const time, { globalIndex const numTargetFaces = MpiWrapper::sum< globalIndex >( stencil.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( faceBcLogMessage, - getName(), time+dt, bc.getCatalogName(), bc.getName(), - setName, faceManager.getName(), bc.getScale(), numTargetFaces ), + GEOS_FMT_RUNTIME( faceBcLogMessage, + getName(), time+dt, bc.getCatalogName(), bc.getName(), + setName, faceManager.getName(), bc.getScale(), numTargetFaces ), bc ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM_IsothermalDirichletFluxComputeKernels.cpp.template b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM_IsothermalDirichletFluxComputeKernels.cpp.template index 002a2c1a3f5..e5cb216831e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM_IsothermalDirichletFluxComputeKernels.cpp.template +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFVM_IsothermalDirichletFluxComputeKernels.cpp.template @@ -30,12 +30,12 @@ namespace geos { template class @NAME@<@FLUID_TYPE@::KernelWrapper, @DirichletFluxPolicy@, @NCOMP@>; - template void @NAME@<@FLUID_TYPE@::KernelWrapper, @DirichletFluxPolicy@, @NCOMP@>:: + template GEOS_HOST_DEVICE void @NAME@<@FLUID_TYPE@::KernelWrapper, @DirichletFluxPolicy@, @NCOMP@>:: computeFlux( localIndex const, typename @NAME@<@FLUID_TYPE@::KernelWrapper, @DirichletFluxPolicy@, @NCOMP@>::StackVariables &, NoOpFunc&& ) const; - template void @NAME@<@FLUID_TYPE@::KernelWrapper, @DirichletFluxPolicy@, @NCOMP@>:: + template GEOS_HOST_DEVICE void @NAME@<@FLUID_TYPE@::KernelWrapper, @DirichletFluxPolicy@, @NCOMP@>:: complete( localIndex const, typename @NAME@<@FLUID_TYPE@::KernelWrapper, @DirichletFluxPolicy@, @NCOMP@>::StackVariables &, NoOpFunc&& ) const; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp index c9a0826da47..1baa3c6565c 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatisticsAggregator.cpp @@ -129,8 +129,8 @@ void StatsAggregator::initStatisticsAggregation( CompositionalMultiphaseBase & s void StatsAggregator::enableRegionStatisticsAggregation() { - auto const registerStats = [=] ( Group & parent, - string const & targetName ) -> RegionStatistics & + auto const registerStats = [=, this] ( Group & parent, + string const & targetName ) -> RegionStatistics & { return parent.registerGroup( targetName, std::make_unique< RegionStatistics >( targetName, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp index 3a948b6fee9..412e1d4e6b4 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp @@ -654,7 +654,7 @@ void FlowSolverBase::updatePorosityAndPermeability( CellElementSubRegion & subRe string const & solidName = subRegion.getReference< string >( viewKeyStruct::solidNamesString() ); CoupledSolidBase & porousSolid = subRegion.template getConstitutiveModel< CoupledSolidBase >( solidName ); - constitutive::ConstitutivePassThru< CoupledSolidBase >::execute( porousSolid, [=, &subRegion] ( auto & castedPorousSolid ) + constitutive::ConstitutivePassThru< CoupledSolidBase >::execute( porousSolid, [=, &subRegion, this] ( auto & castedPorousSolid ) { typename TYPEOFREF( castedPorousSolid ) ::KernelWrapper porousWrapper = castedPorousSolid.createKernelUpdates(); if( m_isFixedStressPoromechanicsUpdate ) @@ -1107,9 +1107,9 @@ void FlowSolverBase::applyFieldValue( real64 const & time_n, if( fs.getLogLevel() >= 1 && m_nonlinearSolverParameters.m_numNewtonIterations == 0 ) { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() ); - GEOS_LOG_RANK_0( GEOS_FMT( logMessage, - getName(), time_n+dt, fs.getCatalogName(), fs.getName(), - setName, targetGroup.getName(), fs.getScale(), numTargetElems ) ); + GEOS_LOG_RANK_0( GEOS_FMT_RUNTIME( logMessage, + getName(), time_n+dt, fs.getCatalogName(), fs.getName(), + setName, targetGroup.getName(), fs.getScale(), numTargetElems ) ); } // Specify the bc value of the field diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp index 1531799faeb..463257b97b9 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ImmiscibleMultiphaseFlow.cpp @@ -946,9 +946,9 @@ void ImmiscibleMultiphaseFlow::applySourceFluxBC( real64 const time, if( fs.getLogLevel() >= 1 && m_nonlinearSolverParameters.m_numNewtonIterations == 0 ) { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( targetSet.size() ); - GEOS_LOG_RANK_0( GEOS_FMT( bcLogMessage, - getName(), time+dt, fs.getCatalogName(), fs.getName(), - setName, subRegion.getName(), fs.getScale(), numTargetElems ) ); + GEOS_LOG_RANK_0( GEOS_FMT_RUNTIME( bcLogMessage, + getName(), time+dt, fs.getCatalogName(), fs.getName(), + setName, subRegion.getName(), fs.getScale(), numTargetElems ) ); } if( targetSet.size() == 0 ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp index 6ba70a82cf5..5f12e310e6a 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/ReactiveCompositionalMultiphaseOBL.cpp @@ -820,9 +820,9 @@ void ReactiveCompositionalMultiphaseOBL::applySourceFluxBC( real64 const time, { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( targetSet.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( bcLogMessage, - getName(), time+dt, fs.getCatalogName(), fs.getName(), - setName, subRegion.getName(), fs.getScale(), numTargetElems ), + GEOS_FMT_RUNTIME( bcLogMessage, + getName(), time+dt, fs.getCatalogName(), fs.getName(), + setName, subRegion.getName(), fs.getScale(), numTargetElems ), fs ); } @@ -1094,9 +1094,9 @@ void ReactiveCompositionalMultiphaseOBL::applyDirichletBC( real64 const time, { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( targetSet.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( bcLogMessage, - getName(), time+dt, fs.getCatalogName(), fs.getName(), - setName, subRegion.getName(), fs.getScale(), numTargetElems ), + GEOS_FMT_RUNTIME( bcLogMessage, + getName(), time+dt, fs.getCatalogName(), fs.getName(), + setName, subRegion.getName(), fs.getScale(), numTargetElems ), fs ); } @@ -1140,9 +1140,9 @@ void ReactiveCompositionalMultiphaseOBL::applyDirichletBC( real64 const time, { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( targetSet.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( bcLogMessage, - getName(), time+dt, fs.getCatalogName(), fs.getName(), - setName, subRegion.getName(), fs.getScale(), numTargetElems ), + GEOS_FMT_RUNTIME( bcLogMessage, + getName(), time+dt, fs.getCatalogName(), fs.getName(), + setName, subRegion.getName(), fs.getScale(), numTargetElems ), fs ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp index 82fd666b07c..cf140d68c07 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp @@ -165,12 +165,12 @@ void SinglePhaseBase::validateConstitutiveModels( DomainPartition & domain ) con { string const fluidModelName = castedFluid.getCatalogName(); GEOS_THROW_IF( m_isThermal && ((fluidModelName != "ThermalCompressibleSinglePhaseFluid") && (fluidModelName != "ReactiveThermalCompressibleSinglePhaseFluid")), - GEOS_FMT( "SingleFluidBase {}: the thermal option is enabled in the solver, but the fluid model {} is not for thermal fluid", - fluid.getName() ), + GEOS_FMT_RUNTIME( "SingleFluidBase {}: the thermal option is enabled in the solver, but the fluid model {} is not for thermal fluid", + fluid.getName() ), InputError, getDataContext(), fluid.getDataContext() ); GEOS_THROW_IF( !m_isThermal && ((fluidModelName == "ThermalCompressibleSinglePhaseFluid") || (fluidModelName == "ReactiveThermalCompressibleSinglePhaseFluid")), - GEOS_FMT( "SingleFluidBase {}: the fluid model is for thermal fluid {}, but the solver option is incompatible with the fluid model", - fluid.getName() ), + GEOS_FMT_RUNTIME( "SingleFluidBase {}: the fluid model is for thermal fluid {}, but the solver option is incompatible with the fluid model", + fluid.getName() ), InputError, getDataContext(), fluid.getDataContext() ); } ); } ); @@ -601,7 +601,7 @@ void SinglePhaseBase::computeHydrostaticEquilibrium( DomainPartition & domain ) RAJA::ReduceMin< parallelHostReduce, real64 > minPressure( LvArray::NumericLimits< real64 >::max ); - forAll< parallelHostPolicy >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const i ) + forAll< parallelHostPolicy >( targetSet.size(), [=, this] GEOS_HOST_DEVICE ( localIndex const i ) { localIndex const k = targetSet[i]; real64 const elevation = elemCenter[k][2]; diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp index b507ea1b22c..c8c54388630 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseFVM.cpp @@ -728,9 +728,9 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n, { globalIndex const numTargetFaces = MpiWrapper::sum< globalIndex >( stencil.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( faceBcLogMessage, - this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), - setName, targetGroup.getName(), numTargetFaces ), + GEOS_FMT_RUNTIME( faceBcLogMessage, + this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), + setName, targetGroup.getName(), numTargetFaces ), fs ); } @@ -764,9 +764,9 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n, if( m_nonlinearSolverParameters.m_numNewtonIterations == 0 ) { globalIndex const numTargetFaces = MpiWrapper::sum< globalIndex >( stencil.size() ); - GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, GEOS_FMT( faceBcLogMessage, - this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), - setName, targetGroup.getName(), numTargetFaces ), + GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, GEOS_FMT_RUNTIME( faceBcLogMessage, + this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), + setName, targetGroup.getName(), numTargetFaces ), fs ); } @@ -786,7 +786,7 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n, } ); - GEOS_ERROR_IF( pressureSets != temperatureSets, GEOS_FMT( incompleteBCLogmessage, this->getName(), time_n + dt ) ); + GEOS_ERROR_IF( pressureSets != temperatureSets, GEOS_FMT_RUNTIME( incompleteBCLogmessage, this->getName(), time_n + dt ) ); // Take BCs defined for "temperature" field and apply values to "faceTemperature" for( auto const & setName : temperatureSets ) @@ -836,9 +836,9 @@ void SinglePhaseFVM< BASE >::applyFaceDirichletBC( real64 const time_n, { globalIndex const numTargetFaces = MpiWrapper::sum< globalIndex >( stencil.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( faceBcLogMessage, - this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), - setName, targetGroup.getName(), numTargetFaces ), + GEOS_FMT_RUNTIME( faceBcLogMessage, + this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), + setName, targetGroup.getName(), numTargetFaces ), fs ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp index fdaf8496edb..868940db670 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseHybridFVM.cpp @@ -384,9 +384,9 @@ void SinglePhaseHybridFVM::applyFaceDirichletBC( real64 const time_n, { globalIndex const numTargetFaces = MpiWrapper::sum< globalIndex >( targetSet.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( faceBcLogMessage, - this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), - setName, targetGroup.getName(), numTargetFaces ), + GEOS_FMT_RUNTIME( faceBcLogMessage, + this->getName(), time_n+dt, fs.getCatalogName(), fs.getName(), + setName, targetGroup.getName(), numTargetFaces ), fs ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp index b5c850662d3..77f4e9b9e96 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseReactiveTransport.cpp @@ -933,9 +933,9 @@ void SinglePhaseReactiveTransport::applySourceFluxBC( real64 const time_n, { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( targetSet.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( bcLogMessage, - getName(), time_n+dt, fs.getCatalogName(), fs.getName(), - setName, subRegion.getName(), fs.getScale(), numTargetElems ), + GEOS_FMT_RUNTIME( bcLogMessage, + getName(), time_n+dt, fs.getCatalogName(), fs.getName(), + setName, subRegion.getName(), fs.getScale(), numTargetElems ), fs ); } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp index d5c0aad8412..3ff6a29ff0e 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseStatisticsAggregator.cpp @@ -53,8 +53,8 @@ StatsAggregator::StatsAggregator( DataContext const & ownerDataContext, void StatsAggregator::enableRegionStatisticsAggregation() { - auto const registerStats = [=] ( Group & parent, - string const & targetName ) -> RegionStatistics & + auto const registerStats = [=, this] ( Group & parent, + string const & targetName ) -> RegionStatistics & { return parent.registerGroup( targetName, std::make_unique< RegionStatistics >( targetName, diff --git a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp index 3087c47b322..ac6f9af7a44 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/proppantTransport/ProppantTransport.cpp @@ -362,7 +362,7 @@ void ProppantTransport::preStepUpdate( real64 const & time, arrayView1d< real64 > const excessPackVolume = subRegion.getField< proppant::proppantExcessPackVolume >(); arrayView2d< real64 > const cellBasedFlux = subRegion.getField< proppant::cellBasedFlux >(); - forAll< parallelDevicePolicy<> >( subRegion.size(), [=] GEOS_HOST_DEVICE ( localIndex const ei ) + forAll< parallelDevicePolicy<> >( subRegion.size(), [=, this] GEOS_HOST_DEVICE ( localIndex const ei ) { for( localIndex c = 0; c < m_numComponents; ++c ) { @@ -778,7 +778,7 @@ void ProppantTransport::applyBoundaryConditions( real64 const time_n, arrayView2d< real64 const > const bcCompConc = subRegion.getReference< array2d< real64 > >( proppant::bcComponentConcentration::key() ); - forAll< parallelDevicePolicy<> >( targetSet.size(), [=] GEOS_HOST_DEVICE ( localIndex const a ) + forAll< parallelDevicePolicy<> >( targetSet.size(), [=, this] GEOS_HOST_DEVICE ( localIndex const a ) { localIndex const ei = targetSet[a]; if( ghostRank[ei] >= 0 ) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 66ad4b387dd..5be94432cd4 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -1408,7 +1408,7 @@ void CompositionalMultiphaseWell::assembleWellAccumulationTerms( real64 const & arrayView1d< integer const > const elemStatus = subRegion.getLocalWellElementStatus(); arrayView1d< real64 > const mixConnRate = subRegion.getField< fields::well::connectionRate >(); localIndex rank_offset = dofManager.rankOffset(); - forAll< parallelDevicePolicy<> >( subRegion.size(), [=] GEOS_HOST_DEVICE ( localIndex const ei ) + forAll< parallelDevicePolicy<> >( subRegion.size(), [=, this] GEOS_HOST_DEVICE ( localIndex const ei ) { if( wellElemGhostRank[ei] < 0 ) { @@ -1442,7 +1442,7 @@ void CompositionalMultiphaseWell::assembleWellAccumulationTerms( real64 const & arrayView1d< real64 > mixConnRate = subRegion.getField< fields::well::connectionRate >(); localIndex rank_offset = dofManager.rankOffset(); - forAll< parallelDevicePolicy<> >( subRegion.size(), [=] GEOS_HOST_DEVICE ( localIndex const ei ) + forAll< parallelDevicePolicy<> >( subRegion.size(), [=, this] GEOS_HOST_DEVICE ( localIndex const ei ) { if( wellElemGhostRank[ei] < 0 ) { diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp index 7da4cd4d891..4c8f82a2600 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp @@ -890,7 +890,7 @@ void SinglePhaseWell::assembleWellAccumulationTerms( real64 const & time, arrayView1d< real64 > connRate = subRegion.getField< fields::well::connectionRate >(); localIndex rank_offset = dofManager.rankOffset(); - forAll< parallelDevicePolicy<> >( subRegion.size(), [=] GEOS_HOST_DEVICE ( localIndex const ei ) + forAll< parallelDevicePolicy<> >( subRegion.size(), [=, this] GEOS_HOST_DEVICE ( localIndex const ei ) { if( wellElemGhostRank[ei] < 0 ) { @@ -924,7 +924,7 @@ void SinglePhaseWell::assembleWellAccumulationTerms( real64 const & time, arrayView1d< real64 > connRate = subRegion.getField< fields::well::connectionRate >(); localIndex rank_offset = dofManager.rankOffset(); - forAll< parallelDevicePolicy<> >( subRegion.size(), [=] GEOS_HOST_DEVICE ( localIndex const ei ) + forAll< parallelDevicePolicy<> >( subRegion.size(), [=, this] GEOS_HOST_DEVICE ( localIndex const ei ) { if( wellElemGhostRank[ei] < 0 ) { diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/ExplicitQDRateAndState.cpp b/src/coreComponents/physicsSolvers/inducedSeismicity/ExplicitQDRateAndState.cpp index 5705b57fb84..5a9d09d3927 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/ExplicitQDRateAndState.cpp +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/ExplicitQDRateAndState.cpp @@ -220,7 +220,7 @@ void ExplicitQDRateAndState::updateSlipVelocity( real64 const & time_n, { string const & frictionLawName = subRegion.getReference< string >( viewKeyStruct::frictionLawNameString() ); constitutive::ConstitutiveBase & frictionLaw = subRegion.getConstitutiveModel< constitutive::ConstitutiveBase >( frictionLawName ); - constitutive::ConstitutivePassThru< constitutive::RateAndStateFrictionBase >::execute( frictionLaw, [=, &subRegion] ( auto & castedFrictionLaw ) + constitutive::ConstitutivePassThru< constitutive::RateAndStateFrictionBase >::execute( frictionLaw, [=, &subRegion, this] ( auto & castedFrictionLaw ) { // solve rate and state equations. rateAndStateKernels::createAndLaunch< rateAndStateKernels::ExplicitRateAndStateKernel, diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/ImplicitQDRateAndState.cpp b/src/coreComponents/physicsSolvers/inducedSeismicity/ImplicitQDRateAndState.cpp index 4ca1361b425..049d0a149c2 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/ImplicitQDRateAndState.cpp +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/ImplicitQDRateAndState.cpp @@ -68,7 +68,7 @@ void ImplicitQDRateAndState::solveRateAndStateEquations( real64 const time_n, { string const & frictionLawName = subRegion.getReference< string >( viewKeyStruct::frictionLawNameString() ); constitutive::ConstitutiveBase & frictionLaw = subRegion.getConstitutiveModel< constitutive::ConstitutiveBase >( frictionLawName ); - constitutive::ConstitutivePassThru< constitutive::RateAndStateFrictionBase >::execute( frictionLaw, [=, &subRegion] ( auto & castedFrictionLaw ) + constitutive::ConstitutivePassThru< constitutive::RateAndStateFrictionBase >::execute( frictionLaw, [=, &subRegion, this] ( auto & castedFrictionLaw ) { // solve rate and state equations. diff --git a/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp b/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp index 5be2a38d1e0..084da19c48e 100644 --- a/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp +++ b/src/coreComponents/physicsSolvers/inducedSeismicity/SeismicityRate.cpp @@ -369,9 +369,9 @@ real64 SeismicityRate::updateStresses( real64 const & time_n, { globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() ); GEOS_LOG_LEVEL_RANK_0_ON_GROUP( logInfo::BoundaryConditions, - GEOS_FMT( bcLogMessage, - this->getName(), time_n+dt, FieldSpecification::catalogName(), - fs.getName(), setName, subRegion.getName(), fs.getScale(), numTargetElems ), + GEOS_FMT_RUNTIME( bcLogMessage, + this->getName(), time_n+dt, FieldSpecification::catalogName(), + fs.getName(), setName, subRegion.getName(), fs.getScale(), numTargetElems ), fs ); // Specify the bc value of the field diff --git a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp index c7a1f3ea030..63b6eee82b0 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp @@ -357,7 +357,7 @@ class CoupledReservoirAndWellsBase : public CoupledSolver< RESERVOIR_SOLVER, WEL GEOS_UNUSED_VAR( resElemSubRegion ); // unused if geos_error_if is nulld GEOS_UNUSED_VAR( resElemIndex ); // unused if geos_error_if is nulld - forAll< serialPolicy >( perforationData.size(), [=] ( localIndex const iperf ) + forAll< serialPolicy >( perforationData.size(), [=, this] ( localIndex const iperf ) { GEOS_UNUSED_VAR( iperf ); // unused if geos_error_if is nulld GEOS_LOG_RANK( GEOS_FMT( "{}: perforation at ({},{},{}), perforated element center = ({},{},{}), transmissibility = {} [{}]", diff --git a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp index 7142a7c11e4..e26c8abaf34 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/HydrofractureSolver.cpp @@ -1141,11 +1141,11 @@ void HydrofractureSolver< POROMECHANICS_SOLVER >::initializeNewFractureFields( r nodeManager.getField< solidMechanics::totalDisplacement >(); elemManager.forElementRegions< SurfaceElementRegion >( regionNames, - [=] ( localIndex const, - SurfaceElementRegion & region ) + [=, this] ( localIndex const, + SurfaceElementRegion & region ) { real64 const defaultAperture = region.getDefaultAperture(); - region.forElementSubRegions< FaceElementSubRegion >( [=]( FaceElementSubRegion & subRegion ) + region.forElementSubRegions< FaceElementSubRegion >( [=, this]( FaceElementSubRegion & subRegion ) { ArrayOfArraysView< localIndex const > const facesToEdges = subRegion.edgeList().toViewConst(); ArrayOfArraysView< localIndex const > const & fractureConnectorsToFaceElements = subRegion.m_2dFaceTo2dElems.toViewConst(); diff --git a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsConformingFractures.hpp b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsConformingFractures.hpp index 9e0828e19d5..7218768bc96 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsConformingFractures.hpp +++ b/src/coreComponents/physicsSolvers/multiphysics/PoromechanicsConformingFractures.hpp @@ -492,7 +492,7 @@ class PoromechanicsConformingFractures : public POROMECHANICS_BASE< FLOW_SOLVER, arrayView1d< real64 const > const & pressure = subRegion.getReference< array1d< real64 > >( fields::flow::pressure::key() ); arrayView2d< localIndex const > const & elemsToFaces = subRegion.faceList().toViewConst(); - forAll< serialPolicy >( subRegion.size(), [=]( localIndex const kfe ) + forAll< serialPolicy >( subRegion.size(), [=, this]( localIndex const kfe ) { localIndex const kf0 = elemsToFaces[kfe][0]; localIndex const numNodesPerFace = faceToNodeMap.sizeOfArray( kf0 ); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 4072b5683a9..0c264a01486 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -784,13 +784,13 @@ void SolidMechanicsLagrangianFEM::applyDisplacementBCImplicit( real64 const time "The problem may be ill-posed.\n"; GEOS_UNUSED_VAR( bcLogMessage ); GEOS_WARNING_IF( isDisplacementBCAppliedGlobal[0] == 0, // target set is empty - GEOS_FMT( bcLogMessage, 'x' ), + GEOS_FMT_RUNTIME( bcLogMessage, 'x' ), getDataContext() ); GEOS_WARNING_IF( isDisplacementBCAppliedGlobal[1] == 0, // target set is empty - GEOS_FMT( bcLogMessage, 'y' ), + GEOS_FMT_RUNTIME( bcLogMessage, 'y' ), getDataContext() ); GEOS_WARNING_IF( isDisplacementBCAppliedGlobal[2] == 0, // target set is empty - GEOS_FMT( bcLogMessage, 'z' ), + GEOS_FMT_RUNTIME( bcLogMessage, 'z' ), getDataContext() ); } } diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp index bf1814610e5..d155b3c4d5c 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsMPM.cpp @@ -2459,8 +2459,9 @@ void SolidMechanicsMPM::computeDamageFieldGradient( ParticleManager & particleMa // Loop over neighbors SortedArrayView< localIndex const > const activeParticleIndices = subRegion.activeParticleIndices(); - forAll< serialPolicy >( activeParticleIndices.size(), [=] GEOS_HOST ( localIndex const pp ) // Must be on host since we call a 'this' - // method which uses class variables + forAll< serialPolicy >( activeParticleIndices.size(), [=, this] GEOS_HOST ( localIndex const pp ) // Must be on host since we call a + // 'this' + // method which uses class variables { localIndex const p = activeParticleIndices[pp]; @@ -2819,7 +2820,7 @@ void SolidMechanicsMPM::initializeGridFields( NodeManager & nodeManager ) arrayView3d< real64 > const gridSurfaceNormal = nodeManager.getReference< array3d< real64 > >( viewKeyStruct::surfaceNormalString() ); arrayView3d< real64 > const gridMaterialPosition = nodeManager.getReference< array3d< real64 > >( viewKeyStruct::materialPositionString() ); - forAll< serialPolicy >( numNodes, [=] GEOS_HOST ( localIndex const g ) // Switch to .zero()? + forAll< serialPolicy >( numNodes, [=, this] GEOS_HOST ( localIndex const g ) // Switch to .zero()? { for( int i = 0; i < 3; i++ ) { @@ -2903,9 +2904,9 @@ void SolidMechanicsMPM::particleToGrid( ParticleManager & particleManager, int const numDims = m_numDims; int voigtMap[3][3] = { {0, 5, 4}, {5, 1, 3}, {4, 3, 2} }; int const damageFieldPartitioning = m_damageFieldPartitioning; - forAll< serialPolicy >( activeParticleIndices.size(), [=] GEOS_HOST ( localIndex const pp ) // Can be parallized using atomics - - // remember to pass copies of class - // variables + forAll< serialPolicy >( activeParticleIndices.size(), [=, this] GEOS_HOST ( localIndex const pp ) // Can be parallized using atomics - + // remember to pass copies of class + // variables { // Grid max damage will require reduction localIndex const p = activeParticleIndices[pp]; @@ -3376,8 +3377,9 @@ void SolidMechanicsMPM::computeSurfaceFlags( ParticleManager & particleManager ) // Loop over neighbors SortedArrayView< localIndex const > const activeParticleIndices = subRegion.activeParticleIndices(); - forAll< serialPolicy >( activeParticleIndices.size(), [=] GEOS_HOST ( localIndex const pp ) // Must be on host since we call a 'this' - // method which uses class variables + forAll< serialPolicy >( activeParticleIndices.size(), [=, this] GEOS_HOST ( localIndex const pp ) // Must be on host since we call a + // 'this' + // method which uses class variables { localIndex const p = activeParticleIndices[pp]; @@ -3452,9 +3454,10 @@ void SolidMechanicsMPM::computeSphF( ParticleManager & particleManager ) // Loop over neighbors SortedArrayView< localIndex const > const activeParticleIndices = subRegion.activeParticleIndices(); - forAll< serialPolicy >( activeParticleIndices.size(), [=] GEOS_HOST ( localIndex const pp ) // I think this must be on host since we - // call a 'this' method which uses class - // variables + forAll< serialPolicy >( activeParticleIndices.size(), [=, this] GEOS_HOST ( localIndex const pp ) // I think this must be on host since + // we + // call a 'this' method which uses class + // variables { localIndex const p = activeParticleIndices[pp]; diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp index a928891a726..f0b90771230 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsAugmentedLagrangianContact.cpp @@ -1454,7 +1454,7 @@ void SolidMechanicsAugmentedLagrangianContact::createFaceTypeList( DomainPartiti // Determine the size of the lists and generate the vector keys and vals for parallel indexing into lists. // (With RAJA, parallelizing this operation seems the most viable approach.) forAll< parallelHostPolicy >( subRegion.size(), - [ = ] GEOS_HOST ( localIndex const kfe ) + [ =, this ] GEOS_HOST ( localIndex const kfe ) { localIndex const kf0 = elemsToFaces[kfe][0]; localIndex const numNodesPerFace = faceToNodeMap.sizeOfArray( kf0 ); @@ -1975,7 +1975,7 @@ void SolidMechanicsAugmentedLagrangianContact::computeTolerances( DomainPartitio arrayView1d< integer const > const ghostRank = subRegion.ghostRank(); - forAll< parallelHostPolicy >( subRegion.size(), [=] ( localIndex const kfe ) + forAll< parallelHostPolicy >( subRegion.size(), [=, this] ( localIndex const kfe ) { if( ghostRank[kfe] < 0 ) diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp index b12a67de3ca..4fb89a1fa6d 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/SolidMechanicsLagrangeContact.cpp @@ -533,7 +533,7 @@ void SolidMechanicsLagrangeContact::computeFaceDisplacementJump( DomainPartition arrayView1d< real64 > const slip = subRegion.getField< contact::slip >(); arrayView1d< real64 > const aperture = subRegion.getField< elementAperture >(); - forAll< parallelHostPolicy >( subRegion.size(), [=] ( localIndex const kfe ) + forAll< parallelHostPolicy >( subRegion.size(), [=, this] ( localIndex const kfe ) { // Contact constraints @@ -713,7 +713,7 @@ void SolidMechanicsLagrangeContact:: arrayView1d< real64 const > const & pressure = subRegion.getReference< array1d< real64 > >( flow::pressure::key() ); arrayView2d< localIndex const > const & elemsToFaces = subRegion.faceList().toViewConst(); - forAll< serialPolicy >( subRegion.size(), [=]( localIndex const kfe ) + forAll< serialPolicy >( subRegion.size(), [=, this]( localIndex const kfe ) { localIndex const kf0 = elemsToFaces[kfe][0]; localIndex const numNodesPerFace = faceToNodeMap.sizeOfArray( kf0 ); @@ -1363,7 +1363,7 @@ void SolidMechanicsLagrangeContact:: arrayView3d< real64 const > const & rotationMatrix = subRegion.getReference< array3d< real64 > >( viewKeyStruct::rotationMatrixString() ); arrayView2d< localIndex const > const & elemsToFaces = subRegion.faceList().toViewConst(); - forAll< parallelHostPolicy >( subRegion.size(), [=] ( localIndex const kfe ) + forAll< parallelHostPolicy >( subRegion.size(), [=, this] ( localIndex const kfe ) { localIndex const numNodesPerFace = faceToNodeMap.sizeOfArray( elemsToFaces[kfe][0] ); @@ -1491,7 +1491,7 @@ void SolidMechanicsLagrangeContact:: using FrictionType = TYPEOFREF( castedFrictionLaw ); typename FrictionType::KernelWrapper frictionWrapper = castedFrictionLaw.createKernelUpdates(); - forAll< parallelHostPolicy >( subRegion.size(), [=] ( localIndex const kfe ) + forAll< parallelHostPolicy >( subRegion.size(), [=, this] ( localIndex const kfe ) { @@ -1782,7 +1782,7 @@ void SolidMechanicsLagrangeContact::assembleStabilization( MeshLevel const & mes { typename SurfaceElementStencil::IndexContainerViewConstType const & sei = stencil.getElementIndices(); - forAll< serialPolicy >( stencil.size(), [=] ( localIndex const iconn ) + forAll< serialPolicy >( stencil.size(), [=, this] ( localIndex const iconn ) { localIndex const numFluxElems = sei.sizeOfArray( iconn ); @@ -2264,7 +2264,7 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai using FrictionType = TYPEOFREF( castedFrictionLaw ); typename FrictionType::KernelWrapper frictionWrapper = castedFrictionLaw.createKernelUpdates(); - forAll< parallelHostPolicy >( subRegion.size(), [=, &subRegion] ( localIndex const kfe ) + forAll< parallelHostPolicy >( subRegion.size(), [=, &subRegion, this] ( localIndex const kfe ) { if( ghostRank[kfe] < 0 ) { diff --git a/src/coreComponents/physicsSolvers/solidMechanics/contact/kernels/SolidMechanicsLagrangeContactKernels.hpp b/src/coreComponents/physicsSolvers/solidMechanics/contact/kernels/SolidMechanicsLagrangeContactKernels.hpp index 80279727229..59f8efa0e6a 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/contact/kernels/SolidMechanicsLagrangeContactKernels.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/contact/kernels/SolidMechanicsLagrangeContactKernels.hpp @@ -263,7 +263,7 @@ class LagrangeContact : localIndex const q, StackVariables & stack ) const { - Base::quadraturePointKernel( k, q, stack, [ =, &stack ] ( real64 const detJ ) + Base::quadraturePointKernel( k, q, stack, [ =, &stack, this ] ( real64 const detJ ) { stack.localRt[0] -= detJ * ( m_dispJump[k][0] - m_targetIncrementalJump[k][0] ); stack.localRt[1] -= detJ * ( ( m_dispJump[k][1] - m_oldDispJump[k][1] ) - m_targetIncrementalJump[k][1] ); diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEMKernel.hpp index e03686ad046..ce97ce13194 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/firstOrderEqn/isotropic/AcousticFirstOrderWaveEquationSEMKernel.hpp @@ -63,7 +63,7 @@ struct VelocityComputation arrayView2d< real32 > const velocity_y, arrayView2d< real32 > const velocity_z ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const k ) { // only the eight corners of the mesh cell are needed to compute the Jacobian real64 xLocal[8][3]; @@ -205,7 +205,7 @@ struct PressureComputation real64 const rickerValue = useSourceWaveletTables ? 0 : WaveSolverUtils::evaluateRicker( time_n, timeSourceFrequency, timeSourceDelay, rickerOrder ); - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const k ) { // only the eight corners of the mesh cell are needed to compute the Jacobian real64 xLocal[8][3]; diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEMKernel.hpp index 2e23c7e09c9..6f90a924e5a 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/secondOrderEqn/anisotropic/AcousticVTIWaveEquationSEMKernel.hpp @@ -210,7 +210,7 @@ struct MassMatrixKernel arrayView1d< real32 > const mass ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { @@ -288,7 +288,7 @@ struct DampingMatrixKernel arrayView1d< real32 > const damping_pq, arrayView1d< real32 > const damping_qp ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { for( localIndex i = 0; i < elemsToFaces.size( 1 ); ++i ) { diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/shared/AcousticMatricesSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/shared/AcousticMatricesSEMKernel.hpp index 3f64dc167c4..bd530be9fca 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/shared/AcousticMatricesSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/acoustic/shared/AcousticMatricesSEMKernel.hpp @@ -57,7 +57,7 @@ struct AcousticMatricesSEM arrayView1d< real32 > const mass ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { real32 const invC2 = 1.0 / ( density[e] * pow( velocity[e], 2 ) ); @@ -117,7 +117,7 @@ struct AcousticMatricesSEM arrayView1d< real32 const > const density, arrayView1d< real32 > const damping ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { for( localIndex i = 0; i < elemsToFaces.size( 1 ); ++i ) { @@ -186,7 +186,7 @@ struct AcousticMatricesSEM arrayView1d< real32 > const grad2 ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { if( elemGhostRank[e]<0 ) { @@ -247,7 +247,7 @@ struct AcousticMatricesSEM arrayView1d< real32 > const imag ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { if( elemGhostRank[e]<0 ) { diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEMKernel.hpp index 500bfec2aad..67d180600cb 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/firstOrderEqn/isotropic/ElasticFirstOrderWaveEquationSEMKernel.hpp @@ -105,7 +105,7 @@ struct StressComputation { real64 const rickerValue = useSourceWaveletTables ? 0 : WaveSolverUtils::evaluateRicker( time_n, timeSourceFrequency, timeSourceDelay, rickerOrder ); - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const k ) { // only the eight corners of the mesh cell are needed to compute the Jacobian real64 xLocal[8][3]; @@ -305,7 +305,7 @@ struct VelocityComputation uz_np1[a] *= 1.0-((dt/2)*(dampingz[a]/mass[a])); } ); - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const k ) { // only the eight corners of the mesh cell are needed to compute the Jacobian real64 xLocal[8][3]; diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/anisotropic/ElasticVTIWaveEquationSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/anisotropic/ElasticVTIWaveEquationSEMKernel.hpp index 3b70241a7ec..3c9ec7ec7c6 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/anisotropic/ElasticVTIWaveEquationSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/secondOrderEqn/anisotropic/ElasticVTIWaveEquationSEMKernel.hpp @@ -109,7 +109,7 @@ struct ComputeTimeStep uxAuxView.zero(); uyAuxView.zero(); uzAuxView.zero(); - forAll< EXEC_POLICY >( sizeElem, [=] GEOS_HOST_DEVICE ( localIndex const k ) + forAll< EXEC_POLICY >( sizeElem, [=, this] GEOS_HOST_DEVICE ( localIndex const k ) { real64 mu = density[k]*Vs[k]*Vs[k]; @@ -204,7 +204,7 @@ struct ComputeTimeStep uxAuxView.zero(); uyAuxView.zero(); uzAuxView.zero(); - forAll< EXEC_POLICY >( sizeElem, [=] GEOS_HOST_DEVICE ( localIndex const k ) + forAll< EXEC_POLICY >( sizeElem, [=, this] GEOS_HOST_DEVICE ( localIndex const k ) { real64 mu = density[k]*Vs[k]*Vs[k]; diff --git a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/shared/ElasticMatricesSEMKernel.hpp b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/shared/ElasticMatricesSEMKernel.hpp index 40b8947ead5..3e8385054d4 100644 --- a/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/shared/ElasticMatricesSEMKernel.hpp +++ b/src/coreComponents/physicsSolvers/wavePropagation/sem/elastic/shared/ElasticMatricesSEMKernel.hpp @@ -53,7 +53,7 @@ struct ElasticMatricesSEM arrayView1d< real32 > const mass ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { // only the eight corners of the mesh cell are needed to compute the Jacobian @@ -123,7 +123,7 @@ struct ElasticMatricesSEM arrayView1d< real32 > const dampingy, arrayView1d< real32 > const dampingz ) { - forAll< EXEC_POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const e ) + forAll< EXEC_POLICY >( size, [=, this] GEOS_HOST_DEVICE ( localIndex const e ) { for( localIndex i = 0; i < elemsToFaces.size( 1 ); ++i ) {