Just for a change, I don't have a build problem!

However, I have a question about the MPI_Testsome() call. I'm using MPI_Testsome() to check the completion status of a number of outstanding ISend() requests. I'm doing something like this:

int outstanding;

main()
{
    tids = (int *)malloc(sizeof(int) * count);
    stats = (MPI_Status *)malloc(sizeof(MPI_Status) * count);
    reqs = (MPI_Request *) malloc(sizeof(MPI_Request) * count)

    do_sends();

    outstanding = count;

    while (outstanding > 0)
        check_completed();
}

do_sends()
{
    for (i = 0; i < count; i++)
        MPI_ISend(buf, len, MPI_CHAR, i, 0, MPI_COMM_WORLD, &reqs[i]);
}

check_completed()
{
    int completed;

if (MPI_Testsome(count, reqs, &completed, tids, stats) != MPI_SUCCESS) {
        printf("error in testsome\n");
        exit(1);
    }
    outstanding -= completed;
}

The thing is, MPI_Testsome() returns with completed = 1 the first time I call it, then completed = -32766 the second time I call it. It always returns MPI_SUCCESS though.

Does anyone know what's going on? Am I doing something dumb?

Thanks,

Greg

Reply via email to