X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ad11907f9221fee26cbe223d667a33744278f46b..d4fb7b9d845c48b3274774833a3b848750a73766:/src/smpi/smpi_global.cpp diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index db6e796b2d..595b87954f 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -17,12 +17,14 @@ #include "src/msg/msg_private.h" #include "src/simix/SynchroComm.hpp" - -#include /* DBL_MAX */ +#include /* DBL_MAX */ +#include +#include #include #include #include -#include +#include +#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (kernel)"); #include @@ -59,7 +61,7 @@ typedef struct s_smpi_process_data { bool replaying; /* is the process replaying a trace */ xbt_bar_t finalization_barrier; int return_value; - smpi_trace_call_location_t* trace_call_loc; + smpi_trace_call_location_t trace_call_loc; #if HAVE_PAPI /** Contains hardware data as read by PAPI **/ int papi_event_set; @@ -256,7 +258,7 @@ int smpi_process_count() smpi_trace_call_location_t* smpi_process_get_call_location() { smpi_process_data_t process_data = smpi_process_data(); - return process_data->trace_call_loc; + return &process_data->trace_call_loc; } int smpi_process_index() @@ -567,10 +569,6 @@ void smpi_global_init() process_data[i]->finalization_barrier = nullptr; process_data[i]->return_value = 0; - if (xbt_cfg_get_boolean("smpi/trace-call-location")) { - process_data[i]->trace_call_loc = xbt_new(smpi_trace_call_location_t, 1); - } - #if HAVE_PAPI if (xbt_cfg_get_string("smpi/papi-events")[0] != '\0') { // TODO: Implement host/process/thread based counters. This implementation @@ -624,12 +622,9 @@ void smpi_global_destroy() } xbt_os_timer_free(process_data[i]->timer); xbt_mutex_destroy(process_data[i]->mailboxes_mutex); - if (xbt_cfg_get_boolean("smpi/trace-call-location")) { - xbt_free(process_data[i]->trace_call_loc); - } delete process_data[i]; } - delete process_data; + delete[] process_data; process_data = nullptr; if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){