Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
#include "fileIO/timeHistory/HDFHistoryIO.hpp"
#include "common/TimingMacros.hpp"
#include "mainInterface/initialization.hpp"
#include "LvArray/src/system.hpp"

#include <gtest/gtest.h>

#include <fenv.h>

using namespace geos;

TEST( testHDFIO_parallel, SingleValueHistory )
Expand Down Expand Up @@ -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;
Expand Down
19 changes: 15 additions & 4 deletions src/coreComponents/integrationTests/meshTests/testVTKImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
#include <gtest/gtest.h>
#include <conduit.hpp>

#include <chrono>
#include <filesystem>
#include <system_error>

#include <fenv.h>

Expand Down Expand Up @@ -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 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#include <HYPRE_krylov.h>

#include <algorithm>
#include <cfenv>

#include "LvArray/src/system.hpp"

namespace geos
{
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 13 additions & 3 deletions src/coreComponents/linearAlgebra/unitTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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} )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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;
} );
Expand Down