When we're checking the arguments, we check for the request array to not be NULL without looking to the number of requests. I think it make sense, as I don't see why the user would call these functions with 0 requests ... But, the other way around make sense too. As I don't find anything in the MPI standard that stop the user doing that I add the additional check to all MPI_Wait* and MPI_Test* functions.

Please get the version from trunk after revision 9504.

  Thanks,
    george.

On Mar 31, 2006, at 2:56 PM, Brunner, Thomas A. wrote:


I have an algorithm that collects information in a tree like manner using nonblocking communication. Some nodes do not receive information from other
nodes, so there are no outstanding requests on those nodes.  On all
processors, I check for the incoming messages using MPI_Testsome().
MPI_Testsome fails with OpenMPI, however if the request length is zero. Here is a code that can be run with only one processor that shows the same
behavior:

///////////////////////////////////////////

#include "mpi.h"
#include <stdio.h>

int main( int argc, char *argv[])
{
    int myid, numprocs;

    MPI_Init(&argc,&argv);
    MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
    MPI_Comm_rank(MPI_COMM_WORLD,&myid);

    printf("Hello from processor %i of %i\n", myid, numprocs);

    int size = 0;
    int num_done = 0;
    MPI_Status* stat = 0;
    MPI_Request* req = 0;
    int* done_indices = 0;

    MPI_Testsome( size, req, &num_done, done_indices, stat);

    printf("Finalizing on processor %i of %i\n", myid, numprocs);

    MPI_Finalize();

    return 0;
}

/////////////////////////////////////////

The output using OpenMPI is:

Hello from processor 0 of 1
[mymachine:09115] *** An error occurred in MPI_Testsome
[mymachine:09115] *** on communicator MPI_COMM_WORLD
[mymachine:09115] *** MPI_ERR_REQUEST: invalid request
[mymachine:09115] *** MPI_ERRORS_ARE_FATAL (goodbye)
1 process killed (possibly by Open MPI)


Many other MPI implementations support this, and reading the standard, it
seems like it should be OK.

Thanks,
Tom

<config.log.bz2>
<testsome_test.out>
<testsome_test.c>
<ompi_info.out>
_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

Reply via email to