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: / P> compiled and executed Print My Client compiled and executed 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: and 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: 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. MY_IP
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
mpic ++ mpi_src.cc -o mpi_srv.x mpirun mpi_srv.x
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; }
mpic ++ mpi_client.cc -o mpi_client.x mpirun mpi_client.x
$ Mpirun mpi_server.x ...
$ mpun mpi_client.x ...
ompi-server , or
Comments
Post a Comment