LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Ahmad Faraj (faraj_at_[hidden])
Date: 2004-08-28 20:12:40


hi all;
i have this code snippet, it gives me errors that i really cant explain:
int main (int argc, char *argv[])
{
  MPI_Request * req;
  int my_rank;
  char tmp = 'a';

  MPI_Init(&argc, &argv);
  MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);

  if(my_rank==0)
  {
     req = malloc(2 * sizeof(MPI_Request));

      MPI_Irecv(&tmp, 1, MPI_CHAR, 0, 3, MPI_COMM_WORLD, &req[0]);
      MPI_Isend(&tmp, 1, MPI_CHAR, 0, 3, MPI_COMM_WORLD, &req[1]);
      MPI_Waitall(2, req, MPI_STATUSES_IGNORE);

      MPI_Request_free(&req[0]);
      MPI_Request_free(&req[1]);
      free((char*)req);
    }

  return 0;
}

here is the error
MPI_Request_free: invalid request handle (rank 0, MPI_COMM_WORLD)
Rank (0, MPI_COMM_WORLD): Call stack within LAM:
Rank (0, MPI_COMM_WORLD): - MPI_Request_free()
Rank (0, MPI_COMM_WORLD): - main()

can someone explain this, how to fix this
*********************************************************************
Ahmad Faraj Office: 170 James Lov Building
Ph.D Candidate Phone: (850)644-1533
Department of Computer Science Fax: (850)644-0058
Florida State University Email: faraj_at_[hidden]
Tallahassee, FL 32306 URL: http://www.cs.fsu.edu/~faraj
**********************************************************************