|
[Sponsors] |
April 18, 2016, 10:46 |
Sout/Pout: print fields in parallel run
|
#1 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
Hi All,
i am trying to debug my code for parallel run. I just want to print the boundary values of a field i have created within the solver on every processor(lets call it "myField").If I simply do Pout << myField.boundaryField() << nl << endl; the output is very confused becasue OF mixes values from all processor. What i want to do is something like this Code:
scalar n = Pstream::nProcs(); //gives the n° of processors for (int i=0; i<n; i++) { Pout << myField.boundaryField()[i] << nl << endl; wait until it finishes to write data from processor i, then continue to the next processor } Any idea? Best, Andrea |
|
April 18, 2016, 18:38 |
|
#2 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
In your loop you have to make sure that only the processor with the correct number does the output. For this you can use myProcNo() method:
http://openfoamcfd.sourceforge.net/d...stream.html#e6 For synchronizing you can use this approach: http://www.cfd-online.com/Forums/ope...tml#post448769 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Some questions about a multi region case run in parallel | zfaraday | OpenFOAM Running, Solving & CFD | 5 | February 23, 2017 11:25 |
Case running in serial, but Parallel run gives error | atmcfd | OpenFOAM Running, Solving & CFD | 18 | March 26, 2016 13:40 |
Can not run OpenFOAM in parallel in clusters, help! | ripperjack | OpenFOAM Running, Solving & CFD | 5 | May 6, 2014 16:25 |
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel | JR22 | OpenFOAM Running, Solving & CFD | 2 | April 19, 2013 17:49 |
Run in parallel a 2mesh case | cosimobianchini | OpenFOAM Running, Solving & CFD | 2 | January 11, 2007 07:33 |