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 __attribute__((unused)) invalid_key[] = "invalid_test_key";
21 char buf[MPI_MAX_INFO_VAL];
24 MPI_Init(&argc, &argv);
26 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
28 MPI_Info_create(&info_in);
29 MPI_Info_set(info_in, invalid_key, (char *) "true");
31 MPI_Comm_dup(MPI_COMM_WORLD, &comm);
33 MPI_Comm_set_info(comm, info_in);
34 MPI_Comm_get_info(comm, &info_out);
36 MPI_Info_get(info_out, invalid_key, MPI_MAX_INFO_VAL, buf, &flag);
37 #ifndef USE_STRICT_MPI
38 /* Check if our invalid key was ignored. Note, this check's MPICH's
39 * behavior, but this behavior may not be required for a standard
40 * conforming MPI implementation. */
42 printf("%d: %s was not ignored\n", rank, invalid_key);
47 MPI_Info_free(&info_in);
48 MPI_Info_free(&info_out);
51 MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
53 if (rank == 0 && all_errors == 0)
54 printf(" No Errors\n");