| 2 | 1/1 | 返回列表 |
| 查看: 1630 | 回復(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ā)表 | |
|---|---|---|---|---|
|
[考研] 材料調(diào)劑 +10 | ounce. 2026-03-04 | 12/600 |
|
|---|---|---|---|---|
|
[考研] 一志愿哈爾濱工業(yè)大學(xué)0856材料與化工,前三科206,總分283,求調(diào)劑 +6 | 26考研求調(diào)劑 2026-03-06 | 6/300 |
|
|
[考研] 324求調(diào)劑 +5 | wxz2 2026-03-03 | 8/400 |
|
|
[考研] 0805總分292,求調(diào)劑 +13 | 幻想之殤 2026-03-01 | 13/650 |
|
|
[考研] 材料與化工328求調(diào)劑 +4 | 。,。,。,。i 2026-03-02 | 4/200 |
|
|
[考研] 301求調(diào)劑 +7 | 朝天椒的雙馬尾 2026-03-05 | 7/350 |
|
|
[考研] 0703 東華大學(xué) 理學(xué)化學(xué)均過 a 線,總分 281 求調(diào)劑 +6 | 香香 Lu 2026-03-03 | 11/550 |
|
|
[考研] 274環(huán)境工程求調(diào)劑 +6 | 扶柳盈江 2026-03-05 | 6/300 |
|
|
[考研] 281電子信息求調(diào)劑 +5 | jhtfeybgj 2026-03-02 | 9/450 |
|
|
[考研] 0856材料專碩274能調(diào)劑去哪里? +3 | 22735 2026-03-04 | 4/200 |
|
|
[考研] 304求調(diào)劑 +7 | 曼殊2266 2026-02-28 | 8/400 |
|
|
[考研] 320材料與化工,求調(diào)劑 +6 | 鶴遨予卿 2026-03-04 | 8/400 |
|
|
[考研] 307求調(diào)劑 +4 | xuyuan111 2026-03-04 | 5/250 |
|
|
[考研] 325求調(diào)劑 +5 | 學(xué)家科 2026-03-04 | 5/250 |
|
|
[考研] 復(fù)試調(diào)劑 +4 | 杰尼龜aaa 2026-03-03 | 4/200 |
|
|
[考博] 26申博 求博導(dǎo) +3 | 愛讀書的小帥 2026-02-28 | 5/250 |
|
|
[考研] 0856材料工程,初試313調(diào)劑 +7 | 賣個(gè)關(guān)子吧 2026-03-03 | 7/350 |
|
|
[考研] 求調(diào)劑 +11 | yunziaaaaa 2026-03-01 | 13/650 |
|
|
[考研] 哈工大計(jì)算機(jī)劉劼團(tuán)隊(duì)招生 +4 | hit_aiot 2026-03-01 | 6/300 |
|
|
[考研] 化工299分求調(diào)劑 一志愿985落榜 +5 | 嘻嘻(*^ω^*) 2026-03-01 | 5/250 |
|