CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Differences of parallel UDF for Fluent 6.3 and 13 (https://www.cfd-online.com/Forums/fluent-udf/106622-differences-parallel-udf-fluent-6-3-13-a.html)

 didiean September 3, 2012 21:09

Differences of parallel UDF for Fluent 6.3 and 13

Hello everyone~
I am doing some calculation on dynamic meshes using DEFINE_GRID_MOTION which runs well for Fluent 13 on a Unix Cluster. In this UDF, I have defined several sub functions, and in the DEFINE_GRID_MOTION function, besides the usual dynamic mesh phrases, I have used fprintf like:

r_te=sqrt(r2[0]*r2[0]+r2[1]*r2[1]);
if((fabs(r_te-R0)<pow(10.0,-3.0))&& (fabs(r2[2]-(0.5*(Z_2+Z_3)))<0.008)) /*only record the angle of mid line which is concurrent with other positions*/
{
d_te=sqrt((R0*cos(in_a)-r2[0])*(R0*cos(in_a)-r2[0])+(R0*sin(in_a)-r2[1])*(R0*sin(in_a)-r2[1]));

if(r2[1]<(R0*sin(in_a)))
theta_te=-2.0*asin(0.5*d_te/R0)*180.0/M_PI;
else
theta_te=2.0*asin(0.5*d_te/R0)*180.0/M_PI;

fp=fopen("TE_place.txt","a+");
fprintf(fp,"\n%.8f %.8f %.8f %.8f %.8f %.8f",time,r2[0],r2[1],r2[2],r_te,theta_te);
fclose(fp);

But recently, when I try the UDF for Fluent6.3, errors appear as Follows. The UDF could be compiled and loaded well, but when start running errors come out. When parallelizing the UDF, I Just put if !RP_HOST and #endif in every function's beginning and ending. I don't know the differences of UDF for Fluent6.3 and Fluent13. Hope I have describe the question clearly. Could anyone please help me out? Any comment is appreciated. Thank you!

================================================== ============================
Stack backtrace generated for node id 6 on signal 11 :
Please include this information with any bug report you file on this issue!
================================================== ============================

/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26[0xef1081]
/lib64/libc.so.6[0x3b3ce302d0]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(new_v+0x11)[0x5fadff]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Fill_Exterior_Nodes+0x2182)[0xaf65bc]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26[0xaf2379]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Create_Neighborhood+0x179)[0xaf059d]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Clear_Sliding_Interfaces+0x23d)[0x984489]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Dynamic_Mesh_Clear_Sliding_Inter faces+0x34)[0xbeac6a]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Pre_Update_Dynamic_Mesh+0xdd)[0xbeac0d]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Update_Grid+0x67)[0x563725]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Update_Physical_Time+0x7c9)[0x562c95]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26[0x5c0a2d]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(eval+0x773)[0xf046c3]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(PRF_Command_Start+0xea6)[0x5e5022]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(PRF_Node_repl+0x2e)[0x5e4146]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(main+0x62)[0xc60762]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26[0xef1081]
/lib64/libc.so.6[0x3b3ce302d0]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(new_v+0x11)[0x5fadff]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Fill_Exterior_Nodes+0x2182)[0xaf65bc]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26[0xaf2379]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Create_Neighborhood+0x179)[0xaf059d]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Clear_Sliding_Interfaces+0x23d)[0x984489]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Dynamic_Mesh_Clear_Sliding_Inter faces+0x34)[0xbeac6a]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Pre_Update_Dynamic_Mesh+0xdd)[0xbeac0d]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Update_Grid+0x67)[0x563725]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(Update_Physical_Time+0x7c9)[0x562c95]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26[0x5c0a2d]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(eval+0x773)[0xf046c3]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(PRF_Command_Start+0xea6)[0x5e5022]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(PRF_Node_repl+0x2e)[0x5e4146]
/opt/Fluent.Inc/fluent6.3.26/lnamd64/3ddp_node/fluent_mpi.6.3.26(main+0x62)[0xc60762]

