我正在爲ANSYS14.5.7寫一個使用Fortran(Intel Composer(2011.1.107))的用戶子程序我編輯了一些代碼,將一些數據寫入外部順序文件並將它們讀取到一個數組中用於計算如下:在linux下爲ansys分段錯誤
c Writes the array elements into the relevent elementID file and Integration point
Do ElementNo=1,MaxEleNo
c writes the file name for the relevent element
write (filename1, '("Element_", I4)') ElementNo
c opens the relevent file for the element data
OPEN(unit=ElementNo,status='unknown',ACCESS='APPEND'
& ,file=filename1)
Write(ElementNo,fmt='(*(D))')(sthistory(ElementNo,:))
close (ElementNo)
end do
sthistory=ZERO
else
endif
當我運行此我從HPC系統得到這個錯誤:
Lyra: Ansys (v14.5.7) loaded.
Lyra: Intel Composer (2011.1.107) module loaded.
/pkg/suse11/ansys/v145/ansys/bin/ansys145: line 817: 50102 Segmentation fault /pkg/suse11/ansys/v145/ansys/bin/linx64/ansys.e145 -np 4
但與代碼沒有問題,當我在運行一個靜態數組保存屬性子程序。但是,在我的計算中保存所有數據並不足夠。 有人可以幫助我找到可能的問題。
哪條線在你的代碼完全對應於'817行'? –
關於靜態數組的一點是沒有意義的,因爲你沒有顯示任何聲明/分配..需要更多的上下文。 – agentp
HPC ==高性能計算? ==平行?如果這需要線程安全這是一個完整的其他問題,你需要澄清.. – agentp