On Dec 15 2010, Archambault Fabien wrote:
thank you for your answer! Seeing what you gave to me I tried to
modify the parallel loops in order to be more "normal".
Seeing that I checked online and I have seen many examples using that
reduction as I mentioned but in a different way to write the loop
(for example): https://computing.llnl.gov/tutorials/openMP/#REDUCTION
So I modified my test case (see attached file) and now it works! But
I do not understand what is the real difference between both writings.
Because in the Web page, the reduction variable is used ONLY to
calculate the reduction, and its value isn't used for any other purpose
inside the range of the reduction. You are also using it as an index.
If the OpenMP standard had been better, it would have been specified
as a constraint, and you would have got a compilation error.
Regards,
Nick Maclaren.