<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">See my subsequent message - I'd already tried that and it didn't work, or possibly I'm using the wrong method here. The documentation is unclear where the hosts file should be and how it should be specified in the case of an MPI_Comm_spawn command in the code run by mpiexec. Is the intention that the hosts file should be specified with the mpiexec command (in which case how does it get passed to MPI_Comm_spawn? Is this brought in via argv?), or is the intention that the MPI_Comm_spawn command should specify this via an info variable (in which case where should the file reside? On the spawning machine or the slave nodes?)? Or something else entirely?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 15, 2017 at 4:17 PM, Kenneth Raffenetti <span dir="ltr"><<a href="mailto:raffenet@mcs.anl.gov" target="_blank">raffenet@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can specify alternate usernames in a hostfile. See link:<br>
<br>
<a href="https://wiki.mpich.org/mpich/index.php/Using_the_Hydra_Process_Manager#Using_Hydra_on_Machines_with_Different_User_Names" rel="noreferrer" target="_blank">https://wiki.mpich.org/mpich/i<wbr>ndex.php/Using_the_Hydra_Proce<wbr>ss_Manager#Using_Hydra_on_<wbr>Machines_with_Different_User_<wbr>Names</a><br>
<br>
You may also want to set HYDRA_LAUNCHER_SSH_ENABLE_WARN<wbr>INGS=1 to see if SSH will dump out more useful information.<br>
<br>
Ken<span class=""><br>
<br>
On 06/14/2017 09:56 AM, Alexander Rast wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Still more conjecture on my part, I think I understand what's going on with the gethostbyname failed message, but have no idea how one would go about fixing it.<br>
<br>
The exact message gives 'gethostbyname failed, pi@Burns (errno 1)'. I think this is a case of the underlying implementation not being intelligent enough to strip the username off in order to resolve the host address. In other words, it's looking for a host named 'pi@Burns' rather than a host Burns to which it's going to authenticate as user pi.<br>
<br>
If you try to use the hostname without user this fails, because then it tries to authenticate using the current username from the shell that invoked mpiexec (in my case on what will eventually become a 'root host' machine - an ordinary Ubuntu desktop PC) which fails because on the other MPI hosts that username doesn't exist. I have authentication set up using RSA keys which authenticates the local user on the 'root host' desktop PC into the 'working user' on the remote MPI hosts, but it seems the MPI_Comm_spawn function isn't using that authentication path.<br>
<br>
What it looks like, is that the MPICH implementation may be such that in order to run MPI_Comm_spawn you have to have an identical username on each host you hope to spawn a process on. I very much *hope* this isn't the case, because this would be exceptionally awkward, it would mean that for each different user wanting to run MPI jobs on the remote cluster they'd have to have their own private user and directory on each node in the cluster.<br>
<br>
So 1) is it possible to and 2) how would I, configure the MPI_Comm_spawn command or associated hosts so that you can authenticate as user X on host Y (X@Y) for each spawn host using authorized keys from your user W on machine Z, i.e. on machine Y you have in directory /home/X/.ssh/authorized_keys an entry for W@Z?<br>
<br></span><div><div class="h5">
On Tue, Jun 13, 2017 at 5:15 PM, Alexander Rast <<a href="mailto:alex.rast.technical@gmail.com" target="_blank">alex.rast.technical@gmail.com</a> <mailto:<a href="mailto:alex.rast.technical@gmail.com" target="_blank">alex.rast.technical@gm<wbr>ail.com</a>>> wrote:<br>
<br>
    OK, some progress. After more work I determined that the bulk of the<br>
    truly bizarre inconsistencies was down to obnoxious, intrusive<br>
    behaviour in Ubuntu of gnome-keyring-daemon, for example see the<br>
    following post:<br>
<br>
    <a href="https://askubuntu.com/questions/564821/why-cant-i-interact-with-my-ssh-agent-e-g-ssh-add-d-doesnt-work" rel="noreferrer" target="_blank">https://askubuntu.com/question<wbr>s/564821/why-cant-i-interact-<wbr>with-my-ssh-agent-e-g-ssh-add-<wbr>d-doesnt-work</a><br>
    <<a href="https://askubuntu.com/questions/564821/why-cant-i-interact-with-my-ssh-agent-e-g-ssh-add-d-doesnt-work" rel="noreferrer" target="_blank">https://askubuntu.com/questio<wbr>ns/564821/why-cant-i-interact-<wbr>with-my-ssh-agent-e-g-ssh-add-<wbr>d-doesnt-work</a>><br>
