Hello,
I would like to optimize the algorithm by fusing multiple loops into one, e.g. calculating the dot-product r_(k+1)' r_(k+1) and updating r_(k+1) = r_k - lambda v_k simultaneously. Doing so, I would need a separate function and I would "erase" one axbpy and one dot-product from the solver-file. As a consequence, the measurements for this function would not show up in the "axpby" or "dotproduct" metrics from LIKWID anymore when running the "./perf" - programme. Based on this, I would like to ask two questions:
1) Are we at all allowed to introduce "new functions" and change the order of steps in the CG /PCG-algorithm or are we supposed to only optimize the given subroutines without changing the order and steps in the algorithm? (e.g. updating r_k -> r_(k+1) and x_k -> x_(k+1), before calculating r_(k+1)*r_(k+1) instead of switching the order).
2)If we are allowed to introduce new subroutines, I believe that the overall performance would still be calculated correctly because all that matters are the total LUP for the final solution x, which is simply given by: iterations * dimension_x * dimension_y. Is this assumption correct or do we also consider updates to auxilliary quantities such as the residuals r_k, p_k, ...?
Thanks in advance
Kind regards
Maximilian Jordan