OF-2.2.x: Can't access cellZones in parallel run
Hi,
I was writing a small functionObject to monitor p and U values in selected cellSets. The sets are created with topoSet and then converted to cellZones with setsToZones. It does all run well in a serial simulation, but not if I try to run it in parallel using mpirun. It will then just think that the cellZones are empty. What I did before, when having to handle cellZones, is that I executed the topoSet and setsToZones in every processor directory explicitly, which seemed to solve the problems. This time that did not solve the problem. I have a guess that just one processor is looped over in my functionObject and not all of them, and that the processors don't communicate in this cellZone loop, as they would in a loop over a volume field. Code:
const fvMesh& mesh(refCast<const fvMesh>(obr_)); The method I chose isn't the most elegant one, but I don't know how I can average in an easier way and I don't know if that even matters, because the cellZones can't be found. Anyone having an idea? |
Problem solved
Found a solution in an old thread in the forums:
Use the reduce() function to assure communication between the processors. In my case this has to be done on the averaged fields. An example is shown below: Code:
reduce(pSumme, sumOp<scalar>()); |
Hi Pete,
Your solution really helps me a lot. Think you very much!:) |
All times are GMT -4. The time now is 15:04. |