1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-22 16:14:24 +00:00

init_array: Leave a comment with my experiments on the second iteration

This commit is contained in:
Steffo 2022-11-16 01:42:37 +01:00
parent 7fcff5d127
commit 18466da754
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -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;