[OMPI devel] Developing MPI program without mpirun

2016-11-17 Thread Rui Liu
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

Re: [OMPI devel] Developing MPI program without mpirun

2016-11-18 Thread Rui Liu
Hi Howard,

1. I am using a cluster which involves 20 ubuntu 14.04 servers, and each sever 
is equipped with infiniBand RDMA for communication and data transfer.
2. Open MPI v2.0.1
3. I just use prefix option to indicate the install directory with ./configure 
command, and use make all & sudo make install command further.
4. the test app program, which has client and server sides, is very simple. I 
hope to run them by ./server and ./client command 

server side:

#include “mpi.h"
#include 
using namespace std;

int main(int argc,  char **argv) {
MPI_Comm client;
MPI_Status status;
MPI_Init(&argc, &argv);
    int number = 0;
char myport[MPI_MAX_PORT_NAME];
MPI_Open_port(MPI_INFO_NULL, myport);
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:

#include “mpi.h"
#include 
using namespace std;
int main(int argc, char **argv) {    
MPI_Comm server;
MPI_Init(NULL, NULL);
char name[] = "3808886785.0:2871653702”;
MPI_Comm_connect(name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &server);
int number = -1 ;
MPI_Send(&number, 1, MPI_INT, 0, 0, server);
}


On 18 November 2016 at 11:24:26 PM, Pritchard Jr., Howard (howa...@lanl.gov) 
wrote:

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  on behalf of Rui Liu 

Reply-To: Open MPI Developers 
Date: Thursday, November 17, 2016 at 6:58 PM
To: "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___
devel mailing list
devel@lists.open-mpi.org
https://rfd.newmexicoconsortium.org/mailman/listinfo/devel