1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
4 * (C) 2012 by Argonne National Laboratory.
5 * See COPYRIGHT in top-level directory.
14 int main(int argc, char **argv)
17 MPI_Info info_in, info_out;
18 int errors = 0, all_errors = 0;
20 char invalid_key[] = "invalid_test_key";
22 char buf[MPI_MAX_INFO_VAL];
25 MPI_Init(&argc, &argv);
27 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
29 MPI_Info_create(&info_in);
30 MPI_Info_set(info_in, invalid_key, val);
32 MPI_Comm_dup(MPI_COMM_WORLD, &comm);
34 MPI_Comm_set_info(comm, info_in);
35 MPI_Comm_get_info(comm, &info_out);
37 MPI_Info_get(info_out, invalid_key, MPI_MAX_INFO_VAL, buf, &flag);
38 #ifndef USE_STRICT_MPI
39 /* Check if our invalid key was ignored. Note, this check's MPICH's
40 * behavior, but this behavior may not be required for a standard
41 * conforming MPI implementation. */
43 printf("%d: %s was not ignored\n", rank, invalid_key);
48 MPI_Info_free(&info_in);
49 MPI_Info_free(&info_out);
52 MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
54 if (rank == 0 && all_errors == 0)
55 printf(" No Errors\n");