From 34cd8a297f616e3d19aaf873e52304529d841bea Mon Sep 17 00:00:00 2001 From: ahuegli Date: Sun, 5 Apr 2020 15:52:39 +0200 Subject: [PATCH] bug fixing --- hw3/skeleton/wave.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw3/skeleton/wave.cpp b/hw3/skeleton/wave.cpp index 343236b..e89ce13 100644 --- a/hw3/skeleton/wave.cpp +++ b/hw3/skeleton/wave.cpp @@ -329,12 +329,11 @@ void WaveEquation::run(double t_end) { int i1_max = N; int i2_max = N;*/ - int tid = omp_get_thread_num(); + int ti0, ti1, ti2; thread_coordinates(tid, threads_per_dim, ti0, ti1, ti2); - int nloc = N / threads_per_dim; - + int i0_min = ti0 * nloc; int i1_min = ti1 * nloc; int i2_min = ti2 * nloc; @@ -383,7 +382,7 @@ void WaveEquation::run(double t_end) { // ******************************************************************************** // Question 3: You will need to add the following barrier (why?) // ******************************************************************************** - //#pragma omp barrier + #pragma omp barrier std::swap(u_new, u); std::swap(u_new, u_old); -- GitLab