MPI mpirun execvp错误:没有这样的文件或目录

don*_*nut 6 mpi

我正在尝试使用MPI运行c ++代码(BCparallel.cpp); 用以下代码编译代码:

 mpic++ BCparallel.cpp -o BCparallel
Run Code Online (Sandbox Code Playgroud)

很成功,但当我通过这条线

 mpiexec -np 4 BCparallel file.txt
Run Code Online (Sandbox Code Playgroud)

它回来了

[proxy:0:0@lps-Inspiron-5537] HYDU_create_process 
(utils/launch/launch.c:75): execvp error on file BCparallel (No such 
file or directory)
[proxy:0:0@lps-Inspiron-5537] HYDU_create_process 
(utils/launch/launch.c:75): execvp error on file BCparallel (No such 
file or directory)
[proxy:0:0@lps-Inspiron-5537] HYDU_create_process 
(utils/launch/launch.c:75): execvp error on file BCparallel (No such 
file or directory)
[proxy:0:0@lps-Inspiron-5537] HYDU_create_process 
(utils/launch/launch.c:75): execvp error on file BCparallel (No such 
file or directory)
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

Joh*_*nck 13

该程序不在您的$PATH身上,您没有指定它所在的路径.试试这个:

mpiexec -np 4 ./BCparallel file.txt
Run Code Online (Sandbox Code Playgroud)

这与任何其他程序相同,如果不在其中,则$PATH必须使用路径限定.这可以防止您意外地ls在当前目录中运行一个名为(例如)的程序.