I'm trying to test the MPI publish-connect methods and running into a situation where for some reason MPI_LOOKUP_NAME is returning the wrong port. You can see the test source and output in the attached zipfile.

I'm testing this (on Ubuntu 16.04, MPICH 3.2) by opening 2 terminal windows and starting one group of 2 processes (the 'server' group) in one, and another group (the 'client' group) in another. Beforehand I've started the hydra name server using hydra_nameserver & (in the same terminal session as the server group) The exact command line for the server group is:

mpiexec -nameserver DeepThought -n 1 ./MPI_Example_C_0 server : -n 1 ./MPI_Example_C_1 server

and for the client group:

mpiexec -nameserver DeepThought -n 1 ./MPI_Example_C_0 client : -n 1 ./MPI_Example_C_1 client

If you look at the attached output files, you can see that the problem is straightforward: MPI_LOOKUP_NAME is returning the wrong port name for the server group. Rather surprisingly, too, it *always* returns the exact same port name for any run:

 tag#0$description#DeepThought$port#50178$ifname#127.0.1.1$127.0.P

even though the port name reported for the server varies: in this run it was 

 tag#0$description#DeepThought$port#33341$ifname#127.0.1.1$

The clients are clearly performing the lookup and successfully querying the nameserver because if I don't run the server and simply run the clients they abort saying they couldn't find a published port, as expected.

So something strange is going on. Has anyone run into this? Is there something I need to do otherwise?

Thanks for any help.

Alex Rast