|
[Sponsors] |
coded functions (for runtime post-processing) fails with parallel run |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
December 2, 2016, 12:22 |
coded functions (for runtime post-processing) fails with parallel run
|
#1 | |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
Dear Foam experts',
here is a coded function to calculate a derived variable using a existiong variable IO object variable sMS1:alpha1. The following quoted text was added in the controlDict, Quote:
In serial running of the solver it performs and does the job. But when executed in parallel the output is always zero. Somebody kindly help. Thanks and regards, cfd@kgp |
||
December 6, 2016, 03:28 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 |
Dear cfd@kgp,
I am not 100% sure about the error but you can check (output) the size of your lookedUp field in serial and parallel. If both are identical, the lookUp command might be different. However, I think you should also use gSum instead of your primitive summing because gSum is the summation function for parallel stuff. Good luck
__________________
Keep foaming, Tobias Holzmann |
|
December 8, 2016, 09:47 |
problem for sMS1:alpha1 in swakExpression due to colon
|
#3 | ||
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
Thanks Tobi!
can you please instuct me further on "check (output) the size of your lookedUp field in serial and parallel" gsum do not work. Quote:
but simple "sum" operation does the job. But problem is partially solved. If the expresion could be written in Swak4Foam then we get a clean output file, with the method of coded function one has to extract the output from LOG file. I found some important hint for using the varibles with colen is to define a alias. refer #13 https://www.cfd-online.com/Forums/op...variables.html please have a look Quote:
Regards, |
|||
December 10, 2016, 19:35 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 |
Hi,
if sum is working, gSum should work too because this is the function for parallel stuff. If you use sum, it should be not possible to run the stuff in parallel. Sent from my HTC One mini using CFD Online Forum mobile app
__________________
Keep foaming, Tobias Holzmann |
|
December 11, 2016, 00:51 |
|
#5 |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
Hi Tobi,
Your argument seem logical Tobi... But sum gives correct answer in parallel too....... I think sum is the compiler based function and thus mpi is already tuned for compiler functions, it should implicitly applies the reduce command. Regards. |
|
December 18, 2016, 05:58 |
coded function which runs in OF3.0.1 fails in OF4.0---no compiling error
|
#6 | ||
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
Quote:
I need your suggestion on this unique problem the coded function which runs in OF3.01 and prints the value of "ANSWER" fails to do so in OF4.0. Here is the extract from the controlDict from one of the above directory Also, please note that there are no errors during comiling the dynamic code in OF4.0 . Code:
Dummy { functionObjectLibs ("libutilityFunctionObjects.so"); type coded; redirectType dummy; outputControl timeStep; code #{ const volScalarField& fl = mesh().lookupObject<volScalarField>("T") ; // volScalarField magU(mag(U)); scalar volIntegral = 0; scalar volIntegralV = 0; forAll (fl, cellI) { volIntegral += fl[cellI]*mesh().V()[cellI]; volIntegralV += 1.0*mesh().V()[cellI]; } volIntegral=volIntegral/volIntegralV; Info<<"ANSWER: " << volIntegral << endl; //foo.write(); #}; Quote:
|
|||
December 18, 2016, 07:11 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 |
Most of the warnings you got are related to the functions dictionary in controlDict and are not related to your coded boundary condition (if I got it right)
Sent from my HTC One mini using CFD Online Forum mobile app
__________________
Keep foaming, Tobias Holzmann |
|
December 18, 2016, 07:23 |
coded function which runs in OF3.0.1 fails in OF4.0---no compiling error
|
#8 | |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
Quote:
|
||
June 12, 2017, 22:54 |
|
#9 |
New Member
Kevin Cole
Join Date: Jun 2016
Location: Durham, NH
Posts: 11
Rep Power: 10 |
cfd@kgp, have you discovered a fix for the function dictionary warnings? I'm not sure how to be rid of them.
|
|
June 13, 2017, 03:27 |
|
#10 |
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
||
November 14, 2017, 04:57 |
|
#11 |
New Member
Join Date: Nov 2017
Location: Germany
Posts: 11
Rep Power: 8 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error running simpleFoam in parallel | Yuby | OpenFOAM Running, Solving & CFD | 14 | October 7, 2021 04:38 |
Some questions about a multi region case run in parallel | zfaraday | OpenFOAM Running, Solving & CFD | 5 | February 23, 2017 10:25 |
Run time post processing vs Post run post processing | pruthvi1991 | OpenFOAM Post-Processing | 1 | February 19, 2015 14:15 |
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel | JR22 | OpenFOAM Running, Solving & CFD | 2 | April 19, 2013 16:49 |
Parallel computation and simultaneous post processing | Armin | OpenFOAM | 9 | December 27, 2010 19:18 |