Skip to content

Commit 17d285d

Browse files
Merge pull request #89 from PFLAREProject/gmres_poly_smaller_getsubmat
Gmres poly smaller getsubmat
2 parents 5d0d7a9 + daecceb commit 17d285d

File tree

2 files changed

+142
-79
lines changed

2 files changed

+142
-79
lines changed

src/Gmres_Poly.F90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ subroutine mat_mult_powers_share_sparsity(matrix, poly_order, poly_sparsity_orde
731731
PetscScalar normy;
732732
logical :: reuse_triggered_cmat, reuse_triggered_reuse_mat
733733
type(c_ptr) :: coefficients_ptr
734+
type(tMat) :: reuse_mat_cpu
734735
#endif
735736
! ~~~~~~~~~~
736737

@@ -794,8 +795,12 @@ subroutine mat_mult_powers_share_sparsity(matrix, poly_order, poly_sparsity_orde
794795
end if
795796

796797
! Debug check if the CPU and Kokkos versions are the same
798+
! We send in an empty reuse_mat_cpu here always, as we can't pass through
799+
! the same one Kokkos uses as it now only gets out the non-local rows we need
800+
! (ie reuse_mat and reuse_mat_cpu are no longer the same size)
797801
call mat_mult_powers_share_sparsity_cpu(matrix, poly_order, poly_sparsity_order, &
798-
buffers, coefficients, reuse_mat, temp_mat)
802+
buffers, coefficients, reuse_mat_cpu, temp_mat)
803+
call MatDestroy(reuse_mat_cpu, ierr)
799804

800805
call MatConvert(temp_mat, MATSAME, MAT_INITIAL_MATRIX, &
801806
temp_mat_reuse, ierr)

0 commit comments

Comments
 (0)