I have a small network of machines all running the
same OS (Linaro Ubuntu Linux); they were all cloned from the
same disk image and differ only in their machine names
(UNIT1 through UNIT4).
I can ssh between them at will, trusty has been
established and I no longer get asked for a password upon
connecting. MPICH is installed from the Ubuntu repository
(not quite the latest version: mpiexec reports version
OpenRTE 1.8.1, the mpich package
is 3.0.4-6ubuntu1), and I can run a demo like cpi with no
issues, using a little mpi-run.sh bash script (the default
shell is tcsh, however) :
(begin script)
#!/bin/bash
set -e
ESDK=${EPIPHANY_HOME}
ELIBS=${ESDK}/tools/host/lib:${LD_LIBRARY_PATH}
EHDF=${EPIPHANY_HDF}
echo "Running cpi on machines.u2.mpi"
LD_LIBRARY_PATH=${ELIBS} mpiexec --allow-run-as-root
-machinefile /home/linaro/.machines.u2.mpi -n 1
/home/linaro/myMPI/cpi
echo "Done!"
(end script)
.machines.u2.mpi consists of the one line:
linaro@UNIT2
From UNIT1, if I do:
$ ./mpi-run.sh
Running cpi on machines.u2.mpi
Process 0 of 1 is on UNIT2
pi is approximately 3.1415926544231341, Error is
0.0000000008333410
wall clock time = 0.001327
Done!
If I edit the script to change the mpiexec line like
this:
sudo -E LD_LIBRARY_PATH=${ELIBS} mpiexec
--allow-run-as-root -machinefile
/home/linaro/.machines.u2.mpi -n 1 /home/linaro/myMPI/cpi
Now I get (edited for brevity):
$ ./mpi-run.sh
Running cpi on machines.u2.mpi
linaro@UNIT2’s password:
PATH=/usr/local/bin[…]: Command not found.
export: Command not found.
LD_LIBRARY_PATH=/usr/local/lib[…]: Command not found.
export: Command not found.
DYLD_LIBRARY_PATH: Undefined variable.
And it just stops there. Note that the LD_LIBRARY_PATH
being reported is *not* the one passed in by the
script. I don’t think it’s managing to reach the mpi
execution stage itself.
If the machinefile lists more than one host, the password
prompts appear two at a time and interfere with each other
such that no login succeeds (although all machines have the
same password).
Googling around, I’ve seen this series of error outputs
in a wide variety of other contexts, including Open MPI but
also some completely unrelated application suites and SDKs.
My problem is that the mpi binaries I need to run on the
hosts absolutely require sudo elevation. Is sudo mpiexec
the way to go? What is going on in my example case?