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) {
15 int i, j, rank, nproc;
16 MPI_Info info_in, info_out;
17 int errors = 0, all_errors = 0;
20 char 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);
27 MPI_Comm_size(MPI_COMM_WORLD, &nproc);
29 MPI_Info_create(&info_in);
30 MPI_Info_set(info_in, invalid_key, "true");
32 MPI_Win_allocate(sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &base, &win);
34 MPI_Win_set_info(win, info_in);
35 MPI_Win_get_info(win, &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_get(info_out, "no_locks", MPI_MAX_INFO_VAL, buf, &flag);
49 if (flag && VERBOSE) printf("%d: no_locks = %s\n", rank, buf);
51 MPI_Info_get(info_out, "accumulate_ordering", MPI_MAX_INFO_VAL, buf, &flag);
52 if (flag && VERBOSE) printf("%d: accumulate_ordering = %s\n", rank, buf);
54 MPI_Info_get(info_out, "accumulate_ops", MPI_MAX_INFO_VAL, buf, &flag);
55 if (flag && VERBOSE) printf("%d: accumulate_ops = %s\n", rank, buf);
57 MPI_Info_get(info_out, "same_size", MPI_MAX_INFO_VAL, buf, &flag);
58 if (flag && VERBOSE) printf("%d: same_size = %s\n", rank, buf);
60 MPI_Info_get(info_out, "alloc_shm", MPI_MAX_INFO_VAL, buf, &flag);
61 if (flag && VERBOSE) printf("%d: alloc_shm = %s\n", rank, buf);
63 MPI_Info_free(&info_in);
64 MPI_Info_free(&info_out);
67 MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
69 if (rank == 0 && all_errors == 0)
70 printf(" No Errors\n");