Skip to content

Commit

Permalink
Have RHS::dgefa() return the info parameter directly
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Jul 6, 2024
1 parent 0380d0f commit b779e95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion integration/VODE/vode_dvjac.H
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void dvjac (int& IERPJ, BurnT& state, DvodeT& vstate)
int IER{};

#ifdef NEW_NETWORK_IMPLEMENTATION
RHS::dgefa(vstate.jac, IER);
IER = RHS::dgefa(vstate.jac);
#else
if (integrator_rp::linalg_do_pivoting == 1) {
constexpr bool allow_pivot{true};
Expand Down
6 changes: 5 additions & 1 deletion networks/rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,13 @@ void dgesl (const RArray2D& a, RArray1D& b)
}

AMREX_GPU_HOST_DEVICE AMREX_INLINE
void dgefa (RArray2D& a, int& info)
int dgefa (RArray2D& a)
{

// LU factorization in-place without pivoting.

int info = 0;

amrex::constexpr_for<1, INT_NEQS>([&] (auto n1)
{
[[maybe_unused]] constexpr int k = n1;
Expand Down Expand Up @@ -344,6 +346,8 @@ void dgefa (RArray2D& a, int& info)
});
});
});

return info;
}

// Calculate the density dependence term for tabulated rates. The RHS has a term
Expand Down
5 changes: 2 additions & 3 deletions unit_test/test_linear_algebra/test_linear_algebra.H
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ void linear_algebra() {

// solve the linear system with the templated solver

int info;

RHS::dgefa(A, info);
RHS::dgefa(A);
RHS::dgesl(A, b);

std::cout << std::setprecision(16);
Expand All @@ -124,6 +122,7 @@ void linear_algebra() {
b = Ax(A, x);

IArray1D pivot;
int info;

constexpr bool allow_pivot{true};

Expand Down

0 comments on commit b779e95

Please sign in to comment.