MPI mpirun execvp error: no such file or directory
Asked Answered
H

1

15

I'm trying to run a c++ code (BCparallel.cpp) using MPI; compiling the code with:

 mpic++ BCparallel.cpp -o BCparallel

is well succeed, but when I pass the line

 mpiexec -np 4 BCparallel file.txt

It returns

[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)

What am I doing wrong?

Hibbler answered 24/11, 2017 at 11:16 Comment(1)
This is not C++ question.Kordofan
F
32

The program is not in your $PATH and you have not specified the path where it exists. Try this:

mpiexec -np 4 ./BCparallel file.txt

This is the same as for any other program, which if it is not in $PATH must be qualified with a path. This protects you from accidentally running a program called ls (for example) in your current directory.

Flowerless answered 24/11, 2017 at 11:30 Comment(4)
I did this but, I still get the same error. [proxy:0:0@MyUbuntu] HYDU_create_process (/home/nikhil/Downloads/libraries/mpich-3.2.1/src/pm/hydra/utils/launch/launch.c:75): execvp error on file ./HelloWorld.out (Permission denied)Durra
@Nikhil: Your error is different (Permission denied). You might want to post a new question if you can't figure it out. But it might just be you need to say chmod +x ./HelloWorld.out first.Flowerless
@JohnZwinck if I have multiple instances of the program (for ex.: different Python installs/environments) it can be the case?Tadzhik
@RicardoBarrosLourenço: I don't understand your question.Flowerless

© 2022 - 2024 — McMap. All rights reserved.