which by the way has not been fixed as of 16.04 Ubuntu.
It seems gnome-keyring-daemon is a particularly badly-behaved utility and doesn't help itself with multiple autoload attempts at Ubuntu startup. You don't know what ssh agent is actually loaded and which RSA keys it has cached. It's also apparently very difficult to get rid of, although there are ways. I got it eventually to stop loading itself. (Perhaps the MPI community might whinge to Ubuntu about this behaviour? Many people have complained about the antisocial behaviour of gnome-keyring-daemon but so far Ubuntu's response has been: 'we can't see why this should be considered a problem. And we have doubts about what you're trying to achieve')
So now the problem has got to the point where there are 2 alternative error responses, both occurring at the MPI_Comm_spawn command. I've included typical error outputs for both scenarios, using the code posted earlier. The 2 errors occur with slightly different versions of the configuration file used to spawn the processes, which I'm also including. Obviously _2 files go together.
Any thoughts now on what might be causing either of these 2 problems? I find the gethostbyname failed messages particularly perplexing, since I'm able to ssh into the machines themselves without difficulty either by name or IP address.