X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1cc85ce727500e6d76330be0d271950777c949e9..f7d3e337e64b54125c8a990a99583383a6bf9780:/src/smpi/smpi_bench.c?ds=sidebyside diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index 6feda0fcd4..915a5a543e 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -220,6 +220,8 @@ typedef struct { int benching; /* 1: we are benchmarking; 0: we have enough data, no bench anymore */ } local_data_t; +int smpi_sample_is_running = 0; + static char *sample_location(int global, const char *file, int line) { if (global) { return bprintf("%s:%d", file, line); @@ -247,6 +249,8 @@ void smpi_sample_1(int global, const char *file, int line, int iters, double thr local_data_t *data; smpi_bench_end(); /* Take time from previous, unrelated computation into account */ + smpi_sample_is_running++; + if (!samples) samples = xbt_dict_new_homogeneous(free); @@ -301,6 +305,7 @@ int smpi_sample_2(int global, const char *file, int line) data->count, data->iters, data->relstderr, data->threshold, data->mean); smpi_execute(data->mean); + smpi_sample_is_running--; smpi_bench_begin(); // prepare to capture future, unrelated computations return 0; } @@ -397,7 +402,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line) case EEXIST: xbt_die("Please cleanup /dev/shm/%s", loc); default: - xbt_die("An unhandled error occured while opening %s: %s", loc, strerror(errno)); + xbt_die("An unhandled error occured while opening %s. shm_open: %s", loc, strerror(errno)); } } data = xbt_new(shared_data_t, 1); @@ -406,7 +411,7 @@ void *smpi_shared_malloc(size_t size, const char *file, int line) data->loc = loc; mem = shm_map(fd, size, data); if (shm_unlink(loc) < 0) { - XBT_WARN("Could not early unlink %s: %s", loc, strerror(errno)); + XBT_WARN("Could not early unlink %s. shm_unlink: %s", loc, strerror(errno)); } xbt_dict_set(allocs, loc, data, NULL); XBT_DEBUG("Mapping %s at %p through %d", loc, mem, fd);