From 04a09ccde81f8e6fd27b1f78c88f466d6935bfea Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 15 Sep 2017 23:21:19 +0200 Subject: [PATCH] Factorize SMPI_SAMPLE macros. --- include/smpi/smpi.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 6cde5393ca..eef491c376 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -914,13 +914,11 @@ XBT_PUBLIC(void) smpi_trace_set_call_location_(const char *file, int* line); /** Fortran binding + -fsecond-underscore **/ XBT_PUBLIC(void) smpi_trace_set_call_location__(const char *file, int* line); -#define SMPI_SAMPLE_LOCAL(iters,thres) for(smpi_sample_1(0, __FILE__, __LINE__, iters, thres); \ - smpi_sample_2(0, __FILE__, __LINE__); \ - smpi_sample_3(0, __FILE__, __LINE__)) - -#define SMPI_SAMPLE_GLOBAL(iters,thres) for(smpi_sample_1(1, __FILE__, __LINE__, iters, thres); \ - smpi_sample_2(1, __FILE__, __LINE__); \ - smpi_sample_3(1, __FILE__, __LINE__)) +#define SMPI_SAMPLE_LOOP(global, iters, thres) \ + for (smpi_sample_1(global, __FILE__, __LINE__, iters, thres); smpi_sample_2(global, __FILE__, __LINE__); \ + smpi_sample_3(global, __FILE__, __LINE__)) +#define SMPI_SAMPLE_LOCAL(iters, thres) SMPI_SAMPLE_LOOP(0, iters, thres) +#define SMPI_SAMPLE_GLOBAL(iters, thres) SMPI_SAMPLE_LOOP(1, iters, thres) #define SMPI_SAMPLE_DELAY(duration) for(smpi_execute(duration); 0; ) #define SMPI_SAMPLE_FLOPS(flops) for(smpi_execute_flops(flops); 0; ) -- 2.20.1