6 /* Test request creation */
8 int main( int argc, char **argv )
10 int i, n, n_goal = 2048, rc, len, buf[1];
11 MPI_Request *req_array;
13 char msg[MPI_MAX_ERROR_STRING];
15 MPI_Init( &argc, &argv );
16 MPI_Errhandler_set( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
20 req_array = (MPI_Request *)malloc( n * sizeof(MPI_Request) );
23 rc = MPI_Irecv( buf, 1, MPI_INT, 0, i, MPI_COMM_WORLD, req_array + i );
25 fprintf( stderr, "Error when creating request number %d\n", i );
26 MPI_Error_string( rc, msg, &len );
27 fprintf( stderr, "%s\n", msg );
33 rc = MPI_Cancel( req_array + i );
35 fprintf( stderr, "Error when canceling request number %d\n", i );
36 MPI_Error_string( rc, msg, &len );
37 fprintf( stderr, "%s\n", msg );
41 rc = MPI_Request_free( req_array + i );
43 fprintf( stderr, "Error when freeing request number %d\n", i );
44 MPI_Error_string( rc, msg, &len );
45 fprintf( stderr, "%s\n", msg );
51 printf( "Completed test of %d request creations (with cancel)\n", n );
54 rc = MPI_Irecv( buf, 1, MPI_INT, MPI_PROC_NULL, i, MPI_COMM_WORLD,
57 fprintf( stderr, "Error when creating request number %d\n", i );
58 MPI_Error_string( rc, msg, &len );
59 fprintf( stderr, "%s\n", msg );
65 rc = MPI_Wait( req_array + i, &status );
67 fprintf( stderr, "Error when waiting on request number %d\n", i );
68 MPI_Error_string( rc, msg, &len );
69 fprintf( stderr, "%s\n", msg );
75 printf( "Completed test of %d request creations (with wait)\n", n );
78 "This MPI implementation limits the number of request that can be created\n\
79 This is allowed by the standard and is not a bug, but is a limit on the\n\