Files
opm-simulators/parallelUnitTests.cmake
T
Bård Skaflestad bfe03b0a72 Fix RFT State Collection for Distributed Wells
Commit 6295bd08c (PR #6238) restricted RFT data reporting to only
those wells that are owned by the current rank.  In so doing,
however, we failed to properly account for distributed wells.  Such
wells will typically have RFT contributions from multiple MPI ranks
in a parallel run and we did not allow for this situation.
Moreover, as the simulator by default will distribute "inactive"
wells--wells that are never opened, but which exist primarily to
collect RFT-style data--the problem becomes more pronounced for
these wells.

We solve the problem by splitting the RFTContainer's "wellQuery_"
into two responsibilities.  One for determining if a particular
named well is owned by the current rank and another for determining
if the well is intersected on the current rank.  The latter will be
true for all ranks that have local well connections for the named
well.  This, in turn, means that the constructor now takes two
predicate functions instead of the one we originally used.
Furthermore, member function RFTContainer::allocate() will create
internal data structures for all potential connections on all ranks
that share a well, but RFTContainer::addToWells() will still collect
the RFT data only on the rank that owns the well.

Finally, we implement the owning vs. intersecting distinction for
the black-oil output module through a new member function

    bool BlackoilWellModelGeneric<>::hasLocalCells(name) const

while the compositional output module retains the original
owning-is-intersecting behaviour.  We do not support distributed
wells in compositional runs at the time of writing.
2025-09-05 14:45:26 +02:00

200 lines
4.2 KiB
CMake

opm_set_test_driver(${CMAKE_CURRENT_SOURCE_DIR}/tests/run-parallel-unitTest.sh "")
opm_add_test(test_gatherconvergencereport
DEPENDS "opmsimulators"
LIBRARIES opmsimulators ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
SOURCES
tests/test_gatherconvergencereport.cpp
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 4
-b ${PROJECT_BINARY_DIR}
PROCESSORS
4
)
opm_add_test(test_gatherdeferredlogger
DEPENDS "opmsimulators"
LIBRARIES opmsimulators ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
SOURCES
tests/test_gatherdeferredlogger.cpp
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 4
-b ${PROJECT_BINARY_DIR}
PROCESSORS
4
)
opm_add_test(test_parallelwellinfo_mpi
EXE_NAME
test_parallelwellinfo
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 4
-b ${PROJECT_BINARY_DIR}
NO_COMPILE
PROCESSORS
4
)
foreach(NPROC 2 3 4)
opm_add_test(test_parallel_wbp_sourcevalues_np${NPROC}
EXE_NAME
test_parallel_wbp_sourcevalues
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n ${NPROC}
-b ${PROJECT_BINARY_DIR}
NO_COMPILE
PROCESSORS
${NPROC}
)
endforeach()
opm_add_test(test_parallel_wbp_calculation
SOURCES
tests/test_parallel_wbp_calculation.cpp
LIBRARIES
opmsimulators ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
ONLY_COMPILE
)
opm_add_test(test_parallel_wbp_calculation_create
EXE_NAME
test_parallel_wbp_calculation
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 2
-b ${PROJECT_BINARY_DIR}
TEST_ARGS
--run_test=Create
NO_COMPILE
PROCESSORS
2
)
opm_add_test(test_parallel_wbp_calculation_well_openconns
EXE_NAME
test_parallel_wbp_calculation
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 2
-b ${PROJECT_BINARY_DIR}
TEST_ARGS
--run_test=TopOfFormation_Well_OpenConns
NO_COMPILE
PROCESSORS
2
)
foreach(NPROC 2 3 4)
opm_add_test(test_rftcontainer_np${NPROC}
EXE_NAME
test_rftcontainer
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n ${NPROC}
-b ${PROJECT_BINARY_DIR}
NO_COMPILE
PROCESSORS
${NPROC}
)
endforeach()
foreach(NPROC 2 3 4)
opm_add_test(test_parallel_region_phase_pvaverage_np${NPROC}
EXE_NAME
test_region_phase_pvaverage
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n ${NPROC}
-b ${PROJECT_BINARY_DIR}
TEST_ARGS
--run_test=Parallel/*
NO_COMPILE
PROCESSORS
${NPROC}
)
endforeach()
foreach(NPROC 2 3 4)
opm_add_test(test_parallel_satfunc_consistency_checks_np${NPROC}
EXE_NAME
test_SatfuncConsistencyChecks_parallel
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n ${NPROC}
-b ${PROJECT_BINARY_DIR}
NO_COMPILE
PROCESSORS
${NPROC}
)
endforeach()
opm_add_test(test_broadcast
DEPENDS "opmsimulators"
LIBRARIES opmsimulators ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
SOURCES
tests/test_broadcast.cpp
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 4
-b ${PROJECT_BINARY_DIR}
PROCESSORS
4
)
opm_add_test(test_HDF5File_Parallel
DEPENDS "opmsimulators"
LIBRARIES opmsimulators ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
SOURCES
tests/test_HDF5File_Parallel.cpp
CONDITION
HDF5_FOUND AND MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 4
-b ${PROJECT_BINARY_DIR}
PROCESSORS
4
)
opm_add_test(test_HDF5Serializer_Parallel
DEPENDS "opmsimulators"
LIBRARIES opmsimulators ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
SOURCES
tests/test_HDF5Serializer_Parallel.cpp
CONDITION
HDF5_FOUND AND MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 4
-b ${PROJECT_BINARY_DIR}
PROCESSORS
4
)
opm_add_test(test_rstconv_parallel
EXE_NAME
test_rstconv
CONDITION
MPI_FOUND AND Boost_UNIT_TEST_FRAMEWORK_FOUND
DRIVER_ARGS
-n 4
-b ${PROJECT_BINARY_DIR}
NO_COMPILE
PROCESSORS
4
)