================================================== ============================
Stack backtrace generated for node id 5 on signal 11 :
Please include this information with any bug report you file on this issue!
================================================== ============================

Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
Warning: No xauth data; using fake authentication data for X11 forwarding.
fluent_mpi.6.3.26: Rank 0:1: MPI_Send: MPI BUG: no requests done
MPI Application rank 1 exited before MPI_Finalize() with status 1
Killed by signal 15.

999999 (../../src/mpsystem.c@1123): mpt_read: failed: errno = 104

999999: mpt_read: error: read failed trying to read 30 bytes: Connection reset by peer
The fluent process could not be started.

 didiean September 4, 2012 11:33

Could anyone be so kind to help me out?
If I run serial UDF on the same cluster, no error appears.
If I run parallel UDF on the same cluster using Fluent 13, no error appears.
For parallel UDF of Fluent 6.3, what's the difference?
I will try to delete the sub function, will it be helpful?

 nadesan March 24, 2013 22:57

hi didiean,

Hope you could help me on my problem. I have a parallel udf written for 3D open channel flow ( a fully developed parabolic profile throughout the domain). There is no problem while compiling and loading my udf code. But there is a problem while solution initialization. Following is my code.

#include "udf.h"
#include "metric.h"
#include "mem.h"
#define ymax 0.001
DEFINE_INIT(flow_field,d)
{
#if !RP_HOST
face_t f;
Thread *tf;
real x[ND_ND];
real y;
/**loop over all face threads in the domain**/
thread_loop_f(tf,d)
{
/**loop over all faces in the face thread**/
begin_f_loop(f,tf)
if PRINCIPAL_FACE_P(f,tf)
{
F_CENTROID(x,f,tf);
y=x[1];
F_U(f,tf)=(ymax+y)*(ymax-y)*48.6/(ymax*ymax);
F_V(f,tf)=0.0;
F_W(f,tf)=0.0;
}
end_f_loop(f,tf)
}
#endif
}

and the error generated while initializing solution is

"stack backtrace generated for node id=0 (pid=17332) on signal 11"
.
.
.
.
.
.
.
.
.
.

999999: mpt_read:error:read failed trying to read 4 bytes: Resource temporarily unavailable.
The fluent process could not be started
....

Can you please help me on this. I have been stuck to this problem for more than a week

Thank you

Rgds

Nadesan

 vasava March 25, 2013 06:35

The default mesh partition method in fluent is 'metis'. Try using some other mesh partition method.

Also try this.
1. Initialize your case.
2. Run your case for very few iterations (e.g. 2-5) without hooking up the UDF.
3. Hookup the udf and then run.

 nadesan March 25, 2013 06:38

hi vasava,

thank you for the reply .. ll try it out

rgds
nadesan

 vasava March 25, 2013 06:49

Hello nadesan

Of course you can try this. But this is not solution to your problem. I am still looking if I can find something for you.

Let me know how it goes.

 vasava March 25, 2013 07:48

There could be another issue. Do you have Fluent 6 in 64-bit or 32-bit?

 nadesan March 25, 2013 07:49

hi vasava,

i am using linux64 FLUENT 12.0

rgds
Nadesan

 vasava March 25, 2013 08:43

Try this. Change DEFINE_INIT(flow_field,d) to DEFINE_INIT(flow_field,domain).

If this does not work then I think your UDF have issues with pointer. I am no expert on this topic but you have issue with where your condition must be applied.

 nadesan March 25, 2013 22:37

hi vasava,

Thank you so much for your effort. I did contact my system administrator, and found that that there is a problem with distributed memory allocation to the cluster. It seems that the udf were not read by all the partitioned nodes. It was read by only certain nodes. I fixed the error by using my code in serial processor and then fed the case and data file to the high performance parallel computing facility. It works well now.

Rgds
Nadesan

 All times are GMT -4. The time now is 00:09.