Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Somehow mpirun fails to acknowledge my $PATH. The program PyroDist, that I have in $PATH, works:

$ PyroDist
Can't find asked option -in
PyroDist - pairwise distance matrix from flowgrams
-in     string            flow file name
-out    stub              out file stub
-ni                       no index in dat file
-rin    string            lookup file name

And running it with mpirun and full path works too:

$ mpirun -np 4 ../bin/PyroDist -in C005.dat -out foo
0: Read data
0: Broadcast data
0: Broadcast flows
nN=2094 nM=360 nSize=753840

But this fails:

$ mpirun -np 4 PyroDist
Missing: program name
Program PyroDist either does not exist, is not 
executable, or is an erroneous argument to mpirun.

Since I am going to use a complex set of workflows it is not feasible to use full paths. Any ideas?

(openmpi 1.2.7 on Linux 2.6.32)

share|improve this question

mpirun probably uses an execv() call to run the program instead of an execvp() one (which would search for it in PATH).

First workaround: ask the shell to lookup for the command by itself:

mpirun -np 4 $(which PyroDist) -in C005.dat -out foo

Otherwise: two (not so good) workarounds I can think of:

  1. Use /usr/bin/env with argument PyroDist, but this requires that mpirun allows to pass arguments along with the program somehow.

  2. Write your own wrapper like:


    and place it somewhere with a “fixed” relative path.

share|improve this answer
Can I somehow confirm that the 'problem' is with execv() contra execvp()? I would prefere a recompile of mpi to support the latter, if that helps. The suggested work-arounds will not help me since this is only one bit of a large framework (QIIME) and there is a lot of programs like PyroDist and also, mpirun is tucked away inside multiple wrappers. – Martin Oct 6 '11 at 11:07
It strikes me that openmpi 1.2.7 is quite old. On another machine running openmpi 1.4.1 there is no problem. – Martin Oct 6 '11 at 11:38
Updating to 1.4 solved the problem (too bad I am not allowed to answer my own question - now someone can beat me to it! ;o) – Martin Oct 6 '11 at 12:21
Ok glad you could solve it! – Stéphane Gimenez Oct 6 '11 at 13:07
@Martin You can answer your own question, you just need to wait a bit (by now, you should be able to do it). – Gilles Oct 6 '11 at 22:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.