Hello,
I have two fonction, do_step_one(i) and do_step_two(i) for i from 0 to N
Currently, I 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); }
for any step (one or two), each case of N can be done in any order and in parallel, but any step_two need the end of all the step_one to start (it use step_one results).
I tried the following :
#omp parallel for for(unsigned int i=0; i<N; i++){ do_step_one(i); #omp barrier do_step_two(i); }
But gcc complains
convolve_slices.c:21: warning: barrier region may not be closely nested inside of work-sharing, critical, ordered, master or explicit task region.
What do I missunderstand ? How to solve that issue ?
Thanks.