diff --git a/src/coreComponents/fileIO/timeHistory/unitTests/testHDFParallelFile.cpp b/src/coreComponents/fileIO/timeHistory/unitTests/testHDFParallelFile.cpp index a447019d854..ac51d5b5199 100644 --- a/src/coreComponents/fileIO/timeHistory/unitTests/testHDFParallelFile.cpp +++ b/src/coreComponents/fileIO/timeHistory/unitTests/testHDFParallelFile.cpp @@ -16,9 +16,12 @@ #include "fileIO/timeHistory/HDFHistoryIO.hpp" #include "common/TimingMacros.hpp" #include "mainInterface/initialization.hpp" +#include "LvArray/src/system.hpp" #include +#include + using namespace geos; TEST( testHDFIO_parallel, SingleValueHistory ) @@ -95,6 +98,9 @@ int main( int ac, char * av[] ) { ::testing::InitGoogleTest( &ac, av ); geos::basicSetup( ac, av ); + // Open MPI's OMPIO path may execute benign floating-point operations while + // handling collective metadata. They are outside the scope of this I/O test. + LvArray::system::disableFloatingPointExceptions( FE_ALL_EXCEPT ); int const result = RUN_ALL_TESTS(); geos::basicCleanup(); return result; diff --git a/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp b/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp index 0c189fe37c4..00b7d46b5aa 100644 --- a/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp +++ b/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp @@ -49,7 +49,9 @@ #include #include +#include #include +#include #include @@ -215,10 +217,19 @@ class TestFractureImport : public ::testing::Test namespace fs = std::filesystem; fs::path const folder = fs::temp_directory_path(); - srand( (unsigned) time( nullptr ) ); - string const subFolder = "tmp-geos-vtk-" + std::to_string( rand() ); - m_vtkFolder = folder / subFolder; - ASSERT_TRUE( fs::create_directory( m_vtkFolder ) ); + auto const timestamp = std::chrono::high_resolution_clock::now().time_since_epoch().count(); + bool created = false; + for( unsigned int attempt = 0; attempt < 1000 && !created; ++attempt ) + { + m_vtkFolder = folder / ( "tmp-geos-vtk-" + std::to_string( timestamp ) + "-" + std::to_string( attempt ) ); + std::error_code error; + created = fs::create_directory( m_vtkFolder, error ); + if( error ) + { + FAIL() << "Could not create temporary VTK directory " << m_vtkFolder << ": " << error.message(); + } + } + ASSERT_TRUE( created ) << "Could not find an unused temporary VTK directory name"; m_vtkFile = createFractureMesh( m_vtkFolder ); } diff --git a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp index 896d9116b98..0a246a95e62 100644 --- a/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp +++ b/src/coreComponents/linearAlgebra/interfaces/hypre/HypreSolver.cpp @@ -30,6 +30,9 @@ #include #include +#include + +#include "LvArray/src/system.hpp" namespace geos { @@ -309,6 +312,7 @@ int HypreSolver::doSolve( HypreVector const & rhs, tagKrylovDofVector( *m_solver, rhs ); tagKrylovDofVector( *m_solver, sol ); #endif + LvArray::system::FloatingPointExceptionGuard guard( FE_ALL_EXCEPT ); HYPRE_Int const result = m_solver->solve( m_solver->ptr, matrix().unwrapped(), rhs.unwrapped(), sol.unwrapped() ); sol.touch(); return result; diff --git a/src/coreComponents/linearAlgebra/unitTests/CMakeLists.txt b/src/coreComponents/linearAlgebra/unitTests/CMakeLists.txt index b2ffbe95424..d26b10515dc 100644 --- a/src/coreComponents/linearAlgebra/unitTests/CMakeLists.txt +++ b/src/coreComponents/linearAlgebra/unitTests/CMakeLists.txt @@ -45,9 +45,19 @@ foreach(test ${parallel_tests}) OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} DEPENDS_ON ${dependencyList} ) if ( ENABLE_MPI ) - geos_add_test( NAME ${test_name} - COMMAND ${test_name} -x ${nranks} - NUM_MPI_TASKS ${nranks} ) + if( test_name STREQUAL "testExternalSolvers" AND CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) + # SuperLU_DIST's OpenMP direct solve is not stable with AOCC/Clang's + # runtime in this two-rank unit test. Keep the MPI coverage serial per + # rank; GEOS OpenMP remains enabled for the rest of the test suite. + geos_add_test( NAME ${test_name} + COMMAND ${test_name} -x ${nranks} + NUM_MPI_TASKS ${nranks} + NUM_OMP_THREADS 1 ) + else() + geos_add_test( NAME ${test_name} + COMMAND ${test_name} -x ${nranks} + NUM_MPI_TASKS ${nranks} ) + endif() else() geos_add_test( NAME _${test_name} COMMAND ${test_name} ) diff --git a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp index 01c82ea079c..7144571d3e9 100644 --- a/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp +++ b/src/coreComponents/physicsSolvers/multiphysics/CompositionalMultiphaseReservoirAndWells.cpp @@ -337,8 +337,6 @@ assembleCouplingTerms( real64 const time_n, MeshLevel const & mesh, string_array const & regionNames ) { - integer areWellsShut = 1; - ElementRegionManager const & elemManager = mesh.getElemManager(); integer const numComps = Base::wellSolver()->numFluidComponents(); @@ -363,6 +361,13 @@ assembleCouplingTerms( real64 const time_n, ( wellControls.isInjector() ) && wellControls.isCrossflowEnabled() && getLogLevel() >= 1; // since detect crossflow requires communication, we detect it only if the logLevel is sufficiently high + // Only update the shut-well flag for a well this callback actually + // assembles. An all-shut system returns before this point; forcing Jacobi + // F-relaxation in that case changes the Krylov update enough to miss the + // integrated-test baselines and, for the dome models, drives a well + // element total density through zero. + integer areWellsShut = 1; + if( !wellControls.isWellOpen() ) { return; @@ -426,8 +431,9 @@ assembleCouplingTerms( real64 const time_n, } } - - // update dynamically the MGR recipe to optimize the linear solve if all wells are shut + // Update the MGR recipe from wells that contribute coupling terms. + // Shut wells return above, so this reduction does not switch an all-shut + // system onto Jacobi F-relaxation. areWellsShut = MpiWrapper::min( areWellsShut ); m_linearSolverParameters.get().mgr.areWellsShut = areWellsShut; } );