Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge back master branch.
[simgrid.git] / src / smpi / smpi_bench.c
index e531e85..b9d6366 100644 (file)
@@ -16,6 +16,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi,
 xbt_dict_t allocs = NULL;       /* Allocated on first use */
 xbt_dict_t samples = NULL;      /* Allocated on first use */
 xbt_dict_t calls = NULL;        /* Allocated on first use */
 xbt_dict_t allocs = NULL;       /* Allocated on first use */
 xbt_dict_t samples = NULL;      /* Allocated on first use */
 xbt_dict_t calls = NULL;        /* Allocated on first use */
+__thread int smpi_current_rank = 0;      /* Updated after each MPI call */
 
 typedef struct {
   int count;
 
 typedef struct {
   int count;
@@ -73,6 +74,7 @@ static void smpi_execute(double duration)
 void smpi_bench_begin(void)
 {
   xbt_os_timer_start(smpi_process_timer());
 void smpi_bench_begin(void)
 {
   xbt_os_timer_start(smpi_process_timer());
+  smpi_current_rank = smpi_process_index();
 }
 
 void smpi_bench_end(void)
 }
 
 void smpi_bench_end(void)