| 10 | 1/1 | 返回列表 |
| 查看: 2037 | 回復(fù): 9 | |||
362720651新蟲 (初入文壇)
|
[交流]
【求助】更改源代碼 并行出問題 已有6人參與
|
|
我最近對(duì)lammps中 deposit的源代碼進(jìn)行了更改,然后編譯運(yùn)行在我的單核上都沒問題,但在集群服務(wù)器上,就不能輸出dump,運(yùn)行會(huì)自動(dòng)終止,也不報(bào)錯(cuò),log文件變空白。但在單機(jī)運(yùn)行是沒問題的,自己解決了好久也不知道問題出在哪里,不知道有沒有前輩有類似的經(jīng)驗(yàn)。 我在deposit源文件中增加的代碼如下: int i,j; > int flag,flagall; > double coord[3],lamda[3],delx,dely,delz,rsq; > double *newcoord; > double **x = atom->x; > int *mask = atom->mask; > int nlocal = atom->nlocal; > int natoms; > int data = 0; > Region *region = domain->regions[iregion]; > > for(int i=0; i< nlocal ; i++) { > if (mask && groupbit && region->match(x[0],x[1],x[2])) data += 1; > } > MPI_Allreduce(&data,&natoms,1,MPI_INT,MPI_SUM,world); 感覺就算其中涉及到并行問題的代碼,也就是最后一句,都是模仿lammps源代碼編寫的,不知道問題出在哪里。 希望前輩能給予指點(diǎn),萬分感謝 謝謝了! |

新蟲 (初入文壇)
新蟲 (初入文壇)
鐵桿木蟲 (正式寫手)
|
> int flag,flagall; > double coord[3],lamda[3],delx,dely,delz,rsq; > double *newcoord; > double **x = atom->x; > int *mask = atom->mask; > int nlocal = atom->nlocal; > int natoms; > int data = 0; > Region *region = domain->regions[iregion]; > > for(int i=0; i< nlocal ; i++) { > if (mask && groupbit && region->match(x[0],x[1],x[2])) data += 1; > } > MPI_Allreduce(&data,&natoms,1,MPI_INT,MPI_SUM,world); 首先定位錯(cuò)誤,將最后一行comment掉,編譯后運(yùn)行。如果沒有問題,說明是最后一行的問題,檢查world傳入的是否有問題。 |
新蟲 (初入文壇)
鐵桿木蟲 (正式寫手)
銅蟲 (正式寫手)
新蟲 (初入文壇)
| 10 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 302求調(diào)劑 +6 | 呼呼呼。。。。 2026-03-17 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 302求調(diào)劑 +9 | 負(fù)心者當(dāng)誅 2026-03-11 | 9/450 |
|
|
[考研] 【0856】化學(xué)工程(085602)313 分,本科學(xué)科評(píng)估A類院;瘜W(xué)工程與工藝,誠(chéng)求調(diào)劑 +7 | 小劉快快上岸 2026-03-11 | 8/400 |
|
|
[考研] 26考研求調(diào)劑 +6 | 丶宏Sir 2026-03-13 | 6/300 |
|
|
[考研] 275求調(diào)劑 +4 | 太陽花天天開心 2026-03-16 | 4/200 |
|
|
[考研] 材料與化工304求B區(qū)調(diào)劑 +7 | 邱gl 2026-03-11 | 8/400 |
|
|
[考研] 283求調(diào)劑 +3 | 聽風(fēng)就是雨; 2026-03-16 | 3/150 |
|
|
[考研] 中科大材料與化工319求調(diào)劑 +3 | 孟鑫材料 2026-03-14 | 3/150 |
|
|
[考研] 297一志愿上交085600求調(diào)劑 +5 | 指尖八千里 2026-03-14 | 5/250 |
|
|
[考研] 265求調(diào)劑 +4 | 威化餅07 2026-03-12 | 4/200 |
|
|
[考研] 一志愿哈工大材料324分求調(diào)劑 +5 | 閆旭東 2026-03-14 | 5/250 |
|
|
[考研] 297求調(diào)劑 +4 | 學(xué)海漂泊 2026-03-13 | 4/200 |
|
|
[考研] 0703化學(xué)調(diào)劑 +4 | 快樂的香蕉 2026-03-11 | 4/200 |
|
|
[考研] 一志愿中科院,化學(xué)方向,295求調(diào)劑 +4 | 一氧二氮 2026-03-11 | 4/200 |
|
|
[考研] 0703化學(xué)一志愿211 總分320求調(diào)劑 +5 | 瑪卡巴卡啊哈 2026-03-11 | 5/250 |
|
|
[考研] 考研調(diào)劑 +4 | 芬達(dá)46 2026-03-12 | 4/200 |
|
|
[考研] 289求調(diào)劑 +3 | 李政瑩 2026-03-12 | 3/150 |
|
|
[考研] 0817化學(xué)工程與技術(shù)考研312分調(diào)劑 +3 | T123 tt 2026-03-12 | 3/150 |
|
|
[考研] 070303一志愿西北大學(xué)學(xué)碩310找調(diào)劑 +3 | d如愿上岸 2026-03-13 | 3/150 |
|
|
[考研] 321求調(diào)劑(食品/專碩) +3 | xc321 2026-03-12 | 6/300 |
|