<br>
    which by the way has not been fixed as of 16.04 Ubuntu.<br>
<br>
    It seems gnome-keyring-daemon is a particularly badly-behaved<br>
    utility and doesn't help itself with multiple autoload attempts at<br>
    Ubuntu startup. You don't know what ssh agent is actually loaded and<br>
    which RSA keys it has cached. It's also apparently very difficult to<br>
    get rid of, although there are ways. I got it eventually to stop<br>
    loading itself. (Perhaps the MPI community might whinge to Ubuntu<br>
    about this behaviour? Many people have complained about the<br>
    antisocial behaviour of gnome-keyring-daemon but so far Ubuntu's<br>
    response has been: 'we can't see why this should be considered a<br>
    problem. And we have doubts about what you're trying to achieve')<br>
<br>
    So now the problem has got to the point where there are 2<br>
    alternative error responses, both occurring at the MPI_Comm_spawn<br>
    command. I've included typical error outputs for both scenarios,<br>
    using the code posted earlier. The 2 errors occur with slightly<br>
    different versions of the configuration file used to spawn the<br>
    processes, which I'm also including. Obviously _2 files go together.<br>
<br>
    Any thoughts now on what might be causing either of these 2<br>
    problems? I find the gethostbyname failed messages particularly<br>
    perplexing, since I'm able to ssh into the machines themselves<br>
    without difficulty either by name or IP address.<br>
<br>
    On Fri, Jun 9, 2017 at 1:53 PM, Alexander Rast<br>
    <<a href="mailto:alex.rast.technical@gmail.com" target="_blank">alex.rast.technical@gmail.com</a><br></div></div><div><div class="h5">
    <mailto:<a href="mailto:alex.rast.technical@gmail.com" target="_blank">alex.rast.technical@gm<wbr>ail.com</a>>> wrote:<br>
<br>
        I've reached a limit of mystification. Attempting to run an MPI<br>
        application using MPI_Comm_spawn from a host is resulting in<br>
        bizarre, inconsistent behaviour of ssh and ssh-askpass.<br>
<br>
        What I did is, I created an RSA keypair using ssh-keygen, copied<br>
        the public keys into the ./ssh directories on the machines I'll<br>
        be running MPI on, put them in the authorized_keys file, placed<br>
        all the machines in the known_hosts file on the launcher host<br>
        (which is starting MPI_Comm_spawn), then ran eval ssh-agent and<br>
        added the id_rsa file to the agent on the launcher host.<br>
<br>
        You can verify that this part of the system is working because I<br>
        can use ssh directly to access the worker machines that will be<br>
        running the application.<br>
<br>
        But when I actually try to run the MPI application, when it gets<br>
        to the spawn, all sorts of wierd and wild stuff happens.<br>
        Sometimes a dialogue (which aggressively grabs focus) comes up<br>
        asking for a password (OpenSSH Authentication). Other times the<br>
        same program has just said that the identity/authenticity of the<br>
        target machine can't be established - do I want to continue? (A<br>
        yes causes authentication to fail). In still other cases, it<br>
        appeared to open the connection but then MPI crashed saying it<br>
        couldn't get the host by name. (yes, every machine has the<br>
        hostnames of every other machine in its hosts file). And in yet<br>
        another case, it seemed to try to run but then crashed saying<br>
        unexpected end-of-file. And so on. There seems to be no rhyme or<br>
        reason to the errors, I can't reproduce anything, each time I<br>
        try it some new and surprising behaviour comes up. What's<br>
        happening? Do I have to do something unusual with machine<br>
        configuration/environment?<br>
<br>
        Here are the associated MPI files if anyone wants to look for<br>
        errors. In fact there are probably some errors in the code<br>
        itself, because it's never been able to be debugged (because of<br>
        this wierd behaviour) but I am fairly sure at least the sequence<br>
        through to the spawn command is OK. All help appreciated...<br>
<br>
<br>
<br>
<br>
<br></div></div><span class="">
______________________________<wbr>_________________<br>
discuss mailing list     <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" rel="noreferrer" target="_blank">https://lists.mpich.org/mailma<wbr>n/listinfo/discuss</a><br>
<br>
</span></blockquote>
</blockquote></div><br></div>