@@ -65,7 +65,7 @@ PETSC_INTERN void mat_mult_powers_share_sparsity_kokkos(Mat *input_mat, const in
65
65
// Duplicate & copy the matrix, but ensure there is a diagonal present
66
66
mat_duplicate_copy_plus_diag_kokkos (mat_sparsity_match, reuse_int_cmat, output_mat);
67
67
68
- PetscInt *col_indices_off_proc_array, *row_indices_array ;
68
+ PetscInt *col_indices_off_proc_array;
69
69
IS col_indices, row_indices;
70
70
Mat *submatrices;
71
71
@@ -86,7 +86,6 @@ PETSC_INTERN void mat_mult_powers_share_sparsity_kokkos(Mat *input_mat, const in
86
86
// and the nonlocal rows that correspond to the nonlocal columns
87
87
// from the input mat
88
88
PetscMalloc1 (cols_ad + cols_ao, &col_indices_off_proc_array);
89
- PetscMalloc1 (cols_ao, &row_indices_array);
90
89
size_cols = cols_ad + cols_ao;
91
90
for (PetscInt i = 0 ; i < cols_ad; i++)
92
91
{
@@ -95,14 +94,13 @@ PETSC_INTERN void mat_mult_powers_share_sparsity_kokkos(Mat *input_mat, const in
95
94
for (PetscInt i = 0 ; i < cols_ao; i++)
96
95
{
97
96
col_indices_off_proc_array[cols_ad + i] = mat_mpi->garray [i];
98
- row_indices_array[i] = mat_mpi->garray [i];
99
97
}
100
98
101
99
// Create the sequential IS we want with the cols we want (written as global indices)
102
100
ISCreateGeneral (PETSC_COMM_SELF, size_cols, \
103
101
col_indices_off_proc_array, PETSC_USE_POINTER, &col_indices);
104
102
ISCreateGeneral (PETSC_COMM_SELF, cols_ao, \
105
- row_indices_array , PETSC_USE_POINTER, &row_indices);
103
+ mat_mpi-> garray , PETSC_USE_POINTER, &row_indices);
106
104
107
105
MatSetOption (*input_mat, MAT_SUBMAT_SINGLEIS, PETSC_TRUE);
108
106
// Now this will be doing comms to get the non-local rows we want and returns in a sequential matrix
@@ -185,9 +183,6 @@ PETSC_INTERN void mat_mult_powers_share_sparsity_kokkos(Mat *input_mat, const in
185
183
// Add in the 0th order term
186
184
MatShift (*output_mat, coefficients[0 ]);
187
185
188
- PetscInt local_rows_submat, local_cols_submat;
189
- MatGetLocalSize (submatrices[0 ], &local_rows_submat, &local_cols_submat);
190
-
191
186
// ~~~~~~~~~~~~~~
192
187
// Find maximum non-zeros per row for sizing scratch memory
193
188
// ~~~~~~~~~~~~~~
@@ -514,7 +509,7 @@ PETSC_INTERN void mat_mult_powers_share_sparsity_kokkos(Mat *input_mat, const in
514
509
}
515
510
delete[] matrix_powers;
516
511
if (deallocate_submatrices) delete[] submatrices;
517
- (void )(col_indices_off_proc_array);
512
+ (void )PetscFree (col_indices_off_proc_array);
518
513
519
514
return ;
520
515
}
0 commit comments