]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve instruction-level parallelism for precondition_SSOR 13399/head
authorMartin Kronbichler <martin.kronbichler@it.uu.se>
Wed, 16 Feb 2022 16:27:01 +0000 (17:27 +0100)
committerMartin Kronbichler <martin.kronbichler@it.uu.se>
Wed, 16 Feb 2022 16:27:01 +0000 (17:27 +0100)
include/deal.II/lac/sparse_matrix.templates.h

index 74fba0265f9cd3b30e56c24204022b14066e86ba..cd512ff7b8d2dd566bab5fccb3106d5670132d80 100644 (file)
@@ -1501,7 +1501,11 @@ SparseMatrix<number>::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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.