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/)
-   -   how to load UDF in parallel at linux platform (http://www.cfd-online.com/Forums/fluent-udf/123852-how-load-udf-parallel-linux-platform.html)

maye761 September 22, 2013 21:56

how to load UDF in parallel at linux platform
 
The UDF is built and loaded well in windows platform by installing VC++. But when I do the same thing in suse linux or redhat linux, it works well in serial simulation but loading failed in parallel simulation. The hint shows:

The UDF library you are trying to load (libudf/inamd64/3d_host/libudf.so) is not compiled for parallel use on the current platform (lnamd64)
no error
/cae/maye/fluent/test/libudf/lnamd64/3d_host/libudf.so


All gcc (C++&Fortran) of x86_64 has been installed. How can I solve the problem? Shall I install more codes or set any environments? The UDF file is:

#include <stdio.h>
#include "udf.h"
DEFINE_CG_MOTION(wall, dt, vel, omega, time, dtime)
{
if(time<=8.0)
{
vel[2]=-0.75*time;
}
if(time>8.0&&time<=14.0)
{
vel[2]=-6.0;
}
if(time>14.0&&time<=22.0)
{
vel[2]=-6.0+0.75*(time-14.0);
}
if(time>22.0)
{
vel[2]=0.0;
}
Message("\nUDF value: velx=%f",vel[2]);

}

Hershey September 23, 2013 06:58

You need to add compiler directives into your UDF. These go something like this:

#if RP_HOST
/*enter code here*/
#endif

or

#if RP_NODE
/*enter code here*/
#endif

There are others, but I suggest reading through the manual first. This should help you too: http://aerojet.engr.ucdavis.edu/flue...df/node207.htm

maye761 September 23, 2013 21:44

THX!
I tried to modify the UDF file as follows, but the error still there:

#include <stdio.h>
#include "udf.h"

DEFINE_CG_MOTION(wall, dt, vel, omega, time, dtime)
{
#if RP_NODE
if(time<=8.0)
{
vel[2]=-0.75*time;
}
if(time>8.0&&time<=14.0)
{
vel[2]=-6.0;
}
if(time>14.0&&time<=22.0)
{
vel[2]=-6.0+0.75*(time-14.0);
}
if(time>22.0)
{
vel[2]=0.0;
}
#endif
#if RP_HOST
Message("\nUDF value: velx=%f",vel[2]);
#endif
}


How to solve it?

maye761 September 23, 2013 22:02

When I click load, the following errors show:

Node 0: Doesn't have write permissions for libudf/lnamd64/3d_node. If using local disk, make sure UDF lib is synced up on all nodes.
Opening library "/mnt/test/libudf"...
Primitive Error at Node 1: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
/ansys_inc/v145/fluent/bin/libudf/lnamd64/3d_node/libudf.so

Primitive error at Node 0: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (lnamd64).

No such file or directory
/ansys_inc/v145/fluent/bin/libudf/lnam64/3d_node/libudf.so

Opening library "/ansys_inc/v145/fluent/bin/libudf"...
Opening library "/ansys_inc/v145/fluent/bin/libudf"...
Error: The UDF library you are trying to load (libudf/lnam64/3d_host/libudf.so) is not compiled for parallel use on the current platform (lnamd64).

no error
/mnt3/test/libudf/lnamd64/3d_host/libudf.so
Error Object: #f

Virtual-iCFD April 21, 2014 14:04

I am also experiencing the same issue. May I know have you figured out the solution?


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