24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1078  |  回复: 10
当前主题已经存档。

soaring1651

银虫 (小有名气)

[交流] 【求助】fluent并行计算UDF求助

现有两台同样配置的计算机。windows server2003系统。
想要并行计算,需要UDF。
自己的程序还没编好,就copy帮助文件中的实验,结果老是出现fatal error。
非常无奈,求助高手指点多机并行时UDF载入方法。
QQ:419222040。随时候教,望高手不吝指教。
回复此楼
贫富天命,成败由它
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

soaring1651

银虫 (小有名气)

32位系统。fluent 6.3.26/fluent 12
贫富天命,成败由它
2楼2009-12-24 12:04:47
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zwenzhi

金虫 (小有名气)

我也遇到了和你一样的问题,我是XP系统,但是UDF就是有问题,,,期待高人解决
3楼2009-12-27 13:33:03
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hakekill

木虫 (小有名气)


nono2009(金币+1,VIP+0):谢谢参与!欢迎常来仿真模拟版交流。 12-29 12:50
nono2009(金币+0,VIP+0):欢迎去投票,寻找更多同行,同时领取金币。http://emuch.net/bbs/viewthread.php?tid=1649328 12-29 12:50
我做过多核的udf,和单核的区别不大。

你最好是把udf发出来看看
4楼2009-12-29 12:47:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

茗跃

金虫 (著名写手)

品茗未来,飞跃自己。


nono2009(金币+1,VIP+0):Thanks for the comments. 12-29 15:53
微软公司的人员专门给我们公司做过这个方面的测试
两台并行的速度是一台的1.5倍
四台为单台的2倍
学习是一个永恒的主题。
5楼2009-12-29 15:31:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

soaring1651

银虫 (小有名气)

是帮助文件中的UDF,不知会不会涉及版权,不管了,发。

★ ★
nono2009(金币+2,VIP+0):谢谢分享! 12-30 12:21
引用回帖:
Originally posted by hakekill at 2009-12-29 12:47:
我做过多核的udf,和单核的区别不大。

你最好是把udf发出来看看

#include "udf.h"

# define FLUID_ID 2

DEFINE_ON_DEMAND(pressures_to_file)
{
  /* Different variables are needed on different nodes */
#if !RP_HOST
Domain *domain=Get_Domain(1);
Thread *thread;
cell_t c;
#else
int i;
#endif

#if !RP_NODE
FILE *fp = NULL;
char filename[]="press_out.txt";
#endif

#if PARALLEL
int size;  /* data passing variables */
real *array;
int pe;
#endif
/* Only Serial and Compute Nodes have data on threads */
#if !RP_HOST
thread=Lookup_Thread(domain,FLUID_ID);
#endif

#if !RP_NODE /* SERIAL or HOST */
if ((fp = fopen(filename, "w")==NULL)
       Message("\n Warning: Unable to open %s for writing\n",filename);
else
       Message("\nWriting Pressure to %s...",filename);
#endif
/* UDF Now does 3 different things depending on SERIAL, NODE or HOST */

#if !PARALLEL /* SERIAL */
begin_c_loop(c,thread)
   fprintf(fp, "%g\n", C_P(c,thread));/* Simply write out pressure data */
end_c_loop(c,thread)
#endif /* !PARALLEL */

#if RP_NODE
/* Each Node loads up its data passing array */
size=THREAD_N_ELEMENTS_INT(thread);
array = (real *)malloc(size * sizeof(real));

begin_c_loop_int(c,thread)
   array[c]= C_P(c,thread);
end_c_loop_int(c,thread)
   /* Set pe to destination node */
   /* If on node_0 send data to host */
   /* Else send to node_0 because */
   /*   compute nodes connect to node_0 & node_0 to host */
pe = (I_AM_NODE_ZERO_P) ? node_host : node_zero;

PRF_CSEND_INT(pe, &size, 1, myid);
PRF_CSEND_REAL(pe, array, size, myid);

free(array);/* free array on nodes after data sent */

/* node_0 now collect data sent by other compute nodes */
/*   and sends it straight on to the host */
if (I_AM_NODE_ZERO_P)
   compute_node_loop_not_zero (pe)
   {
     PRF_CRECV_INT(pe, &size, 1, pe);
     array = (real *)malloc(size * sizeof(real));
     PRF_CRECV_REAL(pe, array, size, pe);
        
     PRF_CSEND_INT(node_host, &size, 1, myid);
     PRF_CSEND_REAL(node_host, array, size, myid);
        
     free((char *)array);
   }
#endif /* RP_NODE */

#if RP_HOST
compute_node_loop (pe) /* only acts as a counter in this loop */
   {
     /* Receive data sent by each node and write it out to the file */
     PRF_CRECV_INT(node_zero, &size, 1, node_zero);
     array = (real *)malloc(size * sizeof(real));
     PRF_CRECV_REAL(node_zero, array, size, node_zero);
     for (i=0; i        fprintf(fp, "%g\n", array);

     free(array);
   }
#endif /* RP_HOST */


#if !RP_NODE /* SERIAL or HOST */
fclose(fp); /* Close the file that was only opened if on SERIAL or HOST */
Message("Done\n";
#endif

}



ps:正版软件,服务期内,只是原公司被收购了。然后不理我,悲剧呀!
贫富天命,成败由它
6楼2009-12-30 12:12:56
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hakekill

木虫 (小有名气)

★ ★
nono2009(金币+2,VIP+0):谢谢应助! 12-30 16:45
引用回帖:
Originally posted by soaring1651 at 2009-12-30 12:12:

#include "udf.h"

# define FLUID_ID 2

DEFINE_ON_DEMAND(pressures_to_file)
{
  /* Different variables are needed on different nodes */
#if !RP_HOST
Domain *domain=Get_Domain(1 ...

我在4核的机子上运行了一下,可以正常加载,也能正常的导出压力值。

如果你的不行的话,可能是环境的不同,我这边没有多机并行环境,没办法帮你
7楼2009-12-30 16:37:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

soaring1651

银虫 (小有名气)

多核与多机不同,我多核也能运行

nono2009(金币+0,VIP+0):建议通过PM或“引用回复该帖”,以便别人及时收到你的message. 12-31 17:04
无论如何都谢谢你,欢迎继续关注。
贫富天命,成败由它
8楼2009-12-31 08:56:17
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhaoshujie

铜虫 (小有名气)

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
soaring1651(金币+10,VIP+0):好的谢谢 1-5 20:17
soaring1651(金币+5,VIP+0): 1-8 16:01
我做的和你相似, 咱们可以私下联系, 我的QQ582327121
9楼2010-01-05 20:14:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhaoshujie

铜虫 (小有名气)

谢谢拉

★ ★ ★ ★ ★
soaring1651(金币+5,VIP+0): 1-8 16:01
引用回帖:
Originally posted by zhaoshujie at 2010-1-5 20:14:
我做的和你相似, 咱们可以私下联系, 我的QQ582327121

谢谢啦,呵呵
10楼2010-01-05 20:23:47
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 soaring1651 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见