From cd4d27b00cc5eb41a83ca78f84e4dd7d5e1b66f7 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 23 May 2022 20:32:07 +0200 Subject: [PATCH] Fix two tests with vectorization disabled --- include/deal.II/lac/diagonal_matrix.h | 3 ++- tests/matrix_free/constraint_info_01.cc | 9 +++++++-- tests/matrix_free/constraint_info_01.output | 2 +- tests/matrix_free/solver_cg_interleave.cc | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/deal.II/lac/diagonal_matrix.h b/include/deal.II/lac/diagonal_matrix.h index 00c9d998b2..0fd53c312f 100644 --- a/include/deal.II/lac/diagonal_matrix.h +++ b/include/deal.II/lac/diagonal_matrix.h @@ -446,7 +446,8 @@ DiagonalMatrix::apply_to_subrange( const value_type * src_pointer_to_current_range, value_type * dst_pointer_to_current_range) const { - AssertIndexRange(begin_range, diagonal.locally_owned_elements().n_elements()); + AssertIndexRange(begin_range, + diagonal.locally_owned_elements().n_elements() + 1); AssertIndexRange(end_range, diagonal.locally_owned_elements().n_elements() + 1); diff --git a/tests/matrix_free/constraint_info_01.cc b/tests/matrix_free/constraint_info_01.cc index 65ccfb506c..2cc5a69ec4 100644 --- a/tests/matrix_free/constraint_info_01.cc +++ b/tests/matrix_free/constraint_info_01.cc @@ -99,8 +99,13 @@ main() deallog << "(" << i.first << "," << i.second << ") "; deallog << std::endl; - for (const auto i : dof_info.row_starts) - deallog << "(" << i.first << "," << i.second << ") "; + // make sure to filter out contributions that only get filled up to make + // all SIMD lanes populated + for (unsigned int i = 0; i < dof_info.row_starts.size(); ++i) + if (i == 0 || + (dof_info.row_starts[i].first > dof_info.row_starts[i - 1].first)) + deallog << "(" << dof_info.row_starts[i].first << "," + << dof_info.row_starts[i].second << ") "; deallog << std::endl; deallog << std::endl; diff --git a/tests/matrix_free/constraint_info_01.output b/tests/matrix_free/constraint_info_01.output index 3658842fd7..9cbf7e2bee 100644 --- a/tests/matrix_free/constraint_info_01.output +++ b/tests/matrix_free/constraint_info_01.output @@ -5,7 +5,7 @@ DEAL::(0,0) (1,3) (3,5) (5,7) (7,9) (8,12) (9,15) (10,18) DEAL:: DEAL::11 11 2 11 2 11 2 2 2 2 DEAL::(0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (1,0) (1,0) (0,0) (0,0) (0,0) (1,0) (0,0) (1,0) (0,0) (1,0) (0,0) (0,0) -DEAL::(0,0) (1,3) (3,5) (5,7) (7,9) (8,12) (9,15) (10,18) (10,18) +DEAL::(0,0) (1,3) (3,5) (5,7) (7,9) (8,12) (9,15) (10,18) DEAL:: Process #0 Local range: [0, 14), global size: 14 diff --git a/tests/matrix_free/solver_cg_interleave.cc b/tests/matrix_free/solver_cg_interleave.cc index bef4c74a30..88f92e2a5d 100644 --- a/tests/matrix_free/solver_cg_interleave.cc +++ b/tests/matrix_free/solver_cg_interleave.cc @@ -160,7 +160,8 @@ struct DiagonalMatrixSubrange const Number * src_pointer_to_current_range, Number * dst_pointer_to_current_range) const { - AssertIndexRange(begin_range, vec.locally_owned_elements().n_elements()); + AssertIndexRange(begin_range, + vec.locally_owned_elements().n_elements() + 1); AssertIndexRange(end_range, vec.locally_owned_elements().n_elements() + 1); const Number * diagonal_entry = vec.begin() + begin_range; -- 2.39.5