From 3fab894cbce7d5bdd43a6fc9aa647b3809d63507 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Fri, 27 May 2016 17:28:18 +0200 Subject: [PATCH] [SMPI] Only allocate memory for call-loc when cfg-option is given This saves us some memory. --- src/smpi/smpi_global.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 2.20.1