|
[Sponsors] |
April 20, 2015, 06:28 |
parallel version of DEFINE_PROFILE
|
#1 |
Member
Join Date: Jan 2015
Posts: 40
Rep Power: 11 |
Hi all,
I have transformed my serial UDF with a parallel version looking the UDF manual (the pressure average example). The UDF is well compiled but the solver don't even interate one time. The goal of this UDF is to compute an h value on a boundary from a mean Tw (wall temperature). I paste a simplified version: Code:
DEFINE_PROFILE(name,t,i){ real Tw, T_film; real h; real areatot=0.0; #if !RP_HOST face_t f; real A2[2]; begin_f_loop(f,t){ if(PRINCIPAL_FACE_P(f,t)){ F_AREA(A2,f,t); areatot+=NV_MAG(A2); Tw+=F_T(f,t)*NV_MAG(A2); } } end_f_loop(f,t) # if RP_NODE areatot=PRF_GRSUM1(areatot); Tw=PRF_GRSUM1(Tw); #endif #endif node_to_host_real_2(areatot,Tw); #if !RP_NODE Tw/=areatot; h=Tw*2; #endif host_to_node_real_1(h); #if !RP_HOST begin_f_loop(f,t){ if(PRINCIPAL_FACE_P(f,t)){ F_PROFILE(f,t,i)= h; } } end_f_loop(f,t) #endif } Thanks in advance, philus |
|
April 20, 2015, 08:43 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
||
April 20, 2015, 08:58 |
|
#3 |
Member
Join Date: Jan 2015
Posts: 40
Rep Power: 11 |
The window "Running calculation" appears, but nothing happens and Fluent do not responds anymore.
|
|
April 20, 2015, 09:38 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Strange. I don't know what can cause that.
You might try to simplify your UDF further, and see if that works. For example: only calculate the average temperature, but not assign it to anything. Or: don't calculate the average temperature, and just assign the value 1 to the profile. That might give you information about which part fails. (And minor detail: you did not initialize Tw, but that should not give the problem you see now.) |
|
April 20, 2015, 12:08 |
|
#5 |
Senior Member
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 14 |
Two quick clarifying questions: this worked in serial before you added compiler directives, global reductions, and node/host transfers? Also, this is 2D?
My first try would be to remove the '#if !RP_HOST' around the final loop with 'F_PROFILE'. It seems like that shouldn't cause any problems, but if it isn't necessary, better to leave it out. I'm not certain, but I think global reductions don't need to be protected by compiler directives. You could try removing the '#if RP_NODE' around your 'PRF_GRSUM1's. Definitely not the cause of this issue, but I'd recommend where you define your area vector 'A2' either defining it as a vector Code:
real NV_VEC(A2); Code:
real A2[ND_ND]; |
|
April 21, 2015, 05:03 |
|
#6 | ||
Member
Join Date: Jan 2015
Posts: 40
Rep Power: 11 |
Quote:
Quote:
Thanks for the hints! |
|||
April 21, 2015, 06:08 |
|
#7 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
There are a number of lines in this code, which is a "simplified version" of your actual UDF. You need to determine where the error (or otherwise) is occurring. Start your debugging process by inserting commands to print information to the screen at key steps with the Message() function.
For example: Code:
# if RP_NODE Message("I am node number %d and my total area = %e\n",myid,areatot); areatot=PRF_GRSUM1(areatot); Message("I am node number %d and now my shared total area = %e\n",myid,areatot); Tw=PRF_GRSUM1(Tw); #endif |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error running simpleFoam in parallel | Yuby | OpenFOAM Running, Solving & CFD | 14 | October 7, 2021 05:38 |
Problems when using su2 to solve quick start tutorial in parallel version | wruudf | SU2 Installation | 1 | May 19, 2015 17:25 |
Error during grid building (parallel version) | Ale | FLUENT | 3 | July 23, 2010 16:35 |
Parallel version | Nikolay | FLUENT | 2 | October 10, 2002 04:42 |
Parallel STAR version | Michael Schmid | Siemens | 1 | November 7, 2001 10:41 |