CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   How to make utilities Parallel aware (

philippose August 11, 2007 12:32

Hello everyone, A good day
Hello everyone,

A good day :-)!

I was wondering.... How does one make a post-processing utility "parallel aware" ? As in... if I have a case which I ran in parallel, with say... 2 or more processors, how do I do post-processing on the data without having to do a "reconstructPar" on the case first?

I know, that for example, during a parallel simulation, if I need to perform a summation on a patch distributed across multiple processors, I can use the "gSum" command instead of the normal "sum" command... this works fine, and makes things really simple.

On the other hand, this does not seem to be working in the case of a post-processing utility... it does not realise that the case was run in parallel.

One lead I have, is the "calcMassFlow" utility available on the OpenFOAM wiki... here, the file "buildGlobalBoundaryList.H" seems to do exactly what I want.... but... it seems to be overly complicated for something which should be simple to achieve or??

Is there any simple way of detecting if a case was run in parallel, and extracting data across processors? Something like the "gSum" alternative to "sum" ??

Hoping something does exist :-)!

Have a nice weekend!


philippose August 12, 2007 17:12

Hello again, Ok.... I have
Hello again,

Ok.... I have finally come up with a utility that is "parallel aware" :-)! Basically, I used ideas from the "reconstructParMesh" utility, to look for and handle multiple processor directories, without actually reconstructing the distributed mesh and data into one mesh again.

As a demonstration of the concept, I integrated it into a utility which calculates the forces due to pressure, on a given set of patches.

The utility now works transparently, with both... serial, and parallel cases. If it finds any processor directories within the case directory, it uses the time / field data within these directories to calculate the forces on the patches, and if there are no processor directories, it carries on happily with the normal dataset available within the case directory.

If anyone else has such a requirement, I would be happy to provide you with the code for the utility.

(I would ofcourse, be delighted if someone would take the code and suggest improvements and point out bugs :-)! )

I am toying with the idea of doing something like this for the paraFoam libraries (vtkFoam) in OpenFOAM, but I think that will be a "longer" term project.


paka August 12, 2007 17:33

Just small comment. Paraview
Just small comment.
Paraview in parallel would be a great idea(!). In my case using that tool right now is a bit pointless...

Actually, I cannot produce any of the movies without any quirks, it takes a long time to create them, and requires weird thing like not using some of the applications in the background, other way it brakes.

For initial view I still stick to Paravie, but for any other postprocessing, data read, etc., I stick to TecPlot.

Regards and thanks for a good work

arynell February 18, 2011 08:15

Solver parallell aware !
Hi philippose !

I am really interested in how you have implemented the processing in your utility. I am about to re write a solver which at "runtime" gives me some parameters regardless if the domain is split into several domains or not. I will be very glad if you provide me the code for that utility :)

Best regards !


mturcios777 October 18, 2011 16:31

I would also appreciate a copy of this code, or perhaps have it posted to the wiki.

kmooney October 20, 2011 09:41

Paraview should be able to detect and actively reconstruct the mesh & fields for viewing.

Under the "Object Inspector" panel there is a "case type" drop down menu. Change that to "Decomposed Case" and hit the Apply button. That should load the decomposed processor# meshes and fields instead of the fields and meshes present in the main case directory.

All times are GMT -4. The time now is 19:40.