CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Mpi

  1. #1
    Join Date
    Jul 2008
    Posts
    2

    Angry Mpi

    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

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Mpi

    Please do not cross post in multiple forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured