X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e27a029fd9ac8f4fbeeb04faaa410c1c09422d74:/teshsuite/smpi/bcast/bcast_coll.c..bcd50afc8279afbeed3aa52ff1976b7d11da2ccb:/teshsuite/smpi/coll-bcast/coll-bcast.c diff --git a/teshsuite/smpi/bcast/bcast_coll.c b/teshsuite/smpi/coll-bcast/coll-bcast.c similarity index 88% rename from teshsuite/smpi/bcast/bcast_coll.c rename to teshsuite/smpi/coll-bcast/coll-bcast.c index bceaf4087c..0e22735ee8 100644 --- a/teshsuite/smpi/bcast/bcast_coll.c +++ b/teshsuite/smpi/coll-bcast/coll-bcast.c @@ -11,14 +11,12 @@ int main(int argc, char **argv) { int i, size, rank; int count = 2048; - int *values; - int status; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); - - values = (int *) xbt_malloc(count * sizeof(int)); + + int *values = (int *) xbt_malloc(count * sizeof(int)); for (i = 0; i < count; i++) values[i] = (0 == rank) ? 17 : 3; @@ -39,16 +37,13 @@ int main(int argc, char **argv) for (i = 0; i < count; i++) values[i] = (size -1 == rank) ? 17 : 3; - status = MPI_Bcast(values, count, MPI_INT, size-1, MPI_COMM_WORLD); + int status = MPI_Bcast(values, count, MPI_INT, size-1, MPI_COMM_WORLD); good = 0; for (i = 0; i < count; i++) if (values[i]==17) good++; printf("[%d] number of values equals to 17: %d\n", rank, good); - - - if (rank == 0) { if (status != MPI_SUCCESS) { printf("bcast returned %d\n", status);