MPICH报错 forrtl: severe (157): Program Exception - access violation

MPICH2报错信息

报错信息为:
forrtl: severe (157): Program Exception - access violation

MPICH报错 forrtl: severe (157): Program Exception - access violation
MPICH报错 forrtl: severe (157): Program Exception - access violation
MPICH报错 forrtl: severe (157): Program Exception - access violation
MPICH报错 forrtl: severe (157): Program Exception - access violation

问题分析

MPICH软件在编译Fortran时,报错访问冲突。最终发现问题:
虽然我电脑是64位,MPICH安装的也是64位。但我Visual Studio 2012安装的是32位。导致MPI_FILE_OPEN输出的文件句柄为异常值,使得MPI_FILE_WRITE在写出时找不到文件句柄,报错。

解决方案

卸载原64位MPICH后安装32位MPICH软件。

补充讨论

或许卸载原32位Visual Studio后安装64位的Visual Studio也可以,我没有测试,欢迎测试后讨论。

32位MPI(mpich2-1.4.1p1-win-ia32.msi)下载网址