24小时热门版块排行榜    

查看: 1372  |  回复: 10
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

soaring1651

银虫 (小有名气)

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

现有两台同样配置的计算机。windows server2003系统。
想要并行计算,需要UDF。
自己的程序还没编好,就copy帮助文件中的实验,结果老是出现fatal error。
非常无奈,求助高手指点多机并行时UDF载入方法。
QQ:419222040。随时候教,望高手不吝指教。
回复此楼
贫富天命,成败由它
已阅   回复此楼   关注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的回帖
查看全部 11 个回答

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的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 面上合作单位盖章 +6 ssyjh 2026-08-27 9/450 2026-09-01 20:01 by huagongfeihu
[基金申请] 面上函评意见出来了,像什么等级? 20+4 Tsingking1 2026-08-27 17/850 2026-09-01 19:51 by 超级无敌华子
[基金申请] 为什么国自然不能直接公布 +5 bjdxyxy 2026-08-26 5/250 2026-09-01 17:54 by 小伟大博士
[文学芳草园] 梦想 +5 myrtle 2026-08-26 7/350 2026-09-01 15:18 by myrtle
[论文投稿] 小白求助 投论文要求的highlights应该如何写 5+3 l1963982152 2026-08-29 4/200 2026-09-01 09:04 by 北京莱茵编辑
[基金申请] 国社科又开始会评了,不知道这次命运如何 +7 雨打竹帘 2026-08-30 11/550 2026-08-31 23:16 by hittle2008
[基金申请] 投票:  有多少人是今天查系统知道结果的? +17 爱看书的可乐 2026-08-26 19/950 2026-08-31 21:30 by xiangy672
[基金申请] 哪位高人中了,把查询到的截图贴出来让我看看,让我长长见识 +6 yuleib84 2026-08-26 7/350 2026-08-31 19:46 by 鱼翔浅底1
[基金申请] 中青基了要发朋友圈吗? +7 349506619 2026-08-28 7/350 2026-08-31 13:39 by 冼亮淀粉酶
[基金申请] 29号明天会评吗 +4 笨笨唐 2026-08-28 4/200 2026-08-31 09:30 by huixian257
[基金申请] 为什么到现在没收到通知? +5 tannykie 2026-08-29 5/250 2026-08-30 21:05 by purplejack
[考博] 找导师 +6 yuanjiabao 2026-08-29 7/350 2026-08-30 14:40 by 生科新手
[基金申请] 国自然面上复盘~欢迎讨论 (金币+15) +15 晴天加油 2026-08-26 16/800 2026-08-29 18:28 by symmetry
[基金申请] 系统查不到 +11 董八千 2026-08-26 11/550 2026-08-28 18:06 by Leogzhya
[基金申请] 基金系统什么内容也没有 30+4 winsaint 2026-08-27 9/450 2026-08-28 11:06 by maolC
[基金申请] 怎么查啊 +6 huang1991js 2026-08-26 6/300 2026-08-28 08:42 by winsaint
[基金申请] 看板上这么多中的,有点像50人群里49个人都是骗子的那种感觉…… +5 a089 2026-08-26 6/300 2026-08-27 14:05 by jonewore
[基金申请] 我不理解! +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
信息提示
请填处理意见