[mpich-discuss] MPICH and sudo mpiexec

"Antonio J. Peña" apenya at mcs.anl.gov
Tue Jun 2 17:31:21 CDT 2015


Hi Daniel,

Your environment variables and password-less privileges are likely to 
not being propagated to applications executed by "sudo" (for example, 
can you do "sudo ssh" between nodes without being asked for a 
password?). If you really need that, consider logging in as root and 
preparing the environment there.

Best,
   Antonio


On 06/02/2015 11:21 AM, Thibault, Daniel wrote:
>    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 at 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 at 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?
> Daniel U. Thibault
> RDDC - Centre de recherches de Valcartier | DRDC - Valcartier Research 
> Centre
> NAC : _918V QSDJ_ 
> <http://www.travelgis.com/map.asp?addr=918V%20QSDJ><_http://www.travelgis.com/map.asp?addr=918V%20QSDJ_>
> Gouvernement du Canada | Government of Canada
> <_http://www.valcartier.drdc-rddc.gc.ca/_>
>
>
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss


-- 
Antonio J. Peña
Postdoctoral Appointee
Mathematics and Computer Science Division
Argonne National Laboratory
9700 South Cass Avenue, Bldg. 240, Of. 3148
Argonne, IL 60439-4847
apenya at mcs.anl.gov
www.mcs.anl.gov/~apenya

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20150602/a5c3783b/attachment.html>
-------------- next part --------------
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list