Hi folks,

I am working on a simple client/server program but I don’t want to use mpirun 
to start the program (In nature, I just want to adopt MPI API into my own 
project but cannot start it using mpirun). I mostly followed the singleton mode 
of MPI, using APIs like MPI_Open_port, MPI_Comm_connect, and MPI_Comm_accept. 
But it doesn’t work, especially the port_name is something like 
4034413554.0:228712872, which really confuse me.

Anyone knows how to achieve that? I attach my server and client key source code 
for your reference.

server side:

char myport[MPI_MAX_PORT_NAME];
MPI_Open_port(MPI_INFO_NULL, myport);
cout << myport << endl; (assume myport is 4034413554.0:228712872, it always 
return string like this)
MPI_Comm_accept(myport, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &client);
MPI_Recv(&number, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, client, &status);


client side:

char name[] = "4034413554.0:228712872";
MPI_Comm_connect(name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &server);
int number = -1 ;
MPI_Send(&number, 1, MPI_INT, 0, 0, server);

Best,
Rui
_______________________________________________
devel mailing list
devel@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/devel

Reply via email to