| 5 | 1/1 | 返回列表 |
| 查看: 2066 | 回復(fù): 9 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
[交流]
【求助】更改源代碼 并行出問題 已有6人參與
|
|||
|
我最近對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傳入的是否有問題。 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 材料專業(yè)求調(diào)劑 +11 | hanamiko 2026-03-18 | 11/550 |
|
|---|---|---|---|---|
|
[考研] 070300化學(xué)求調(diào)劑 +8 | 苑豆豆 2026-03-20 | 8/400 |
|
|
[考研] 336化工調(diào)劑 +4 | 王大坦1 2026-03-23 | 5/250 |
|
|
[考研] 08工學(xué)調(diào)劑 +7 | 用戶573181 2026-03-20 | 11/550 |
|
|
[考研] 接收2026碩士調(diào)劑(學(xué)碩+專碩) +4 | allen-yin 2026-03-23 | 6/300 |
|
|
[考研] 0854電子信息求調(diào)劑 324 +3 | Promise-jyl 2026-03-23 | 3/150 |
|
|
[考研] 307求調(diào)劑 +3 | 余意卿 2026-03-21 | 3/150 |
|
|
[考研] 070300,一志愿北航320求調(diào)劑 +3 | Jerry0216 2026-03-22 | 5/250 |
|
|
[考研] 293求調(diào)劑 +3 | 濤濤Wjt 2026-03-22 | 5/250 |
|
|
[考研] 材料求調(diào)劑 +5 | @taotao 2026-03-21 | 5/250 |
|
|
[考研] 【考研調(diào)劑】化學(xué)專業(yè) 281分,一志愿四川大學(xué),誠心求調(diào)劑 +11 | 吃吃吃才有意義 2026-03-19 | 11/550 |
|
|
[考研] 313求調(diào)劑 +4 | 肆叁貳壹22 2026-03-19 | 4/200 |
|
|
[考研] 336求調(diào)劑 +5 | rmc8866 2026-03-21 | 5/250 |
|
|
[考研] 求調(diào)劑 +3 | .m.. 2026-03-21 | 4/200 |
|
|
[考研] 0805材料320求調(diào)劑 +3 | 深海物語 2026-03-20 | 3/150 |
|
|
[考研] 301求調(diào)劑 +10 | yy要上岸呀 2026-03-17 | 10/500 |
|
|
[考研] 085700資源與環(huán)境308求調(diào)劑 +12 | 墨墨漠 2026-03-18 | 13/650 |
|
|
[考研] 一志愿 西北大學(xué) ,070300化學(xué)學(xué)碩,總分287,雙非一本,求調(diào)劑。 +3 | 晨昏線與星海 2026-03-18 | 3/150 |
|
|
[考研] 261求B區(qū)調(diào)劑,科研經(jīng)歷豐富 +3 | 牛奶很忙 2026-03-20 | 4/200 |
|
|
[考研] 085600材料與化工調(diào)劑 324分 +10 | llllkkkhh 2026-03-18 | 12/600 |
|