1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2001 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
8 Check that MPI_xxxx_c2f, applied to the same object several times,
9 yields the same handle. We do this because when MPI handles in
10 C are a different length than those in Fortran, care needs to
11 be exercised to ensure that the mapping from one to another is unique.
12 (Test added to test a potential problem in ROMIO for handling MPI_File
19 int main( int argc, char *argv[] )
21 MPI_Fint handleA, handleB;
29 MTest_Init( &argc, &argv );
32 rc = MPI_Irecv( buf, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &cRequest );
35 printf( "Unable to create request\n" );
38 handleA = MPI_Request_c2f( cRequest );
39 handleB = MPI_Request_c2f( cRequest );
40 if (handleA != handleB) {
42 printf( "MPI_Request_c2f does not give the same handle twice on the same MPI_Request\n" );
45 MPI_Cancel( &cRequest );
46 MPI_Test( &cRequest, &tFlag, &st );
47 MPI_Test_cancelled( &st, &tFlag );
50 printf( "Unable to cancel MPI_Irecv request\n" );
52 /* Using MPI_Request_free should be ok, but some MPI implementations
53 object to it imediately after the cancel and that isn't essential to
56 MTest_Finalize( errs );