c++ - MPI Client fails at looking up Server port (MPI_ERR_NAME: invalid name argument) -


I am currently trying to connect to an MPI client with a server which publishes a certain name but this work And I do not have any clue about it. OpenMPi using

MPI G ++ - 4.7, is 1.6 where / usr / lib64 / mpi / gcc / openmpi / etc / openmpi-default-hostfile below the "minimum" "(I do not like the questions using too many codes, but I think I should include it here): Problem shows:

 MY_IP  

/ P>

mpi_srv.cc #include & lt; Iostream & gt; # Include & lt; Mpi.h & gt; Int main (zero) {int rank (0); MPI_Init (0, NULL); MPI_Comm_size (MPI_COMM_WORLD, & amp; Rank); Std :: cout & lt; & Lt; "Rank:" & lt; & Lt; Rank & lt; & Lt; Std :: endl; Four POTN_M [MPI_MXFOXAPRAR]; MPI_Open_port (MPI_INFO_NULL, port_name); Four published_name [1024] = {'T', 'E', 'S', 'T', '_', 'P', 'O', 'R', 'T', '\ 0'}; MPI_Publish_name (publish_name, MPI_INFO_NULL, port_name); Std :: cout & lt; & Lt; "Port:" & lt; & Lt; Published_name & lt; & Lt; "(" & Lt; <"port_name

compiled and executed

  mpic ++ mpi_src.cc -o mpi_srv.x mpirun mpi_srv.x   

Print < P> And according to the requirement of blocks.

My Client

mpi_client.cc
  #include & lt; Iostream & gt; # Include & lt; Mpi.h & gt; Int main (zero) {int rank (0); MPI_Init (0, NULL); MPI_Comm_size (MPI_COMM_WORLD, & amp; Rank); Std :: cout & lt; & Lt; "Rank:" & lt; & Lt; Rank & lt; & Lt; Std :: endl; Four POTN_M [MPI_MXFOXAPRAR]; Four published_name [1024] = {'T', 'E', 'S', 'T', '_', 'P', 'O', 'R', 'T', '\ 0'}; MPI_Lookup_name (publish_name, MPI_INFO_NULL, port_name); MPI_Comm client; MPI_Comm_connect (port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, and client); MPI_Comm_disconnect (& customer); MPI_Finalize (); Return 1; }   

compiled and executed

  mpic ++ mpi_client.cc -o mpi_client.x mpirun mpi_client.x   

Print

.

I removed the error check in the exmaples but the function returns the value of the publication of the port name in the executable server successful. I found out that this issue may occur because the published door may be invisible to the client While using different mipins I used execution to execute both of them.

Why is the client not connected to the server as I expected here?

When you run two different MPI sessions, such as:

  $ Mpirun mpi_server.x ...   

and

  $ mpun mpi_client.x ...   

second (Client) MPI session should be told where the naming service containing name / port mapping is located. With the Open MPI you have several naming services:

  • An example of dedicated naming service daemon ompi-server , or
  • code > MPROUAN of the process server session.

    In both cases customer sessions have to be provided with the place of naming service. For more information on how to deal with this in OPPI see and see my answer.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -