24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1438  |  回复: 0

wangxn06

金虫 (正式写手)

[求助] mpi并行计算,错误提示“p1_xxxxx: p4_error: interrupt SIGSEGV: 11”是什么意思?

MPI并行计算的程序,之前在另一台集群上跑是可以的,当时用的是intel 编译器,MPICH2,LINUX系统的版本不太清楚。现在换了一个集群也是linux系统,编译器为GNU,编译命令为mpif77,但是作业提交后总是出现这样的错误
  p1_xxxxx: p4_error: interrupt SIGSEGV: 11
在网上搜了一下,这种叫 段错误,与内存有关。找到的3种解决办法(具体情况不同):
1.  http://old.blog.edu.cn/user1/11542/archives/2007/1652099.shtml
在并行作业中可能会遇到"p1_xxxxx: p4_error: interrupt SIGSEGV: 11"的错误,而且作业会停止。 这个错误可能是因为某个进程中出现了段错误引起的,出现了 illegally read/write not-owned memory location的情况。解决的一种办法是:如果内存容量比较大,通过设置环境变量P4_GLOBMEMSIZE 增加其值,比如:
export P4_GLOBMEMSIZE=536870912增加到使用512M的内存。

2.   http://muchong.com/bbs/viewthread.php?tid=1542953
最后发现是数据长度的问题,这是由于编译MPI自动识别的整数型长度是4位的,而我在编译VASP.5.LIB时没有删掉PGF后面的-i8选项,结果两边冲突,导致内存故障报错。重新编译VASP.5.LIB,然后编译VASP,测试成功

3.  http://blog.sina.com.cn/s/blog_40bf31b5010003cu.html
p1_xxxxx:  p4_error: interrupt SIGSEGV: 11

这个错误可能是因为某个进程中出现了段错误引起的,
自己出现过的错误:
1.只在一个进程中给指针申请空间,而在其他进程没有申请,所以在广播的时候出错
2.在一个进程中联接mysql数据库,而在所有的进程中断开数据库的联接

网上有个人说的很好:
"There are 2 things to check.
  * Run one of the test programs like pi3.f or cpi.c to see whether your cluster's OK.
  * if it is, the fault is in your code. See if you're exceeding array bounds or accessing memory which you haven't allocated, There's a SIGSEGV error - that's a segmentation violation. That might explain stuff like
                bm_list_21829:  p4_error: interrupt SIGINT: 2
Once you have a seg. violation, all the 4 processors are sent a signal to interrupt the process (SIGINT). Signals are defined in /usr/include/sys/signal.h (at least on the SGIs; might be
different on other systems). "
2. p1_10401:  p4_error: : 14
1 - MPI_BCAST : Message truncated
[1]  Aborting program !
[1] Aborting program!

这个也是由于mpi_bcast的接收空间不够引起的,要在mpi_bcast之前分配足够大的空间,这样就不会truncated了

请问各位怎么对程序做改动,才能避免问题的出现?什么是段错误?

[ Last edited by wangxn06 on 2012-3-19 at 21:55 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 wangxn06 的主题更新
信息提示
请填处理意见