I have two functions: do_step_one(i) and do_step_two(i) , for i from 0 to N-1 .
I currently have this (sequential) code:
for(unsigned int i=0; i<N; i++) { do_step_one(i); } for(unsigned int i=0; i<N; i++) { do_step_two(i); }
Each call to do_step_one() and do_step2() can be executed in any order and in parallel, but for any do_step_two() , the end of all do_step_one() required to run (it uses the results of do_step_one() ).
I tried the following:
#omp parallel for for(unsigned int i=0; i<N; i++) { do_step_one(i);
But gcc complains
convolve_slices.c: 21: warning: the area of โโthe barrier cannot be closely nested inside the area of โโshared, critical, ordered, main or explicit task.
What am I misunderstanding? How to solve this problem?
openmp
Guillaume bouchard
source share