X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a06d371bdabe5d7c00f54b941d31068c01e6d756..3c0a14501628a82cc844761204585a496d67e06b:/teshsuite/smpi/compute2.c diff --git a/teshsuite/smpi/compute2.c b/teshsuite/smpi/compute2.c index 1720d84c89..ea81081009 100644 --- a/teshsuite/smpi/compute2.c +++ b/teshsuite/smpi/compute2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2012. The SimGrid Team. +/* Copyright (c) 2009-2010, 2012, 2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -9,12 +9,14 @@ int main(int argc, char *argv[]) { - int i; + int i, n; double d; MPI_Init(&argc, &argv); + n = argc > 1 ? atoi(argv[1]) : 0; d = 2.0; -/* SMPI_DO_ONCE */ { - for (i = 0; i < atoi(argv[1]); i++) { + /* Run it only once across the whole set of processes */ + SMPI_SAMPLE_GLOBAL(1, -1) { + for (i = 0; i < n; i++) { if (d < 10000) { d = d * d; } else {