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

UDF Parallel problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 21, 2012, 09:47
Default UDF Parallel problem
  #1
New Member
 
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 5
startup0820 is on a distinguished road
Hello! Guys!

Thanks to you, I was able to complete the UDF.

Is not a problem in the serial condition, but an error occurs in the parallel condition.

If you know Please advise me.

Thanks for your help everytime.

FLUENT 14, 64bit

-------------------------------------------------------------------


#include "udf.h"

#include "dpm.h"

DEFINE_EXECUTE_AT_END(MonkeyMagic)

{

CX_Cell_Id *c;

cell_t ct;

Thread *t;

real x[3] = {0.0, 0.0, 0.0};

real W_Velocity;

int N,i;

FILE *output,*points;

Domain *d = Get_Domain(1);

points = fopen("points.txt","r");

output = fopen("results.out","a");

fscanf(points,"%d \n",&N);



for ( i=0;i<N;i++ )

{

fscanf(points,"%e%e%e\n",&x[0],&x[1],&x[2]);

SV_locate_point(x,c);

ct = c->ct.c;

t = c->ct.t;

C_CENTROID(x, ct, t);

W_Velocity=C_W(ct,t);

fprintf(output, "%.6f\n",W_Velocity);

}

fclose(output);

fclose(points);

}


-----------------------------------------------------------
startup0820 is offline   Reply With Quote

Old   August 23, 2012, 14:37
Default
  #2
New Member
 
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 5
startup0820 is on a distinguished road
Plz... help me.
startup0820 is offline   Reply With Quote

Old   August 24, 2012, 04:13
Default
  #3
Member
 
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 8
Daniel Tanner is on a distinguished road
What was the error?
Daniel Tanner is offline   Reply With Quote

Old   August 24, 2012, 04:19
Default
  #4
New Member
 
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 5
startup0820 is on a distinguished road
I got the following error.


----------------------------------------------------------------------------------
999999 (..\src\mpsystem.c@1173): mpt_read: failed: errno = 10054

999999: mpt_read: error: read failed trying to read 4 bytes: No such file or directory
MPI Application ranMk PI Appli0 ecatxiiotedn r beank fore4 ex ited bMPIefor_Fie naliMzeP() Iwit_h sFtaituns a-lize() with status 107-10737374181941819

The Parallel FLUENT process could not be started.
----------------------------------------------------------------------------------
startup0820 is offline   Reply With Quote

Old   August 24, 2012, 04:22
Default
  #5
New Member
 
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 5
startup0820 is on a distinguished road
Quote:
Originally Posted by Daniel Tanner View Post
What was the error?
I got the following error.


----------------------------------------------------------------------------------
999999 (..\src\mpsystem.c@1173): mpt_read: failed: errno = 10054

999999: mpt_read: error: read failed trying to read 4 bytes: No such file or directory
MPI Application ranMk PI Appli0 ecatxiiotedn r beank fore4 ex ited bMPIefor_Fie naliMzeP() Iwit_h sFtaituns a-lize() with status 107-10737374181941819

The Parallel FLUENT process could not be started.
----------------------------------------------------------------------------------



Changed as follows. However, the error has occurred.

---------------------------------------------------------------------------------
#include "udf.h"
#include "dpm.h"


DEFINE_EXECUTE_AT_END(MonkeyMagic)

{
#if !RP_HOST
CX_Cell_Id *c;
cell_t ct;
Thread *t;
Domain *d = Get_Domain(1);
#endif


real x[3] = {0.0, 0.0, 0.0};
real W_Velocity;
int N,i;


#if !RP_NODE
FILE *output,*points;
points = fopen("points.txt","r");
output = fopen("results.txt","a");
#endif

#if !RP_NODE
fscanf(points,"%d \n",&N);
#endif

for ( i=0;i<N;i++ )

{
#if !RP_NODE
fscanf(points,"%e%e%e\n",&x[0],&x[1],&x[2]);
#endif

#if !RP_HOST
SV_locate_point(x,c);

ct = c->ct.c;

t = c->ct.t;

C_CENTROID(x, ct, t);

W_Velocity=C_W(ct,t);
#endif


node_to_host_float_1(W_Velocity);


#if !RP_NODE
fprintf(output, "%.6f\n",W_Velocity);
#endif
}
#if !RP_NODE
fclose(output);
fclose(points);
#endif
}
----------------------------------------------------------------------------
startup0820 is offline   Reply With Quote

Old   August 24, 2012, 04:26
Default
  #6
Member
 
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 8
Daniel Tanner is on a distinguished road
Maybe this is the problem.

real x[3] = {0.0, 0.0, 0.0};

The index starts at 0 so this has four elements (0,1,2,3).
Daniel Tanner is offline   Reply With Quote

Old   August 24, 2012, 04:45
Default
  #7
New Member
 
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 5
startup0820 is on a distinguished road
Quote:
Originally Posted by Daniel Tanner View Post
Maybe this is the problem.

real x[3] = {0.0, 0.0, 0.0};

The index starts at 0 so this has four elements (0,1,2,3).
but the problem does not occur in the serial interpretation,.

only parallel occur..

Just before the modification, but the problem still occurs.
startup0820 is offline   Reply With Quote

Old   August 31, 2012, 08:52
Default
  #8
New Member
 
Anton Khokhlov
Join Date: Aug 2012
Location: Moscow
Posts: 4
Rep Power: 4
antonk67 is on a distinguished road
Writing the parallel code you should be aware about a lot of things. In your case think about the following:
1) you can write only from host, but you can read from any node
2) if you have the distributed memory, it means that the data read at only one node should be send to another or all others to be available there. Otherwise you will have the default value or uninitialised value.
3) the cell you are seeking can be located on the other node.
4) maybe I am wrong, but it sounds like your seek function is for the oct-tree mesh.
antonk67 is offline   Reply With Quote

Reply

Tags
parallel

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel interDyMFoam cellLevel problem tgvosk OpenFOAM Running, Solving & CFD 5 February 19, 2014 03:24
UDF parallel Lucy Fluent UDF and Scheme Programming 3 May 28, 2013 13:14
problem loading UDF library in parallel cluster Veera Gutti FLUENT 7 July 3, 2011 09:15
Parallel UDF problem Lindsay FLUENT 0 November 7, 2008 05:31
parallel mode - small problem? co2 FLUENT 2 June 1, 2004 23:47


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