Skip to content

Commit

Permalink
Print Hypre preconditioner setup error (#2935)
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Tomin <“[email protected]”>
Co-authored-by: Nicola Castelletto <[email protected]>
  • Loading branch information
3 people authored Feb 3, 2024
1 parent f63162c commit ee9cc98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void HypreInterface::initialize()
HYPRE_DeviceInitialize();
#endif
HYPRE_SetMemoryLocation( hypre::memoryLocation );
HYPRE_SetPrintErrorMode( 1 );
}

void HypreInterface::finalize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,19 @@ void HyprePreconditioner::setup( Matrix const & mat )
// Perform setup of the main solver, if needed
if( m_precond->setup )
{
GEOS_LAI_CHECK_ERROR( m_precond->setup( m_precond->ptr, precondMat.unwrapped(), nullptr, nullptr ) );
HYPRE_Int const ierr = m_precond->setup( m_precond->ptr, precondMat.unwrapped(), nullptr, nullptr );
if( ierr != 0 )
{
if( m_params.logLevel > 0 )
{
HYPRE_PrintErrorMessages( precondMat.comm() );
GEOS_ERROR( "HyprePreconditioner setup failed" );
}
else
{
GEOS_ERROR( "HyprePreconditioner setup failed, use logLevel > 0 to get more information" );
}
}
}
else if( m_params.preconditionerType == LinearSolverParameters::PreconditionerType::direct )
{
Expand Down

0 comments on commit ee9cc98

Please sign in to comment.