X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8c13bb27e65a53b8d533858a8c764ce5f7a3f067..01cfa7276bea34f747662c55a1ce2f2f7d38c1c6:/teshsuite/smpi/mpich3-test/init/attrself.c diff --git a/teshsuite/smpi/mpich3-test/init/attrself.c b/teshsuite/smpi/mpich3-test/init/attrself.c index 23398052f9..027a413c32 100644 --- a/teshsuite/smpi/mpich3-test/init/attrself.c +++ b/teshsuite/smpi/mpich3-test/init/attrself.c @@ -13,126 +13,129 @@ static char MTestDescrip[] = "Test creating and inserting attributes in \ different orders to ensure that the list management code handles all cases."; */ -int checkAttrs( MPI_Comm, int, int [], int [] ); -int delete_fn( MPI_Comm, int, void *, void *); +int checkAttrs(MPI_Comm, int, int[], int[]); +int delete_fn(MPI_Comm, int, void *, void *); #define NKEYS 5 -static int key[NKEYS]; /* Keys in creation order */ -static int keyorder[NKEYS]; /* Index (into key) of keys in order added to comm - (key[keyorder[0]] is first set) */ +static int key[NKEYS]; /* Keys in creation order */ +static int keyorder[NKEYS]; /* Index (into key) of keys in order added to comm + * (key[keyorder[0]] is first set) */ static int nkeys = 0; static int ncall = 0; -static int errs = 0; -/* - * Test that attributes on comm self are deleted in LIFO order +static int errs = 0; +/* + * Test that attributes on comm self are deleted in LIFO order */ -int main( int argc, char *argv[] ) +int main(int argc, char *argv[]) { - int attrval[10]; - int wrank, i; + int attrval[10]; + int wrank, i; MPI_Comm comm; - MPI_Init( &argc, &argv ); + MPI_Init(&argc, &argv); - MPI_Comm_rank( MPI_COMM_WORLD, &wrank ); + MPI_Comm_rank(MPI_COMM_WORLD, &wrank); comm = MPI_COMM_SELF; - + /* Create key values */ - for (nkeys=0; nkeys= nkeys) { - printf( "delete function called too many times!\n" ); - errs++; + printf("delete function called too many times!\n"); + errs++; } - /* As of MPI 2.2, the order of deletion of attributes on - MPI_COMM_SELF is defined */ + /* As of MPI 2.2, the order of deletion of attributes on + * MPI_COMM_SELF is defined */ if (MPI_VERSION > 2 || (MPI_VERSION == 2 && MPI_SUBVERSION >= 2)) { - if (keyval != key[keyorder[nkeys-1-ncall]]) { - printf( "Expected key # %d but found key with value %d\n", - keyorder[nkeys-1-ncall], keyval ); - errs++; - } + if (keyval != key[keyorder[nkeys - 1 - ncall]]) { + printf("Expected key # %d but found key with value %d\n", + keyorder[nkeys - 1 - ncall], keyval); + errs++; + } } ncall++; return MPI_SUCCESS; } /* -int checkNoAttrs( MPI_Comm comm, int n, int lkey[] ) +int checkNoAttrs(MPI_Comm comm, int n, int lkey[]) { int lerrs = 0; int i, flag, *val_p; for (i=0; i