Fortran mpi运行时错误 [英] Fortran mpi runtime error

查看:1418
本文介绍了Fortran mpi运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解使用MPI编写来自Fortran代码的并行数据。我遇到了一个简单的程序,从 here

我用MPI编译器编译并运行程序,并得到以下错误:

  sathish @ HP-EliteBook:〜/ Desktop $ mpif90 test.F90 -o测试
sathish @ HP-EliteBook:〜/桌面$ mpirun -np 4测试
---- -------------------------------------------------- -
主要作业正常终止,但1个进程返回
a非零退出代码。按用户指示,作业已中止。
---------------------------------------------- ---------

我在其他论坛上看到类似的问题,这是由于错误的mpi安装位置左右。以下是建议使用 LD_PRELOAD 的解决方案之一:

  sathish @ HP-EliteBook:〜/ Desktop $ mpirun -x LD_PRELOAD = libmpi.so -np 4 test 
------------------------- ------------------------------
主要作业正常终止,但1个进程返回
a非零退出代码。根据用户方向,作业已被中止。
---------------------------------------------- ---------

问题仍然存在。我无法确定这样一个简单程序的问题。

解决方案

简短回答:
p>

  mpirun -np 4 ./test 

而不是:

  mpirun -np 4测试

详细信息:
这是当您的工作目录不在您的路径中时发生的常见问题。简单的解决方案是将完整路径添加到可执行文件。另一种方法是将当前目录添加到路径变量中。但是,在这种情况下,即使将当前目录添加到路径中,顺序也很重要。 Linux系统(它似乎是你的情况)通常带有一个名为 test 的程序,它通常位于路径中默认值。



发生的是你不直接启动mpi程序,而是开始 mpirun 那将启动 mpi 机器,并开始使用该机器的程序。 mpirun 必须找到您的程序。还有我上面提到的两个选项:完整路径到您的可执行文件或将您的目录添加到您的搜索路径


I am trying to understand parallel data writing from Fortran code with MPI. I came across a simple program from here.

I compiled and run the program with MPI compiler and getting the following error:

sathish@HP-EliteBook:~/Desktop$ mpif90 test.F90 -o test
sathish@HP-EliteBook:~/Desktop$ mpirun -np 4 test
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------

I see similar issues in other forums mentioning this is due to wrong mpi installation location or so. The following was one of the solutions suggesting use of LD_PRELOAD:

sathish@HP-EliteBook:~/Desktop$ mpirun -x LD_PRELOAD=libmpi.so -np 4 test
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------

The issue still persists. I could not figure what the issue is for such a simple program.

解决方案

Short answer: run as

mpirun -np 4 ./test

instead of:

mpirun -np 4 test

Details: That is a common problem that happens when your working directory is not in your path. The simple solution is to add the full path to the executable. Another alternative might be to add the current directory to your path variable. However, in this case, even if you add the current directory to the path, the order will matter. Linux systems (it seems to be your case) usually come with a program named test that is usually in the path by default.

What is going on is that you do not start mpi program directly, instead, you start mpirun that will start the mpi machinery, and start your program that will make use of that machinery. mpirun has to find your program. And there is where comes the two options I suggested above: full path to your executable or add your directory to your search path.

这篇关于Fortran mpi运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