Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
[hypre] Call ClearAllErrors before major operations
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricchevalier19 committed Nov 15, 2023
1 parent 167c596 commit 2928b8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/hypre/src/hypre_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ class AlienHypreInstance
public:
static void init_if_needed(MPI_Comm comm)
{
if (hypre_initialized)
if (hypre_initialized) {
// Clear all Hypre error for this session
HYPRE_ClearAllErrors();
return;
}

bind_devices(comm);

Expand All @@ -41,8 +44,10 @@ class AlienHypreInstance
#endif

hypre_initialized = true;
HYPRE_ClearAllErrors();

setup_devices();
HYPRE_ClearAllErrors();
}

static void bind_devices([[maybe_unused]] MPI_Comm comm)
Expand Down
2 changes: 2 additions & 0 deletions plugins/hypre/src/hypre_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ Matrix::~Matrix()
void Matrix::init(DirectMatrixOptions::ResetFlag reset_flag)
{
HYPRE_Int ierr = 0;
// Clear all Hypre error for this session
HYPRE_ClearAllErrors();

switch (reset_flag) {
case DirectMatrixOptions::eNoReset:
Expand Down

0 comments on commit 2928b8b

Please sign in to comment.