Skip to content

Commit

Permalink
Amesos2: Fix NULL checks to be only for root
Browse files Browse the repository at this point in the history
  • Loading branch information
MicheldeMessieres committed Jun 16, 2020
1 parent 0beba42 commit 4a1c275
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/amesos2/src/Amesos2_KLU2_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,14 @@ KLU2<Matrix,Vector>::solve_impl(
klu2_dtype * pxValues = function_map::convert_scalar(xValues_.data());
klu2_dtype * pbValues = function_map::convert_scalar(bValues_.data());

TEUCHOS_TEST_FOR_EXCEPTION(pbValues == nullptr,
// can be null for non root
if( this->root_) {
TEUCHOS_TEST_FOR_EXCEPTION(pbValues == nullptr,
std::runtime_error, "Amesos2 Runtime Error: b_vector returned null ");

TEUCHOS_TEST_FOR_EXCEPTION(pxValues == nullptr,
TEUCHOS_TEST_FOR_EXCEPTION(pxValues == nullptr,
std::runtime_error, "Amesos2 Runtime Error: x_vector returned null ");
}

if ( single_proc_optimization() && nrhs == 1 ) {
#ifdef HAVE_AMESOS2_TIMERS
Expand Down

0 comments on commit 4a1c275

Please sign in to comment.