|
[Sponsors] |
July 3, 2014, 07:14 |
RP_Set_Integer does not work in parallel
|
#1 |
New Member
Manuel
Join Date: Jan 2014
Posts: 18
Rep Power: 12 |
Hello everyone.
I have some code where I need to change a RP variable from an UDF ON_DEMAND. I need the macro RP_Set_Integer. Well, it does not work in parallel, even protecting it with the #if !RP directives. I have tried it on Fluent 14.5.0, both in Windows and in Linux. What I say can be tried without a mesh or case files. Just start Fluent, compile and load the following UDF: Code:
#include "udf.h" #include "prf.h" #include "para.h" DEFINE_ON_DEMAND(actualize_rp) { #if !RP_NODE RP_Set_Integer("myrpvar",30); #endif } Code:
(rp-var-define 'myrpvar -10 'integer #f) (rpgetvar 'myrpvar) /define/ud/eod "actualize_rp::libudf" (rpgetvar 'myrpvar) Code:
[Output in serial] > (rp-var-define 'myrpvar -10 'integer #f) myrpvar > (rpgetvar 'myrpvar) -10 > /define/ud/eod "actualize_rp::libudf" > (rpgetvar 'myrpvar) -30 [Output in parallel] > (rp-var-define 'myrpvar -10 'integer #f) myrpvar > (rpgetvar 'myrpvar) -10 > /define/ud/eod "actualize_rp::libudf" > (rpgetvar 'myrpvar) -10 In other thread similar problem has been reported:http://www.cfd-online.com/Forums/flu...able-name.html; but I think that this does not help me because I am struggling just with the host, the nodes do not play at all. The ultimate target of this is that I need to perform time-step iterations until the flow reaches a certain condition. For that, I have an scheme do-loop in which: -iterate 25 more time steps -execute an on_demand function, which will check if the condition I need is met: if so, it will set variable rp_end_loop to 1 -if rp_end_loop is 1, end loop; else, repeat steps. My on_demand function evaluates properly the conditions to be met (with function Message, information is displayed in console and it is stated when the loop should end), but this loop will never end because it fails to actualize the rp variable!!! I comment this in case someone can think of any other way of passing information from an UDF to scheme console (in any form which could be evaluated as a boolean, rp variable, scheme variable, whatever). If someone does not know how to make this RP_Set_Integer work, but knows some another workaround for my problem, I'd be extremely grateful. Help please!!! I really need this, I can't continue my work until I solve this... and serial calculation is not affordable. Thanks in advance |
|
July 3, 2014, 09:07 |
|
#2 |
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17 |
Hello Manuel,
welcome into the strange world of Fluent's scheme environment. Don't ask me why, but using (%rpgetvar 'myrpvar) will do the trick. cheers |
|
July 3, 2014, 12:37 |
|
#3 |
New Member
Manuel
Join Date: Jan 2014
Posts: 18
Rep Power: 12 |
Enormous thanks, coglione.
I could continue. That trick solved the issue in the UDF I have posted. However, I realized that in my code it wasn't working. I then realize that apparently, every fluent/scheme command in a "do loop" should be introduced as (ti-load-menu-string "command"). Sounds ridiculous. I really find lisp/scheme so unfriendly and tedious... But, I repeat again, thanks a lot! I could continue thanks to you |
|
Tags |
parallel, rp variables, scheme, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any Parallel install procedure on Mac OS | JinZhiyi | SU2 Installation | 2 | March 11, 2014 02:12 |
Parallel processing problem | newbie29 | OpenFOAM Running, Solving & CFD | 1 | June 22, 2012 05:23 |
CFX parallel multi-node jobs fail w/ SLURM on Ubuntu 10.04 | danieru | CFX | 0 | February 17, 2012 07:20 |
HP MPI warning...Distributed parallel processing | Peter | CFX | 10 | May 14, 2011 07:17 |
Cases with small length scale work fine on a single processor but fail in parallel | adona058 | OpenFOAM Bugs | 5 | April 17, 2009 05:41 |