mirror of
https://github.com/Steffo99/unimore-hpc-assignments.git
synced 2024-11-22 16:14:24 +00:00
init_array
: Actually, do optimize the first iteration
This commit is contained in:
parent
00f16cecaf
commit
7fcff5d127
1 changed files with 2 additions and 2 deletions
|
@ -24,8 +24,8 @@ static void init_array(int nx, int ny,
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
// Parallelizing this causes a slowdown, as the cost of context-switches is greater than the cost of inlline execution
|
/// Initialize the `x` array with PI and its multiples.
|
||||||
// #pragma omp parallel for num_threads(SOMETHING) schedule(static)
|
#pragma omp parallel for num_threads(4) schedule(static)
|
||||||
for (i = 0; i < ny; i++) {
|
for (i = 0; i < ny; i++) {
|
||||||
x[i] = i * M_PI;
|
x[i] = i * M_PI;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue