LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Mihai Basa (mbasa_at_[hidden])
Date: 2003-07-16 09:55:36


>>WB> for (iSlave = 1; iSlave < iSize; iSlave++)
>>WB> {
>>WB> // build handles for the receipt of results
>
>
>>Shouldn't this be "for (iSlave = 0;... " ?
>
> the number '0' is the rank of the process. my master process is rank 0, so i
> wanna initiate receives from the slave processes which start from 1.

William, I realized that. But you're using the counter "iSlave" for filling up
the requests array:

  for (iSlave = 1; iSlave < iSize; iSlave++)
  {
    // build handles for the receipt of results
    MPI_Recv_init(&recvResult[iSlave],
                  1,
                  MPI_ResultType,
                  iSlave,
                  RESULTTAG,
                  MPI_COMM_WORLD,
                  &mastersRequests[iSlave]);

(see the last line?)

This means mastersRequests[0] is undefined. Use "&mastersRequests[iSlave-1]);"
instead. Good luck!

Mihai