| 2 | 1/1 | 返回列表 |
| 查看: 1632 | 回復(fù): 1 | ||
姜家木木銅蟲 (初入文壇)
|
[求助]
FLUENT計(jì)算節(jié)點(diǎn)數(shù)據(jù)匯總(MPI)
|
|
小弟用FLUENT進(jìn)行并行計(jì)算,打算實(shí)現(xiàn)將計(jì)算節(jié)點(diǎn)的某個(gè)數(shù)據(jù)匯總到計(jì)算節(jié)點(diǎn)0,并輸出,就是計(jì)算節(jié)點(diǎn)間的數(shù)據(jù)匯總。udf程序可編譯,可hook,沒什么問題,但是一計(jì)算就出現(xiàn)下面的錯(cuò)誤,網(wǎng)上也找不到解答,希望有了解fluent并行計(jì)算MPI這塊的大佬給些指點(diǎn),下面是我的udf和報(bào)錯(cuò)信息。 udf: DEFINE_ADJUST(Mon,domain) { #if !RP_HOST Thread *t,**pt; real temp,time,r,rj,zc; cell_t c; real x[ND_ND]; int num_c,total_c,mark_c,ci,ci1,cj1,ci2,cj2,node_i,i; real (*xc_array)[3],(*yc_array)[3]; time=CURRENT_TIME; rj=0.001; if(current_ts!=N_TIME) { current_ts=N_TIME; mp_thread_loop_c(t,domain,pt) if(FLUID_THREAD_P(t)) {Thread *p_phase=pt[1]; begin_c_loop_int(c,t) { C_CENTROID(x,c,t); if(C_VOF(c,p_phase)>0.5&&C_VOF(c,p_phase)<1&&sqrt(pow(x[0]-csped*time+dla-x0,2)+x[1]*x[1])<=rj) { num_c++; } } end_c_loop_int(c,t) xc_array=(real (*)[3])calloc(3*num_c,sizeof(real)); ci=0; begin_c_loop_int(c,t) { C_CENTROID(x,c,t); if(C_VOF(c,p_phase)>0.5&&C_VOF(c,p_phase)<1&&sqrt(pow(x[0]-csped*time+dla-x0,2)+x[1]*x[1])<=rj) { xc_array[ci][0]=x[0]; xc_array[ci][1]=x[1]; xc_array[ci][2]=x[2]; ci++; } } end_c_loop_int(c,t) #if RP_NODE total_c=PRF_GISUM1(num_c); #endif #if !PARALLEL total_c=num_c; #endif yc_array=(real (*)[3])calloc(3*total_c,sizeof(real)); #if RP_NODE if(!I_AM_NODE_ZERO_P) { PRF_CSEND_INT(node_zero,&num_c,1,myid); PRF_CSEND_REAL(node_zero,xc_array[0],3*num_c,myid); } if( I_AM_NODE_ZERO_P) { for(ci1=0;ci1<num_c;ci1++) { for(cj1=0;cj1<3;cj1++) { yc_array[ci1][cj1]=xc_array[ci1][cj1]; } } mark_c=num_c; compute_node_loop_not_zero(node_i) { PRF_CRECV_INT(node_i,&num_c,1,node_i); xc_array=(real (*)[3])realloc(xc_array,3*num_c*sizeof(real)); PRF_CRECV_REAL(node_i,xc_array[0],3*num_c,node_i); for(ci2=0;ci2<num_c;ci2++) { for(cj2=0;cj2<3;cj2++) { yc_array[ci2+mark_c][cj2]=xc_array[ci2][cj2]; } } mark_c=mark_c+num_c; } compute_node_loop_not_zero(node_i) { PRF_CSEND_REAL(node_i,yc_array[0],3*total_c,node_zero); } } free(xc_array); if(!I_AM_NODE_ZERO_P) { PRF_CRECV_REAL(node_zero,yc_array[0],3*total_c,node_zero); } #endif begin_c_loop(c,t) { C_CENTROID(x,c,t); temp=C_T(c,t); for(i=0;i<total_c;i++) { if(x[0]==yc_array[0]&&x[1]==yc_array[1]&&x[2]==yc_array[2]) { C_UDMI(c,t,10)=1; break; } else C_UDMI(c,t,10)=0; } } end_c_loop(c,t) } } free(yc_array); #endif } 報(bào)錯(cuò): ============================================================================== Node 0: Process 12088: Received signal SIGSEGV. ============================================================================== MPI Application rank 0 exited before MPI_Finalize() with status 2 Interrupting at the end of timestep. If you want to interrupt at the end of iteration, press Ctrl+C once again. The fl process could not be started. |
銅蟲 (初入文壇)
| 2 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 083000環(huán)境科學(xué)與工程調(diào)劑 +3 | mingmingry 2026-03-09 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 考研一志愿長安大學(xué)材料與化工309分請求調(diào)劑 +5 | dtdxzxx 2026-03-06 | 7/350 |
|
|
[考研] 0703求調(diào)劑 +10 | c297914 2026-03-06 | 11/550 |
|
|
[考研] 307求調(diào)劑 +3 | 辛仁豆腐 2026-03-08 | 5/250 |
|
|
[考研] 0703化學(xué) 學(xué)碩 理工科均可 不區(qū)分研究方向 總分279求調(diào)劑 +9 | 1一11 2026-03-03 | 9/450 |
|
|
[考研] 一志愿東北大學(xué)080500,英一數(shù)二343分求調(diào)劑 +7 | Seele_v5 2026-03-04 | 7/350 |
|
|
[考研] 0856求調(diào)劑 +3 | squirtle11 2026-03-07 | 3/150 |
|
|
[考研] 理學(xué)287分求調(diào)劑 +4 | 看看我. 2026-03-05 | 4/200 |
|
|
[考研] 求調(diào)劑 +3 | 拾柒12。 2026-03-08 | 3/150 |
|
|
[考研] 085700資環(huán)求調(diào)劑,初始279,六級已過,英語能力強(qiáng) +4 | 085700資環(huán)調(diào)劑 2026-03-03 | 5/250 |
|
|
[考研] 301求調(diào)劑 +5 | 一二LV 2026-03-07 | 5/250 |
|
|
[考研] 322分 085600求調(diào)劑,有互聯(lián)網(wǎng)+國金及主持省級大創(chuàng)經(jīng)歷 +4 | 熊境喆 2026-03-05 | 4/200 |
|
|
[考研] 一志愿武漢理工085601,初試301分,請問能調(diào)劑到湖北嗎 +3 | 肖yang 2026-03-06 | 3/150 |
|
|
[考研] 271求調(diào)劑 +7 | 月色c 2026-03-05 | 8/400 |
|
|
[考研] 求調(diào)劑 +3 | 泡了個(gè)椒 2026-03-04 | 4/200 |
|
|
[考研] 22408-273求調(diào)劑-擔(dān)任3個(gè)項(xiàng)目的負(fù)責(zé)人-1篇國際期刊論文(一作)1篇核心期刊論文在投。 +3 | 沒想好取什么名 2026-03-03 | 3/150 |
|
|
[考研] 武理材料工程302調(diào)劑 +3 | Doleres 2026-03-03 | 6/300 |
|
|
[考研] 281求調(diào)劑 +3 | 我是小小蔥蔥 2026-03-03 | 5/250 |
|
|
[考研] 復(fù)試調(diào)劑 +4 | 杰尼龜aaa 2026-03-03 | 4/200 |
|
|
[考研] 306求調(diào)劑 +7 | 張張張張oo 2026-03-03 | 7/350 |
|