CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   size=THREAD_N_ELEMENTS_INT(thread); (http://www.cfd-online.com/Forums/fluent-udf/119175-size-thread_n_elements_int-thread.html)

John Han June 11, 2013 08:20

size=THREAD_N_ELEMENTS_INT(thread);
 
Hello,everyone!
I am an Aisan student learning the UDF on parallel compute.Honestly,it is hard for me knowing C language liitle and the problem confusing me over days.They are :
1.How to use the "compute_node_loop_not_zero*(pe);"and "size=THREAD_N_ELEMENTS_INT(thread);".I read them from the manual help.
2.These are the codes that I write. There may be some problems.Please help me modify them. Thanks a lot!

#if PARALLEL
float *array;
int pe;
int size;/*data passing variables*/
#endif/*PARALLEL*/
#if RP_NODE
float f[16];
array=(float*)malloc(16*sizeof(float));
array=f;
pe=(I_AM_NODE_ZERO_P)?node_host:node_zero;
PRF_CSEND_FLOAT(pe,array,16,myid);
free(array);
if(I_AM_NODE_ZERO_P)
compute_node_loop_not_zero(pe)
{
array=(float*)malloc(16*sizeof(float));
PRF_CRECV_FLOAT(pe,array,16,pe);
PRF_CSEND_FLOAT(node_host,array,16,myid);
free((char*)array);
}
#endif/*RP_NODE*/


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