1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2005 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
11 * This program checks that MPI_Iprobe and MPI_Probe correctly handle
12 * a source of MPI_PROC_NULL
15 int main(int argc, char **argv)
21 MTest_Init(&argc, &argv);
23 MPI_Iprobe( MPI_PROC_NULL, 10, MPI_COMM_WORLD, &flag, &status );
26 printf( "Iprobe of source=MPI_PROC_NULL returned flag=false\n" );
29 if (status.MPI_SOURCE != MPI_PROC_NULL) {
30 printf( "Status.MPI_SOURCE was %d, should be MPI_PROC_NULL\n",
34 if (status.MPI_TAG != MPI_ANY_TAG) {
35 printf( "Status.MPI_TAG was %d, should be MPI_ANY_TAGL\n",
40 /* If Iprobe failed, probe is likely to as well. Avoid a possible hang
41 by testing Probe only if Iprobe test passed */
43 MPI_Probe( MPI_PROC_NULL, 10, MPI_COMM_WORLD, &status );
44 if (status.MPI_SOURCE != MPI_PROC_NULL) {
45 printf( "Status.MPI_SOURCE was %d, should be MPI_PROC_NULL\n",
49 if (status.MPI_TAG != MPI_ANY_TAG) {
50 printf( "Status.MPI_TAG was %d, should be MPI_ANY_TAGL\n",
56 MTest_Finalize( errs );