# parallel version of DEFINE_PROFILE

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 20, 2015, 05:28 parallel version of DEFINE_PROFILE #1 Member   Join Date: Jan 2015 Posts: 31 Rep Power: 2 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 }``` Can someone help me showing the errors? Thanks in advance, philus

April 20, 2015, 07:43
#2
Senior Member

Join Date: Nov 2013
Posts: 699
Rep Power: 9
Quote:
 Originally Posted by philus The UDF is well compiled but the solver don't even interate one time.
But what does it do instead? Give an error? Or does it keep running without ever giving results, as if it were in an endless loop? Or something else?

 April 20, 2015, 07:58 #3 Member   Join Date: Jan 2015 Posts: 31 Rep Power: 2 The window "Running calculation" appears, but nothing happens and Fluent do not responds anymore.

 April 20, 2015, 08:38 #4 Senior Member   Join Date: Nov 2013 Posts: 699 Rep Power: 9 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, 11:08 #5 Senior Member   Andrew Kokemoor Join Date: Aug 2013 Posts: 121 Rep Power: 5 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);` or with the 'ND_ND' macro Code: `real A2[ND_ND];` Either of those will give you a vector of length 2 in 2D and 3 in 3D. Even if you know you'll only be doing 2D, it's good practice.

April 21, 2015, 04:03
#6
Member

Join Date: Jan 2015
Posts: 31
Rep Power: 2
Quote:
 Originally Posted by Kokemoor Two quick clarifying questions: this worked in serial before you added compiler directives, global reductions, and node/host transfers? Also, this is 2D?
Exactly, I modified the serial version by adding the "#if"s. The simulation is 2D.

Quote:
 Originally Posted by Kokemoor 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.
This gives me a problem (cannot compile) because the host doesn't know "f".

Thanks for the hints!

 April 21, 2015, 05:08 #7 Senior Member   Join Date: Mar 2015 Posts: 425 Rep Power: 5 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```

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post wruudf SU2 Installation 1 May 19, 2015 16:25 Yuby OpenFOAM Running, Solving & CFD 10 February 25, 2015 18:57 Ale FLUENT 3 July 23, 2010 15:35 Nikolay FLUENT 2 October 10, 2002 03:42 Michael Schmid CD-adapco 1 November 7, 2001 10:41

All times are GMT -4. The time now is 02:17.

 Contact Us - CFD Online - Top