Hello Rui,

Note there is no standard for the format of the port_name so don’t
read much what it looks like when printed out.

Could you provide some more information about your particular setup:

- characteristics of the system you are using, e.g. a Linux cluster,  laptop 
running os-x, etc.
- what version of Open MPI you are using
- if possible, the configure options used to build/install Open MPI
- the client/server test app (if its concise)

Thanks,

Howard

--
Howard Pritchard
HPC-DES
Los Alamos National Laboratory


From: devel 
<devel-boun...@lists.open-mpi.org<mailto:devel-boun...@lists.open-mpi.org>> on 
behalf of Rui Liu <l...@comp.nus.edu.sg<mailto:l...@comp.nus.edu.sg>>
Reply-To: Open MPI Developers 
<devel@lists.open-mpi.org<mailto:devel@lists.open-mpi.org>>
Date: Thursday, November 17, 2016 at 6:58 PM
To: "devel@lists.open-mpi.org<mailto:devel@lists.open-mpi.org>" 
<devel@lists.open-mpi.org<mailto:devel@lists.open-mpi.org>>
Subject: [OMPI devel] Developing MPI program without mpirun

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