You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the failures I see with #16611 is that we run into trouble with the Tpetra vectors because nonlocal_vector is a nullptr. Specifically in this function:
template <typename Number, typename MemorySpace>
inline void
Vector<Number, MemorySpace>::add(const size_type n_elements,
const size_type *indices,
const Number *values)
{
# if DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
auto vector_2d_local = vector->template getLocalView<Kokkos::HostSpace>(
Tpetra::Access::ReadWrite);
auto vector_2d_nonlocal =
nonlocal_vector->template getLocalView<Kokkos::HostSpace>(
Tpetra::Access::ReadWrite);
# else
vector->template sync<Kokkos::HostSpace>();
auto vector_2d_local = vector->template getLocalView<Kokkos::HostSpace>();
auto vector_2d_nonlocal =
nonlocal_vector->template getLocalView<Kokkos::HostSpace>();
# endif
auto vector_1d_local = Kokkos::subview(vector_2d_local, Kokkos::ALL(), 0);
auto vector_1d_nonlocal =
Kokkos::subview(vector_2d_nonlocal, Kokkos::ALL(), 0);
# if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
vector->template modify<Kokkos::HostSpace>();
nonlocal_vector->template modify<Kokkos::HostSpace>();
# endif
for (size_type i = 0; i < n_elements; ++i)
{
const size_type row = indices[i];
TrilinosWrappers::types::int_type local_row =
vector->getMap()->getLocalElement(row);
// check if the index is in the non local set
bool nonlocal = false;
if (local_row == Teuchos::OrdinalTraits<int>::invalid())
{
local_row = nonlocal_vector->getMap()->getLocalElement(row);
nonlocal = true;
compressed = false;
}
# if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
Assert(
local_row != Teuchos::OrdinalTraits<int>::invalid(),
ExcAccessToNonLocalElement(row,
vector->getMap()->getLocalNumElements(),
vector->getMap()->getMinLocalIndex(),
vector->getMap()->getMaxLocalIndex()));
# else
Assert(
local_row != Teuchos::OrdinalTraits<int>::invalid(),
ExcAccessToNonLocalElement(row,
vector->getMap()->getNodeNumElements(),
vector->getMap()->getMinLocalIndex(),
vector->getMap()->getMaxLocalIndex()));
# endif
if (local_row != Teuchos::OrdinalTraits<int>::invalid())
{
if (nonlocal)
vector_1d_nonlocal(local_row) += values[i];
else
vector_1d_local(local_row) += values[i];
}
}
# if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0)
vector->template sync<
typename Tpetra::Vector<Number, int, types::signed_global_dof_index>::
device_type::memory_space>();
nonlocal_vector->template sync<
typename Tpetra::Vector<Number, int, types::signed_global_dof_index>::
device_type::memory_space>();
# endif
}
If nonlocal_vector == nullptr, extracting the view at the very top already fails.
If it is sequential and therefore has no ghost elements wouldn't it make sense to catch that with an if,
such that the nonlocal view is only created if has_ghost==true?
One of the failures I see with #16611 is that we run into trouble with the Tpetra vectors because
nonlocal_vector
is anullptr
. Specifically in this function:If
nonlocal_vector == nullptr
, extracting the view at the very top already fails.@kinnewig @jpthiele @masterleinad FYI.
The text was updated successfully, but these errors were encountered: