4

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
Options:
-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)

Stéphane Gimenez
  • 28,527
  • 3
  • 76
  • 87
Martin
  • 41
  • 2

1 Answers1

5

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:

    #!/bin/sh
    PyroDist
    

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

Stéphane Gimenez
  • 28,527
  • 3
  • 76
  • 87
  • 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 06 '11 at 11:07
  • 1
    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 06 '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 06 '11 at 12:21
  • Ok glad you could solve it! – Stéphane Gimenez Oct 06 '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 'SO- stop being evil' Oct 06 '11 at 22:58