Good morning everybody,
I made some progress in applying these functions to my original problem. However I had some issues when trying to use them in parallel using mpi so I went back to the given examples and had the same troubles.
For ex, with test6.c
When I try to create a portable source code (qcc -D_MPI=1 -O2 -source test6.c) I get the following errors:
./profile6.h:29: error: non-local variable 'g' is modified by this foreach loop:
./profile6.h:29: error: use a loop-local variable, a reduction operation
./profile6.h:29: error: or a serial loop to get rid of this error
(The next step would be to compile the code and I would use :
mpicc -Wall -O2 -std=c99 -D_MPI=1 _test6.c -I/obs/ariviere/basilisk/src -o test6 -lm)
I tried to fix this problem by defining g inside the foreach(), but then there is an other problem about oa being modified while it's a global variable and I don't really know how to solve it.
Similarly, for example_frac-dist.c
trying to compile raises:
./frac-dist.h:27: error: non-local variable 'nr_p' is modified by this foreach loop:
./frac-dist.h:27: error: use a loop-local variable, a reduction operation
./frac-dist.h:27: error: or a serial loop to get rid of this error
which can be solved adding a reduction in the foreach loop.
Since these codes are supposed to work in parallel 'if compiled correctly' my guess is that I'm not doing things properly and that I should not modify them. Can someone explain me where the problem is and what compilation command I should use?
Thank you very much!
Aliénor