Skip to content

Commit 6778f48

Browse files
committed
kokkos: waxpby argument order for decomposed case
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>
1 parent c1a9af0 commit 6778f48

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

kokkos/src/cg_solve.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ cg_solve(OperatorType& A,
159159
oldrtrans = rtrans;
160160
TICK(); rtrans = dot(r, r); TOCK(tDOT);
161161
magnitude_type beta = rtrans/oldrtrans;
162-
TICK(); waxpby(beta, p, one, r, p); TOCK(tWAXPY);
162+
TICK(); waxpby(one, r, beta, p, p); TOCK(tWAXPY);
163163
}
164164
normr = std::sqrt(rtrans);
165165
if (myproc == 0 && (k%print_freq==0 || k==max_iter)) {
@@ -219,4 +219,3 @@ cg_solve(OperatorType& A,
219219
}//namespace miniFE
220220

221221
#endif
222-

0 commit comments

Comments
 (0)