Skip to content

Add CI comparing ref/ and kokkos/#23

Open
cwpearson wants to merge 3 commits intoMantevo:masterfrom
cwpearson:ci/compare-ref-kokkos
Open

Add CI comparing ref/ and kokkos/#23
cwpearson wants to merge 3 commits intoMantevo:masterfrom
cwpearson:ci/compare-ref-kokkos

Conversation

@cwpearson
Copy link
Copy Markdown

@cwpearson cwpearson commented Apr 3, 2026

This adds a CI job that does a serial+openmpi run and uses MINIFE_DEBUG to dump the raw values from inside the solver to compare the two implementations.

Along the way, two issues fixed:

  1. The kokkos/ dump thing was expecting std::vector, not Kokkos::vector
  2. The use of kokkos/ waxpy had a bug in the decomposed MPI case

With these changes, the internal vector/matrix states match before and after the solves.

Signed-off-by: Carl Pearson <cwpears@sandia.gov>
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
In ref/ cg_solve.hpp, we have waxpby(one, r, beta, p, p)

In kokkos/ we had waxpby(beta, p, one, r, p)

These are algebraicly equivalent:

waxpby(alpha, x, beta, y, w) computes w = alpha*x + beta*y,

so ref/: p = 1*r + beta * p
kokkos/: p = beta*p + 1*r

However, p is length A.num_cols and includes ghost entries after
make_local_matrix, while r has only local rows. For mpi runs, when p is
the x argument it trips

y.local_size < x.local_size || w.local_size < x.local_size

This PR swaps the Kokkos arguments back to the ref ones, so
when p is extra long the check doesn't trip.

Signed-off-by: Carl Pearson <cwpears@sandia.gov>
@cwpearson cwpearson force-pushed the ci/compare-ref-kokkos branch from 901ffd3 to 6778f48 Compare April 3, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant