[mpich-discuss] mpi error
moussa boutouil
b.moussa1989 at live.fr
Tue Apr 3 09:36:59 CDT 2012
Hello, I have a client/server program, and I run it in the same machine (I have already installed MPICH2 on my machine which have OS Windows 7 64-bits).When I run the server program in commend line, this error appears: Fatal error in MPI_Open_port: Other MPI error, error stack: MPI_Open_port(124): MPI_Open_port(MPI_INFO_NULL, port=0x003CF6B4) failed MPID_Open_port(69): Function not implemented ****here we have the server code : #include "mpi.h" #include <cstdio> #include "string.h" #define MAX_DATA 100 using namespace std; int main( int argc, char **argv ) { MPI_Comm server; double buf[MAX_DATA]; char port_name[MPI_MAX_PORT_NAME]; MPI_Init( &argc, &argv ); strcpy(port_name, argv[1]); /* assume server's name is cmd-line arg */ MPI_Comm_connect( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &server ); bool done = false; int tag, n = 0; while (!done) { tag = 2; MPI_Send( buf, n++, MPI_DOUBLE, 0, tag, server ); } MPI_Send( buf, 0, MPI_DOUBLE, 0, 1, server ); MPI_Comm_disconnect( &server ); MPI_Finalize(); return 0; } ****here we have the client code : #include "mpi.h" #include <cstdio> #include "string.h" #define MAX_DATA 100 using namespace std;
int main( int argc, char **argv ) { MPI_Comm client; MPI_Status status; char por t_name[MPI_MAX_PORT_NAME]; double buf[MAX_DATA]; int size, again; MPI_Init( &argc, &argv ); MPI_Comm_size(MPI_COMM_WORLD, &size); //if (size != 1) error(FATAL, "Server too big"); MPI_Open_port(MPI_INFO_NULL, port_name); printf("server available at %s\n",port_name); while (1) { MPI_Comm_accept( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &client ); again = 1; while (again) { MPI_Recv( buf, MAX_DATA, MPI_DOUBLE, MPI_ANY_SOURCE, MPI_ANY_TAG, client, &status ); switch (status.MPI_TAG) { case 0: MPI_Comm_free( &client ); MPI_Close_port(port_name); MPI_Finalize(); return 0; case 1: MPI_Comm_disconnect( &client ); again = 0; break; case 2: /* do something */ break; default: /* Unexpected message type */ MPI_Abort( MPI_COMM_WORLD, 1 ); } } } }
if you have any solution, please help me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120403/89b9584d/attachment.htm>
More information about the mpich-discuss
mailing list