From f5f0f2cae3e3f2ccd90ababf70a0cb41910a5d6a Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 16 Feb 2022 17:27:01 +0100 Subject: [PATCH] Improve instruction-level parallelism for precondition_SSOR --- include/deal.II/lac/sparse_matrix.templates.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index 74fba0265f..cd512ff7b8 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -1501,7 +1501,11 @@ SparseMatrix::precondition_SSOR( const size_type first_right_of_diagonal_index = pos_right_of_diagonal[row]; number s = 0; - for (size_type j = first_right_of_diagonal_index; j < end_row; ++j) + // go through the column from the end towards the diagonal in order + // to delay the use of the newly computed "dst" values on + // out-of-order-execution hardware + for (size_type j = end_row - 1; j >= first_right_of_diagonal_index; + --j) s += val[j] * number(dst(cols->colnums[j])); *dst_ptr -= s * omega; -- 2.39.5