| 5 | 1/1 | 返回列表 |
| 查看: 2065 | 回復: 9 | |||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | |||
[交流]
【求助】更改源代碼 并行出問題 已有6人參與
|
|||
|
我最近對lammps中 deposit的源代碼進行了更改,然后編譯運行在我的單核上都沒問題,但在集群服務器上,就不能輸出dump,運行會自動終止,也不報錯,log文件變空白。但在單機運行是沒問題的,自己解決了好久也不知道問題出在哪里,不知道有沒有前輩有類似的經(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傳入的是否有問題。 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研]
|
pk3725069 2026-03-19 | 14/700 |
|
|---|---|---|---|---|
|
[考研] 333求調(diào)劑 +6 | 87639 2026-03-21 | 10/500 |
|
|
[考研] 310求調(diào)劑 +4 | baibai1314 2026-03-16 | 4/200 |
|
|
[考研] 298求調(diào)劑一志愿211 +3 | 上岸6666@ 2026-03-20 | 3/150 |
|
|
[考研] 求調(diào)劑院校信息 +6 | CX 330 2026-03-21 | 6/300 |
|
|
[考研] 一志愿華中科技大學071000,求調(diào)劑 +4 | 沿岸有貝殼6 2026-03-21 | 4/200 |
|
|
[考研] 一志愿深大,0703化學,總分302,求調(diào)劑 +4 | 七月-七七 2026-03-21 | 4/200 |
|
|
[考研] 求助 +5 | 夢里的無言 2026-03-21 | 6/300 |
|
|
[考研] 311求調(diào)劑 +3 | 勇敢的小吳 2026-03-20 | 3/150 |
|
|
[考研] 336求調(diào)劑 +5 | rmc8866 2026-03-21 | 5/250 |
|
|
[考研] 085700資源與環(huán)境308求調(diào)劑 +12 | 墨墨漠 2026-03-18 | 13/650 |
|
|
[考研] 一志愿武理材料305分求調(diào)劑 +6 | 想上岸的鯉魚 2026-03-18 | 7/350 |
|
|
[考研] 一志愿華南師大 070300(化學)304分求調(diào)劑 +3 | 0703武芊慧雪304 2026-03-18 | 3/150 |
|
|
[考研] 南京大學化學376求調(diào)劑 +3 | hisfailed 2026-03-19 | 6/300 |
|
|
[考研] 321求調(diào)劑 +9 | 何潤采123 2026-03-18 | 11/550 |
|
|
[考研] 一志愿西南交通 專碩 材料355 本科雙非 求調(diào)劑 +5 | 西南交通專材355 2026-03-19 | 5/250 |
|
|
[考研] 一志愿 南京航空航天大學大學 ,080500材料科學與工程學碩 +5 | @taotao 2026-03-20 | 5/250 |
|
|
[考研] 生物學調(diào)劑招人!。 +3 | 山海天嵐 2026-03-17 | 4/200 |
|
|
[考研] 材料,紡織,生物(0856、0710),化學招生啦 +3 | Eember. 2026-03-17 | 9/450 |
|
|
[考研]
|
zhouzhen654 2026-03-16 | 3/150 |
|