|
[Sponsors] |
August 21, 2012, 10:47 |
UDF Parallel problem
|
#1 |
New Member
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 15 |
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); } ----------------------------------------------------------- |
|
August 23, 2012, 15:37 |
|
#2 |
New Member
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 15 |
Plz... help me.
|
|
August 24, 2012, 05:13 |
|
#3 |
Member
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 18 |
What was the error?
|
|
August 24, 2012, 05:19 |
|
#4 |
New Member
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 15 |
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. ---------------------------------------------------------------------------------- |
|
August 24, 2012, 05:22 |
|
#5 |
New Member
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 15 |
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 } ---------------------------------------------------------------------------- |
|
August 24, 2012, 05:26 |
|
#6 |
Member
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 18 |
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). |
|
August 24, 2012, 05:45 |
|
#7 | |
New Member
Jong Hwan Park
Join Date: Oct 2011
Posts: 12
Rep Power: 15 |
Quote:
only parallel occur.. Just before the modification, but the problem still occurs. |
||
August 31, 2012, 09:52 |
|
#8 |
New Member
Anton Khokhlov
Join Date: Aug 2012
Location: Moscow
Posts: 4
Rep Power: 14 |
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. |
|
Tags |
parallel |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem loading UDF library in parallel cluster | Veera Gutti | FLUENT | 8 | July 26, 2016 08:24 |
Parallel UDF problem | Lindsay | FLUENT | 4 | June 20, 2016 10:37 |
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 14:14 |
parallel mode - small problem? | co2 | FLUENT | 2 | June 2, 2004 00:47 |