Problem writing data file
I'm trying write the values of a variable through of an UDF. I'm run the case on a Cluster with linux platform. My UDF is:
real vel_u, axis;
real Xinit = 0.05;
real flow_time = CURRENT_TIME;
fp = fopen("vol_gas.txt","w");
domain = Get_Domain(1);
Xs = Xinit;
Xs = Xinit + Utb*flow_time;
vel_u = C_U(cell,thread);
vol_tot += C_VOLUME(cell,thread);
if(X>=Xs && vel_u>=0.)
sum_vel += C_UDSI(cell,thread,0)*C_U(cell,thread)*C_UDSI(cell ,thread,3);
vol_gas += C_UDSI(cell,thread,0)*C_UDSI(cell,thread,3);
fprintf(fp,"vg: %g X: %g um: %g\n", vol_gas, axis, sum_vel);
Utb = sum_vel/vol_gas;
printf("Volume total: %g\n", vol_tot);
printf("Volume gas: %g\n", vol_gas);
printf("volume integral: %g\n", sum_vel);
printf("Velocity of the Taylor bubble: %g\n", Utb);
printf("Distance step: %g\n", Xs);
When I load the UDF compiled, the message is:
The UDF library is not compiled for parallel use on the current platform (lnam64).
I think that the error is in the printf, fprintf, fopen and fclose commands, due to when I compile and then load the UDF without this commands, it works well.
Moreover, when I run the case with this UDF on the Windows 64 bit platform, also works well.
Anyone know what could be the problem?, when I run the case on Linux platform (cluster).
As it is clearly specified in UDF manual you should write to file only from host. You will face the same problem running this code on Windows cluster (or even simply in parallel).
Thank you very much for your reply.
|All times are GMT -4. The time now is 06:45.|