Search code examples
mpiopenmpihpc

Open MPI + Scalasca :Can not run mpirun command with option --prefix


I have installed scalasca(scorep,cube,..)with Open MPI for peformance measurement . When i add an option : " --prefix = /my-path" to mpirun, "scalasca - analyze" can not be executed ( Aborted ) .
My command :
scalasca -analyze mpirun -np 1 --host localhost --prefix /home/as/lib/bin /home/as/Documents/a.out
"/home/as/lib" is the installed Open MPI directory.
And error :
S=C=A=N: Abort: Target executable/home/as/lib/bin' is a directory!`
If without "--prefix" , it runs normally .But i need "-- prefix" option to run it on a cluster.
I have installed Open MPI on all of cluster machines with same path (/home/as/lib) .
So how to fix it???


Solution

  • Open MPI adds an implicit --prefix option if orterun (or any of its symlinks like mpirun, mpiexec, etc.) is called with full path. In other words:

    $ /home/as/lib/bin/mpirun ...
    

    is equivalent to:

    $ mpirun --prefix /home/as/lib ...
    

    If your really really need to pass that --prefix option, e.g. because Open MPI is installed on the cluster nodes in a different directory than on the front-end node, then quote the entire parameter:

    $ scalasca -a mpirun -np 1 --host localhost "--prefix /home/as/lib" /path/to/execuable
    

    The same applies to any other parameter to mpirun. You could even quote them all, just to be on the safe side:

    $ scalasca -a mpirun "-np 1" "--host localhost" "--prefix /home/as/lib" /path/to/execuable
    

    Hint: When building your own version of Open MPI, do it with --enable-orterun-prefix-by-default. That way --prefix will be added automatically even when orterun/mpirun/mpiexec is not called with the full path to it. Also, --enable-wrapper-rpath is a good choice of build option, which will prevent clashes with other versions of the library.