| 10 | 1/1 | 返回列表 |
| 查看: 2035 | 回復(fù): 9 | |||
[交流]
【求助】更改源代碼 并行出問題 已有6人參與
|
|
我最近對lammps中 deposit的源代碼進(jìn)行了更改,然后編譯運行在我的單核上都沒問題,但在集群服務(wù)器上,就不能輸出dump,運行會自動終止,也不報錯,log文件變空白。但在單機(jī)運行是沒問題的,自己解決了好久也不知道問題出在哪里,不知道有沒有前輩有類似的經(jīng)驗。 我在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源代碼編寫的,不知道問題出在哪里。 希望前輩能給予指點,萬分感謝 謝謝了! |

鐵桿木蟲 (正式寫手)
|
> 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); 首先定位錯誤,將最后一行comment掉,編譯后運行。如果沒有問題,說明是最后一行的問題,檢查world傳入的是否有問題。 |
鐵桿木蟲 (正式寫手)
銅蟲 (正式寫手)
新蟲 (初入文壇)
| 10 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[基金申請] 被我言中:新模板不強(qiáng)調(diào)格式了,假專家開始管格式了 +3 | beefly 2026-03-14 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 085600材料與化工求調(diào)劑 +5 | 緒幸與子 2026-03-17 | 5/250 |
|
|
[考研] 材料與化工求調(diào)劑 +5 | 為學(xué)666 2026-03-16 | 5/250 |
|
|
[考研] 070300化學(xué)319求調(diào)劑 +3 | 錦鯉0909 2026-03-17 | 3/150 |
|
|
[碩博家園] 深圳大學(xué)碩士招生(2026秋,傳感器方向,僅錄取第一志愿) +4 | xujiaoszu 2026-03-11 | 9/450 |
|
|
[考研] 化學(xué)工程321分求調(diào)劑 +10 | 大米飯! 2026-03-15 | 13/650 |
|
|
[考研] 考研化學(xué)學(xué)碩調(diào)劑,一志愿985 +3 | 張vvvv 2026-03-15 | 5/250 |
|
|
[考研] 0703化學(xué)調(diào)劑 ,六級已過,有科研經(jīng)歷 +7 | 曦熙兮 2026-03-15 | 7/350 |
|
|
[考研] 311求調(diào)劑 +5 | 26研0 2026-03-15 | 5/250 |
|
|
[考研] 一志愿華中師范071000,325求調(diào)劑 +6 | RuitingC 2026-03-12 | 6/300 |
|
|
[考研] 0703 物理化學(xué)調(diào)劑 +3 | 我可以上岸的對?/a> 2026-03-13 | 5/250 |
|
|
[教師之家] 焦慮 +7 | 水冰月月野兔 2026-03-13 | 9/450 |
|
|
[考研] 22408總分284求調(diào)劑 +3 | InAspic 2026-03-13 | 3/150 |
|
|
[考研] 材料工程327求調(diào)劑 +3 | xiaohe12w 2026-03-11 | 3/150 |
|
|
[考研] 中科大材料專碩319求調(diào)劑 +3 | 孟鑫材料 2026-03-13 | 3/150 |
|
|
[考研] 297一志愿上交085600求調(diào)劑 +5 | 指尖八千里 2026-03-14 | 5/250 |
|
|
[基金申請]
有必要更換申報口嗎
20+3
|
fannyamoy 2026-03-11 | 3/150 |
|
|
[考研] 336求調(diào)劑 +6 | Iuruoh 2026-03-11 | 6/300 |
|
|
[考研] [0860]321分求調(diào)劑,ab區(qū)皆可 +4 | 寶貴熱 2026-03-13 | 4/200 |
|
|
[考研] 283求調(diào)劑,材料、化工皆可 +8 | 蘇打水7777 2026-03-11 | 10/500 |
|