From 18466da75471025fcfed91680b92452368e0d20a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 16 Nov 2022 01:42:37 +0100 Subject: [PATCH] `init_array`: Leave a comment with my experiments on the second iteration --- OpenMP/linear-algebra/kernels/atax/atax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenMP/linear-algebra/kernels/atax/atax.c b/OpenMP/linear-algebra/kernels/atax/atax.c index af684eb..b6a9711 100644 --- a/OpenMP/linear-algebra/kernels/atax/atax.c +++ b/OpenMP/linear-algebra/kernels/atax/atax.c @@ -30,8 +30,9 @@ static void init_array(int nx, int ny, x[i] = i * M_PI; } - // Same here, but many times more - // #pragma omp parallel for num_threads(SOMETHING) schedule(static) + /// Initialize the `A` matrix with [something?] + // Using 4 threads here slows everything down: why? + // #pragma omp parallel for num_threads(4) schedule(static) for (i = 0; i < nx; i++) for (j = 0; j < ny; j++) A[i][j] = ((DATA_TYPE)i * (j + 1)) / nx;