X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b73466ada27682d1729f394549479da83ef4a99..839ca861fcbfe4230637ffc30766445cc7b4918f:/teshsuite/smpi/mpich3-test/attr/attrend2.c diff --git a/teshsuite/smpi/mpich3-test/attr/attrend2.c b/teshsuite/smpi/mpich3-test/attr/attrend2.c index cf6d39f604..d71592b486 100644 --- a/teshsuite/smpi/mpich3-test/attr/attrend2.c +++ b/teshsuite/smpi/mpich3-test/attr/attrend2.c @@ -1,7 +1,7 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ /* * - * (C) 2008 by Argonne National Laboratory. + * (C) 2009 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ /* @@ -22,22 +22,21 @@ * assuming a decent hash function is used. */ #define NUM_TEST_ATTRS (20) -static __attribute__((unused)) int exit_keys[NUM_TEST_ATTRS]; /* init to MPI_KEYVAL_INVALID */ -static __attribute__((unused)) int was_called[NUM_TEST_ATTRS]; +static int exit_keys[NUM_TEST_ATTRS]; /* init to MPI_KEYVAL_INVALID */ +static int was_called[NUM_TEST_ATTRS]; int foundError = 0; -int delete_fn (MPI_Comm, int, void *, void *); +int delete_fn(MPI_Comm, int, void *, void *); int main(int argc, char **argv) { - int wrank; + int errs = 0, wrank; + int i; MTest_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &wrank); #if MTEST_HAVE_MIN_MPI_VERSION(2,2) - int errs = 0, wrank; - int i; for (i = 0; i < NUM_TEST_ATTRS; ++i) { exit_keys[i] = MPI_KEYVAL_INVALID; was_called[i] = 0; @@ -45,7 +44,7 @@ int main(int argc, char **argv) /* create the keyval for the exit handler */ MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN, delete_fn, &exit_keys[i], NULL); /* attach to comm_self */ - MPI_Comm_set_attr(MPI_COMM_SELF, exit_keys[i], (void*)(long)i); + MPI_Comm_set_attr(MPI_COMM_SELF, exit_keys[i], (void *) (long) i); } /* we can free the keys now */ @@ -66,12 +65,15 @@ int main(int argc, char **argv) } else if (was_called[i] > 1) { errs++; - printf("Attribute delete function on MPI_COMM_SELF was called multiple times for idx=%d\n", i); + printf + ("Attribute delete function on MPI_COMM_SELF was called multiple times for idx=%d\n", + i); } } if (foundError != 0) { errs++; - printf("Found %d errors while executing delete function in MPI_COMM_SELF\n", foundError); + printf("Found %d errors while executing delete function in MPI_COMM_SELF\n", + foundError); } if (errs == 0) { printf(" No Errors\n"); @@ -94,7 +96,7 @@ int delete_fn(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state) { int flag; int i; - int my_idx = (int)(long)attribute_val; + int my_idx = (int) (long) attribute_val; if (my_idx < 0 || my_idx > NUM_TEST_ATTRS) { printf("internal error, my_idx=%d is invalid!\n", my_idx); @@ -126,4 +128,3 @@ int delete_fn(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state) return MPI_SUCCESS; } -