Skip to content

Commit

Permalink
Merge pull request #10795 from vbrunini/ifpack2_unit_read_fix
Browse files Browse the repository at this point in the history
Ifpack2 uninitialized read fix
  • Loading branch information
jhux2 authored Jul 29, 2022
2 parents e8a9b49 + e714e57 commit efcc1e1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,14 @@ setup(const Teuchos::RCP<const row_matrix_type>& A_unfiltered,
//Fill the local matrix of A_ (filtered and permuted)
//First, construct the rowmap by counting the entries in each row
row_map_type localRowptrs(Kokkos::view_alloc(Kokkos::WithoutInitializing, "Filtered rowptrs"), numLocalRows + 1);
Kokkos::parallel_for(policy_type(0, numLocalRows),
Kokkos::parallel_for(policy_type(0, numLocalRows + 1),
KOKKOS_LAMBDA(local_ordinal_type i)
{
if(i == numLocalRows)
{
localRowptrs(i) = 0;
return;
}
//Count the entries that will be in filtered row i.
//This means entries which correspond to local, non-singleton rows/columns.
local_ordinal_type numEntries = 0;
Expand Down Expand Up @@ -270,8 +275,6 @@ setup(const Teuchos::RCP<const row_matrix_type>& A_unfiltered,
}
}
localRowptrs(i) = numEntries;
if(i == numLocalRows - 1)
localRowptrs(i + 1) = 0;
});
//Prefix sum to finish computing the rowptrs
size_type numLocalEntries;
Expand Down

0 comments on commit efcc1e1

Please sign in to comment.