LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: rahul kumar (rahul_s_kumar_at_[hidden])
Date: 2003-07-01 14:49:51


I am trying to set up a server using MPI - first time with Dynamic Processes
and I am using mpich2.0.93.
I am getting the following error when I run my server code:

Fatal error (code 0x2800659c) in MPI_Open_port():
MPI_Open_port(63): Null Info pointer
ABORT - process 0

I am not sure why I get this because others have compiled the code and run
it successfully. I have checked the code reapetedly. The code is below the
email. Any help would be appreciated.

int main( int argc, char **argv )
{
  MPI_Comm client;
  MPI_Status status;
  char port_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){
    printf("Server too big");
    MPI_Abort(MPI_COMM_WORLD, 0);
  }

  // set up port for receiving connections
  MPI_Open_port(MPI_INFO_NULL, port_name);
  printf("server available at %s\n",port_name);

  // to accept connections
  while (1) {
    printf("one\n");
    MPI_Comm_accept( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &client );
    again = 1;
    while (again) {
      printf("two\n");
      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 );
      }
    }
  }
}

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus