Click to See Complete Forum and Search --> : Mpi


Kochu
July 23rd, 2008, 12:45 AM
Hi I have done a Client Server Program using MPI. While calling one of the API MPI_Open_port() in server side iam getting an error "Fatal error in MPI_Open_port: Other MPI error".. Can any body tell why this happens and solution for that.. Iam attaching the code snippet for that

#include <mpi.h>
#include <string.h>
#include <stdio.h>
#include <windows.h>
#include <iostream.h>

#pragma comment( lib, "msmpi.lib" )

int main( int argc, char* argv[] )
{
MPI_Status Status;
char Buffer;
char Message;
int NumProcess, Rank;
int SendRecStatus;
char myport[MPI_MAX_PORT_NAME]={0};
MPI_Request Request;
MPI_Comm intercomm;

// Initialize the MPI execution environment
MPI_Init( &argc, &argv );
// Determines the size of the group associated with a communicator
MPI_Comm_size( MPI_COMM_WORLD, &NumProcess );
// Determines the rank of the calling process in the communicator
MPI_Open_port(MPI_INFO_NULL, myport);
printf("port name is: %s\n", myport);
MPI_Comm_accept( "10.1.27.64:3210", MPI_INFO_NULL, 0, MPI_COMM_WORLD, &intercomm);
printf("client connected\n");
MPI_Recv( &Message, 5, MPI_CHAR, MPI_ANY_SOURCE, MPI_ANY_TAG, intercomm, &Status);
cout<<Message;
MPI_Comm_free(&intercomm);
MPI_Close_port("10.1.27.64");
// Terminates MPI execution environment
SendRecStatus = MPI_Finalize();

return 0;
}


Thanks

kirants
July 23rd, 2008, 01:27 AM
Please do not cross post in multiple forums