CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Fluent is stuck after data transfer to nodes?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2022, 10:28
Default Fluent is stuck after data transfer to nodes?
  #1
Member
 
Mohammad Shafiee
Join Date: Apr 2021
Posts: 30
Rep Power: 7
Mohammad74 is on a distinguished road
Hi,

I've encountered another problem with data transfer from the host to the nodes. Lets assume my code looks something like this:

Code:
DEFINE_ADJUST(name,libname)
{
   real a[4], b[4], c[4], V ;
   #if !RP_HOST
   /*I use nodes to calculate V*/
   #endif /*!RP_HOST*/
   node_to_host_real_1(V) ;
   #if !RP_NODE
   /* I use V to calculate a & b on the host process*/
   #endif /*!RP_NODE*/
   host_to_node_real(a,4) ;         /*solution is stuck here*/
   host_to_node_real(b,4) ;
   Message0("\n a[1] = %f\n", a[1]) ;      /*This line is not executed*/
   #if !RP_HOST
   /*Use a & b to calculate c on the nodes*/
   #endif /*!RP_HOST*/
}
All of the above works fine (a and b are filled with real numbers), until it reaches the first line with red comment and the solver gets stuck there without giving any errors whatsoever (I have to actually end the fluent process to force it to exit). Also, I'm not getting any errors during compilation. Whats wrong here? or how can I debug this since I'm not getting any errors?
Mohammad74 is offline   Reply With Quote

Old   July 1, 2022, 03:10
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
the code you've showed seems to be correct.

issue could be with memory allocation.
you may check your arrays on the host with message macro
Code:
Message("\n a[1] = %f\n", a[1]) ;
if nothing works, fortunately our arrays has just 4 elements in each, so you may create separate variables for them and transfer to nodes separately
Mohammad74 likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   July 1, 2022, 07:23
Default
  #3
Member
 
Mohammad Shafiee
Join Date: Apr 2021
Posts: 30
Rep Power: 7
Mohammad74 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
you may check your arrays on the host with message macro
Code:
Message("\n a[1] = %f\n", a[1]) ;
Thank you for answering,
but I did check them before posting my problem here. I can print the array elements from the host process, transfering them to nodes though, is not working properly for some reason.
Mohammad74 is offline   Reply With Quote

Old   July 3, 2022, 18:09
Default
  #4
Member
 
Mohammad Shafiee
Join Date: Apr 2021
Posts: 30
Rep Power: 7
Mohammad74 is on a distinguished road
Update:

So, as a work around, instead of using "host_to_node_real" function, I used "PRF_CSEND_REAL(node_zero, &a, 4, myid)" to send the data from the host and then used "PRF_CRECV_REAL(host, &a, 4, host)" to receive it on the node_0. But now during compilation, I'm getting the "undeclared identifier" error for the host parameter. And I'm stuck again! :/

How to fix this?
Mohammad74 is offline   Reply With Quote

Old   July 3, 2022, 19:04
Default
  #5
Member
 
Mohammad Shafiee
Join Date: Apr 2021
Posts: 30
Rep Power: 7
Mohammad74 is on a distinguished road
Quote:
Originally Posted by Mohammad74 View Post
I'm getting the "undeclared identifier" error for the host parameter. And I'm stuck again! :/
After looking through para.h file from the fluent installation directory, I realized the correct variable that shows the host id is "node_host" not "host" (a mistake in udf manual). so the correct form is :
Code:
PRF_CRECV_REAL(node_host, &a, 4, node_host) ;
Which is then compiled with no errors.

However, using these "low level message passing macros" did not solve my problem mentioned in the beginning of this thread. Solver is still stuck at executing them
Mohammad74 is offline   Reply With Quote

Reply

Tags
parallelization, udf crash


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
Fluent Tutorial on Heat transfer Far FLUENT 15 July 29, 2017 16:31
Animation of Fluent data with paraview Lilly FLUENT 1 June 26, 2016 17:07
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 14:41
Fluent crash on writing data file after thousand iterations Chuck87 FLUENT 0 September 2, 2015 17:17


All times are GMT -4. The time now is 15:49.