From a502b8801282e2b64fcb6bb0e74369797c4da45c Mon Sep 17 00:00:00 2001 From: Luka Stanisic Date: Fri, 11 Dec 2015 20:25:18 +0100 Subject: [PATCH] [starpu] using segment index only when there is a privatization of global variables --- src/smpi/smpi_global.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index 295ddfbd2c..7b47526f7a 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -83,14 +83,15 @@ void smpi_process_init(int *argc, char ***argv) SIMIX_process_set_cleanup_function(proc, SIMIX_process_cleanup); char* instance_id = (*argv)[1]; int rank = atoi((*argv)[2]); - /* Now using segment index of the process */ - index = proc->segment_index; + index = smpi_process_index_of_smx_process(proc); if(!index_to_process_data){ index_to_process_data=(int*)xbt_malloc(SIMIX_process_count()*sizeof(int)); } if(smpi_privatize_global_variables){ + /* Now using segment index of the process */ + index = proc->segment_index; /* Done at the process's creation */ SMPI_switch_data_segment(index); } -- 2.20.1