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

how to use PRF_CSEND/PRF_CRECV to replace host_to_node?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 13, 2016, 12:36
Default how to use PRF_CSEND/PRF_CRECV to replace host_to_node?
  #1
New Member
 
liuyan
Join Date: May 2013
Posts: 14
Rep Power: 13
blgypeng is on a distinguished road
my variables difine in udf,
real rsec[10][20]; /*Normalizes radius from GUI*/
real csec[10][20];
real twst[10][20]; /*Twist*/
char type[10][20][30]; /*Profile type name */

int fzon[10]; /*Rotor face zone ID*/
int nsec[10]; /*Number of blade sections along span*/

i need to transfer data from host to node,One-dimensional array fzon and nsec can use host_to_node to tranfer data,for example
host_to_node_int(fzon,10),host_to_node_int(nsec,10 ),
but the two-dimensional array and three-dimension array can be not.

In UDF manul,this description is that,
"Note that the higher-level communication macros expand to functions that perform a number of lowerlevel message passing operations which send sections of data as single arrays from one process to another process. These lower-level message passing macros can be easily identified in the macro name by the characters SEND and RECV. Macros that are used to send data to processes have the prefix PRF_CSEND, whereas macros that are used to receive data from processes have the prefix PRF_CRECV. Data that is to be sent or received can belong to the following data types: character (CHAR), integer(INT), REAL and logical (BOOLEAN). BOOLEAN variables are TRUE or FALSE. REAL variables are assigned as float data types when running a single precision version of ANSYS Fluent and double when running double precision. Message passing macros are defined in the prf.h header file and are listed
below.
/* message passing macros */
PRF_CSEND_CHAR(to, buffer, nelem, tag)
PRF_CRECV_CHAR (from, buffer, nelem, tag).
There are four arguments to the message-passing macros. For ‘send’ messages:
• to is the node ID of the process that data is being sent to.
• buffer is the name of an array of the appropriate type that will be sent.
• nelem is the number of elements in the array.
• tag is a user-defined message tag. The tag convention is to use myid when sending messages."

I dont know how to use PRF_CSEND or PRF_CRECV macros?Does anyone can tell me how to use PRF macro transfer two dimension or three dimension array variables from host to node?
Thanks!
blgypeng is offline   Reply With Quote

Old   June 13, 2016, 19:29
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
The example on "Message Passing" in the UDF manual explains how to send and receive arbitrary sized arrays between compute nodes. You should be able to use the same logic with exchanging with node_host as well.
`e` is offline   Reply With Quote

Old   June 18, 2016, 22:12
Default
  #3
New Member
 
liuyan
Join Date: May 2013
Posts: 14
Rep Power: 13
blgypeng is on a distinguished road
Thanks for your reply,i will read the mannual about the message pass.
blgypeng is offline   Reply With Quote

Old   June 18, 2016, 22:13
Default
  #4
New Member
 
liuyan
Join Date: May 2013
Posts: 14
Rep Power: 13
blgypeng is on a distinguished road
Quote:
Originally Posted by `e` View Post
The example on "Message Passing" in the UDF manual explains how to send and receive arbitrary sized arrays between compute nodes. You should be able to use the same logic with exchanging with node_host as well.
Thanks for your reply,i will read the mannual about the message passing example.
blgypeng is offline   Reply With Quote

Reply


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
UDF to replace mesh siamak1438 FLUENT 0 March 26, 2015 03:58
[ICEM] replace geometry kmgraju ANSYS Meshing & Geometry 1 January 5, 2015 10:59
Running out of UDMI, what can in use to replace it ? Sdvk Fluent UDF and Scheme Programming 0 May 23, 2014 14:16
Replace H equation with Teqn in chtMultiregionFoam OF 2.3 Moncef OpenFOAM Running, Solving & CFD 0 May 22, 2014 21:37
run f;uent job in batch mode? jx FLUENT 5 July 2, 2003 12:29


All times are GMT -4. The time now is 01:47.