Hello everyone,
The main problem I face to adapt it to my needs is the data structure of the multigrid solver. To better understand how to access data, I did a very simple test where I run this simple loop after initializing the grid:
foreach()
printf("%d,%g,%g,%g\n",pid(),x,y,z);
I used different number of processors in 3D on a 8*8*8 case (Level = 3) and obtain the following behaviour:
- 1 processor: returns 512 lines as expected -> all data are accessible
- 8 processor: each processor returns 64 lines as expected -> all data are accessible by compiling all processors data
- 27 processor: each processor returns 8 lines -> some of the data is not accessible as 27*8=212<512.
So the conclusion is that when Ncells/Nproc is not an integer, then I cannot access to all the data in a foreach loop.
I would like to better understand why is it the case and how I could access to all the data points in the case of 27 processors.
Note that I am aware of the fact that the number of processors should be a cubic for multigrid (hence the choice of 3^3=27). But this restriction does not allow to always have Ncells/Nproc as an integer for larger cases (my target case is uses 512^3 points and 729 processors).
Does anyone have an explanation or a link to documentation to explain this behaviour?
I hope the question is clear,
Best,
Victor