From: Christian Heinrich Date: Fri, 27 May 2016 15:28:18 +0000 (+0200) Subject: [SMPI] Only allocate memory for call-loc when cfg-option is given X-Git-Tag: v3_14~1130^2~12 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3fab894cbce7d5bdd43a6fc9aa647b3809d63507?ds=sidebyside [SMPI] Only allocate memory for call-loc when cfg-option is given This saves us some memory. --- diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index 1fa813dc6c..13b9b3b0bb 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -471,7 +471,10 @@ void smpi_global_init(void) process_data[i]->sampling = 0; process_data[i]->finalization_barrier = NULL; process_data[i]->return_value = 0; - process_data[i]->trace_call_loc = xbt_new(smpi_trace_call_location_t, 1); + + if (xbt_cfg_get_boolean("smpi/trace-call-location")) { + process_data[i]->trace_call_loc = xbt_new(smpi_trace_call_location_t, 1); + } } //if the process was launched through smpirun script we generate a global mpi_comm_world //if not, we let MPI_COMM_NULL, and the comm world will be private to each mpi instance @@ -509,7 +512,9 @@ void smpi_global_destroy(void) } xbt_os_timer_free(process_data[i]->timer); xbt_mutex_destroy(process_data[i]->mailboxes_mutex); - xbt_free(process_data[i]->trace_call_loc); + if (xbt_cfg_get_boolean("smpi/trace-call-location")) { + xbt_free(process_data[i]->trace_call_loc); + } xbt_free(process_data[i]); } xbt_free(process_data);