From: Martin Quinson Date: Tue, 2 May 2017 15:28:57 +0000 (+0200) Subject: Now it works (if you don't look at the leaks) X-Git-Tag: v3.16~287^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bc0e9c9ecdf8b93f139978e522433f0a9fdcdedd Now it works (if you don't look at the leaks) --- diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index a3b3b87ac4..7946c2be86 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -249,7 +249,7 @@ void TRACE_mark(const char *mark_type, const char *mark_value) val_t value = PJ_value_get (mark_value, type); XBT_DEBUG("MARK %s %s", mark_type, mark_value); - NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value); + new NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value); } /** \ingroup TRACE_mark @@ -289,13 +289,13 @@ static void instr_user_variable(double time, const char *resource, const char *v type_t type = PJ_type_get (variable, container->type); switch (what){ case INSTR_US_SET: - SetVariableEvent(time, container, type, value); + new SetVariableEvent(time, container, type, value); break; case INSTR_US_ADD: - AddVariableEvent(time, container, type, value); + new AddVariableEvent(time, container, type, value); break; case INSTR_US_SUB: - SubVariableEvent(time, container, type, value); + new SubVariableEvent(time, container, type, value); break; default: THROW_IMPOSSIBLE; @@ -964,7 +964,7 @@ void TRACE_host_set_state (const char *host, const char *state, const char *valu container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ - SetStateEvent(MSG_get_clock(), container, type, val); + new SetStateEvent(MSG_get_clock(), container, type, val); } /** \ingroup TRACE_user_variables @@ -983,7 +983,7 @@ void TRACE_host_push_state (const char *host, const char *state, const char *val container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); val_t val = PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ - PushStateEvent(MSG_get_clock(), container, type, val); + new PushStateEvent(MSG_get_clock(), container, type, val); } /** \ingroup TRACE_user_variables @@ -1000,7 +1000,7 @@ void TRACE_host_pop_state (const char *host, const char *state) { container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); - PopStateEvent(MSG_get_clock(), container, type); + new PopStateEvent(MSG_get_clock(), container, type); } /** \ingroup TRACE_user_variables @@ -1017,7 +1017,7 @@ void TRACE_host_reset_state (const char *host, const char *state) { container_t container = PJ_container_get(host); type_t type = PJ_type_get (state, container->type); - ResetStateEvent(MSG_get_clock(), container, type); + new ResetStateEvent(MSG_get_clock(), container, type); } /** \ingroup TRACE_API diff --git a/src/instr/instr_paje_trace.cpp b/src/instr/instr_paje_trace.cpp index d134d20681..8843d0989b 100644 --- a/src/instr/instr_paje_trace.cpp +++ b/src/instr/instr_paje_trace.cpp @@ -20,10 +20,11 @@ static std::stringstream stream; void buffer_debug(std::vector *buf); void buffer_debug(std::vector *buf) { + return; XBT_DEBUG(">>>>>> Dump the state of the buffer. %zu events", buf->size()); for (auto event :*buf){ event->print(); - XBT_DEBUG("%s", stream.str().c_str()); + XBT_DEBUG("%p %s", event, stream.str().c_str()); stream.str(""); stream.clear(); } @@ -43,6 +44,7 @@ static void init_stream(PajeEvent* event) { static void print_row() { stream << std::endl; fprintf(tracing_file, "%s", stream.str().c_str()); + XBT_DEBUG("Dump %s", stream.str().c_str()); stream.str(""); stream.clear(); } diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 12f6266d60..c9baee5117 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -179,7 +179,7 @@ type_t PJ_type_link_new (const char *name, type_t father, type_t source, type_t ret = newType (name, key, nullptr, TYPE_LINK, father); XBT_DEBUG("LinkType %s(%s), child of %s(%s) %s(%s)->%s(%s)", ret->name, ret->id, father->name, father->id, source->name, source->id, dest->name, dest->id); - DefineLinkTypeEvent(ret, source, dest); + new DefineLinkTypeEvent(ret, source, dest); return ret; } @@ -195,4 +195,4 @@ type_t PJ_type_state_new (const char *name, type_t father) XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id); new DefineStateTypeEvent(ret); return ret; -} \ No newline at end of file +} diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index ef17a58ff6..0102392f45 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -114,13 +114,11 @@ class s_container { typedef s_container s_container_t; //-------------------------------------------------- -class PajeEvent; - class PajeEvent { public: double timestamp; e_event_type event_type; - virtual void print(){}; + virtual void print() = 0; void *data; virtual ~PajeEvent(); }; @@ -151,7 +149,7 @@ class DefineStateTypeEvent : public PajeEvent { type_t type; public: DefineStateTypeEvent(type_t type); - void print();// override; + void print() override; }; class DefineEventTypeEvent : public PajeEvent { diff --git a/src/instr/instr_resource_utilization.cpp b/src/instr/instr_resource_utilization.cpp index e8d848902a..0cfed5e590 100644 --- a/src/instr/instr_resource_utilization.cpp +++ b/src/instr/instr_resource_utilization.cpp @@ -29,7 +29,7 @@ static void __TRACE_surf_check_variable_set_to_zero(double now, const char *vari if (!xbt_dict_get_or_null(platform_variables, key)) { container_t container = PJ_container_get (resource); type_t type = PJ_type_get (variable, container->type); - SetVariableEvent (now, container, type, 0); + new SetVariableEvent (now, container, type, 0); xbt_dict_set(platform_variables, key, (char*)"", nullptr); } xbt_free(key); @@ -38,8 +38,8 @@ static void __TRACE_surf_check_variable_set_to_zero(double now, const char *vari static void instr_event (double now, double delta, type_t variable, container_t resource, double value) { __TRACE_surf_check_variable_set_to_zero(now, variable->name, resource->name); - AddVariableEvent(now, resource, variable, value); - SubVariableEvent(now + delta, resource, variable, value); + new AddVariableEvent(now, resource, variable, value); + new SubVariableEvent(now + delta, resource, variable, value); } /* TRACE_surf_link_set_utilization: entry point from SimGrid */ diff --git a/src/instr/instr_trace.cpp b/src/instr/instr_trace.cpp index f962223435..b226de9ebc 100644 --- a/src/instr/instr_trace.cpp +++ b/src/instr/instr_trace.cpp @@ -63,7 +63,7 @@ void TRACE_paje_dump_buffer (int force) if (!TRACE_is_enabled()) return; XBT_DEBUG("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump); if (force){ - for (auto event :buffer){ + for (auto event : buffer){ event->print(); delete event; } @@ -111,12 +111,16 @@ static void insert_into_buffer (PajeEvent* tbi) else XBT_DEBUG("%s: inserted at pos= %zd from its end", __FUNCTION__, std::distance(buffer.rbegin(),i)); + + buffer_debug(&buffer); } PajeEvent:: ~PajeEvent() { - XBT_DEBUG("%s not implemented: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, timestamp); - + XBT_DEBUG("%s not implemented for %p: event_type=%d, timestamp=%f", __FUNCTION__, + this, (int)event_type, timestamp); +// xbt_backtrace_display_current(); + /* switch (event->event_type){ case PAJE_StartLink: xbt_free (((startLink_t)(event->data))->value); @@ -228,7 +232,6 @@ DestroyContainerEvent::DestroyContainerEvent (container_t container) XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp); - //print it print(); } @@ -245,7 +248,6 @@ SetVariableEvent::SetVariableEvent (double timestamp, container_t container, typ insert_into_buffer (this); } - AddVariableEvent::AddVariableEvent (double timestamp, container_t container, type_t type, double value) { this->event_type = PAJE_AddVariable; @@ -318,9 +320,8 @@ PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value) -{ - new PushStateEvent(timestamp, container, type, value, nullptr); -} + : PushStateEvent(timestamp, container, type, value, nullptr) +{} PopStateEvent::PopStateEvent (double timestamp, container_t container, type_t type) { @@ -347,25 +348,25 @@ ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_ insert_into_buffer (this); } -StartLinkEvent::StartLinkEvent (double timestamp, container_t container, type_t type, container_t sourceContainer, - const char *value, const char *key) -{ - StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1); -} +StartLinkEvent::StartLinkEvent (double timestamp, container_t container, + type_t type, container_t sourceContainer, const char *value, const char *key) + : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1) +{} StartLinkEvent::StartLinkEvent (double timestamp, container_t container, type_t type, container_t sourceContainer, const char *value, const char *key, int size) { event_type = PAJE_StartLink; - timestamp = timestamp; + this->timestamp = timestamp; this->type = type; this->container = container; this->sourceContainer = sourceContainer; - value = xbt_strdup(value); - key = xbt_strdup(key); + this->value = xbt_strdup(value); + this->key = xbt_strdup(key); this->size = size; - XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp); + XBT_DEBUG("%s: event_type=%d, timestamp=%f, value:%s", __FUNCTION__, + (int)event_type, this->timestamp, this->value); insert_into_buffer (this); } diff --git a/src/msg/instr_msg_process.cpp b/src/msg/instr_msg_process.cpp index 263983422e..145bc34e14 100644 --- a/src/msg/instr_msg_process.cpp +++ b/src/msg/instr_msg_process.cpp @@ -38,7 +38,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, m //start link container_t msg = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root()); - StartLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); + new StartLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); //destroy existing container of this process TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process)); @@ -49,7 +49,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t old_host, m //end link msg = PJ_container_get(instr_process_id(process, str, len)); type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root()); - EndLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); + new EndLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); } } @@ -95,7 +95,7 @@ void TRACE_msg_process_suspend(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); val_t value = PJ_value_get ("suspend", type); - PushStateEvent (MSG_get_clock(), process_container, type, value); + new PushStateEvent (MSG_get_clock(), process_container, type, value); } } @@ -107,7 +107,7 @@ void TRACE_msg_process_resume(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - PopStateEvent (MSG_get_clock(), process_container, type); + new PopStateEvent (MSG_get_clock(), process_container, type); } } @@ -120,7 +120,7 @@ void TRACE_msg_process_sleep_in(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); val_t value = PJ_value_get ("sleep", type); - PushStateEvent (MSG_get_clock(), process_container, type, value); + new PushStateEvent (MSG_get_clock(), process_container, type, value); } } @@ -132,6 +132,6 @@ void TRACE_msg_process_sleep_out(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - PopStateEvent (MSG_get_clock(), process_container, type); + new PopStateEvent (MSG_get_clock(), process_container, type); } } diff --git a/src/msg/instr_msg_task.cpp b/src/msg/instr_msg_task.cpp index 6c42c1266b..65b69cc8e3 100644 --- a/src/msg/instr_msg_task.cpp +++ b/src/msg/instr_msg_task.cpp @@ -53,7 +53,7 @@ void TRACE_msg_task_execute_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); val_t value = PJ_value_get ("task_execute", type); - PushStateEvent (MSG_get_clock(), process_container, type, value); + new PushStateEvent (MSG_get_clock(), process_container, type, value); } } @@ -67,7 +67,7 @@ void TRACE_msg_task_execute_end(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - PopStateEvent (MSG_get_clock(), process_container, type); + new PopStateEvent (MSG_get_clock(), process_container, type); } } @@ -93,7 +93,7 @@ void TRACE_msg_task_get_start() container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); val_t value = PJ_value_get ("receive", type); - PushStateEvent (MSG_get_clock(), process_container, type, value); + new PushStateEvent (MSG_get_clock(), process_container, type, value); } } @@ -107,12 +107,12 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - PopStateEvent (MSG_get_clock(), process_container, type); + new PopStateEvent (MSG_get_clock(), process_container, type); char key[INSTR_DEFAULT_STR_SIZE]; snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter); type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root()); - EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key); + new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key); } } @@ -128,12 +128,12 @@ int TRACE_msg_task_put_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); val_t value = PJ_value_get ("send", type); - PushStateEvent (MSG_get_clock(), process_container, type, value); + new PushStateEvent (MSG_get_clock(), process_container, type, value); char key[INSTR_DEFAULT_STR_SIZE]; snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter); type = PJ_type_get ("MSG_PROCESS_TASK_LINK", PJ_type_get_root()); - StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key); + new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key); } return 1; @@ -149,6 +149,6 @@ void TRACE_msg_task_put_end() container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - PopStateEvent (MSG_get_clock(), process_container, type); + new PopStateEvent (MSG_get_clock(), process_container, type); } } diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index 95718a4902..1049c455e6 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -207,7 +207,7 @@ void MSG_vm_start(msg_vm_t vm) container_t vm_container = PJ_container_get(vm->cname()); type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type); val_t value = PJ_value_get_or_new("start", "0 0 1", type); // start is blue - PushStateEvent(MSG_get_clock(), vm_container, type, value); + new PushStateEvent(MSG_get_clock(), vm_container, type, value); } } @@ -319,7 +319,7 @@ static int migration_rx_fun(int argc, char *argv[]) // start link container_t msg = PJ_container_get(vm->cname()); type_t type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root()); - StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); + new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); // destroy existing container of this vm container_t existing_container = PJ_container_get(vm->cname()); @@ -332,7 +332,7 @@ static int migration_rx_fun(int argc, char *argv[]) // end link msg = PJ_container_get(vm->cname()); type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root()); - EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); + new EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); } // Inform the SRC that the migration has been correctly performed @@ -823,7 +823,7 @@ void MSG_vm_suspend(msg_vm_t vm) container_t vm_container = PJ_container_get(vm->cname()); type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type); val_t value = PJ_value_get_or_new("suspend", "1 0 0", type); // suspend is red - PushStateEvent(MSG_get_clock(), vm_container, type, value); + new PushStateEvent(MSG_get_clock(), vm_container, type, value); } } @@ -839,7 +839,7 @@ void MSG_vm_resume(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->cname()); type_t type = PJ_type_get("MSG_VM_STATE", vm_container->type); - PopStateEvent(MSG_get_clock(), vm_container, type); + new PopStateEvent(MSG_get_clock(), vm_container, type); } } diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index 2a1edb5d3f..40c061bc7a 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -20,7 +20,7 @@ char cont_name[25];\ snprintf(cont_name,25, "rank-%d", smpi_process()->index());\ val_t value = PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name,"1.0 1.0 1.0", type);\ - NewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\ + new NewEvent (SIMIX_get_clock(), PJ_container_get(cont_name), type, value);\ } #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)\ diff --git a/src/smpi/instr_smpi.cpp b/src/smpi/instr_smpi.cpp index a4a7b2d23c..3084597efa 100644 --- a/src/smpi/instr_smpi.cpp +++ b/src/smpi/instr_smpi.cpp @@ -246,7 +246,7 @@ void TRACE_smpi_collective_in(int rank, int root, const char *operation, instr_e type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color (operation); val_t value = PJ_value_get_or_new (operation, color, type); - PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } void TRACE_smpi_collective_out(int rank, int root, const char *operation) @@ -259,7 +259,7 @@ void TRACE_smpi_collective_out(int rank, int root, const char *operation) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - PopStateEvent (SIMIX_get_clock(), container, type); + new PopStateEvent (SIMIX_get_clock(), container, type); } void TRACE_smpi_computing_init(int rank) @@ -274,7 +274,7 @@ void TRACE_smpi_computing_init(int rank) type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color ("computing"); val_t value = PJ_value_get_or_new ("computing", color, type); - PushStateEvent (SIMIX_get_clock(), container, type, value); + new PushStateEvent (SIMIX_get_clock(), container, type, value); } void TRACE_smpi_computing_in(int rank, instr_extra_data extra) @@ -290,7 +290,7 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); val_t value = PJ_value_get_or_new ("computing", nullptr, type); - PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } void TRACE_smpi_computing_out(int rank) @@ -301,7 +301,7 @@ void TRACE_smpi_computing_out(int rank) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - PopStateEvent (SIMIX_get_clock(), container, type); + new PopStateEvent (SIMIX_get_clock(), container, type); } void TRACE_smpi_sleeping_init(int rank) @@ -316,7 +316,7 @@ void TRACE_smpi_sleeping_init(int rank) type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color ("sleeping"); val_t value = PJ_value_get_or_new ("sleeping", color, type); - PushStateEvent (SIMIX_get_clock(), container, type, value); + new PushStateEvent (SIMIX_get_clock(), container, type, value); } void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) @@ -332,7 +332,7 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); val_t value = PJ_value_get_or_new ("sleeping", nullptr, type); - PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } void TRACE_smpi_sleeping_out(int rank) @@ -343,7 +343,7 @@ void TRACE_smpi_sleeping_out(int rank) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - PopStateEvent (SIMIX_get_clock(), container, type); + new PopStateEvent (SIMIX_get_clock(), container, type); } void TRACE_smpi_testing_in(int rank, instr_extra_data extra) @@ -359,7 +359,7 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); val_t value = PJ_value_get_or_new ("test", nullptr, type); - PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } void TRACE_smpi_testing_out(int rank) @@ -370,7 +370,7 @@ void TRACE_smpi_testing_out(int rank) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - PopStateEvent (SIMIX_get_clock(), container, type); + new PopStateEvent (SIMIX_get_clock(), container, type); } void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_extra_data extra) @@ -386,7 +386,7 @@ void TRACE_smpi_ptp_in(int rank, int src, int dst, const char *operation, instr_ type_t type = PJ_type_get ("MPI_STATE", container->type); const char *color = instr_find_color (operation); val_t value = PJ_value_get_or_new (operation, color, type); - PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); + new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast(extra)); } void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation) @@ -399,7 +399,7 @@ void TRACE_smpi_ptp_out(int rank, int src, int dst, const char *operation) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_STATE", container->type); - PopStateEvent (SIMIX_get_clock(), container, type); + new PopStateEvent (SIMIX_get_clock(), container, type); } void TRACE_smpi_send(int rank, int src, int dst, int tag, int size) @@ -415,7 +415,7 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root()); XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key); - StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size); + new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size); } void TRACE_smpi_recv(int rank, int src, int dst, int tag) @@ -431,5 +431,5 @@ void TRACE_smpi_recv(int rank, int src, int dst, int tag) container_t container = PJ_container_get (str); type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root()); XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key); - EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key); + new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key); } diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index 0b468038dc..ed9411b927 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -120,8 +120,8 @@ static void linkContainers (container_t src, container_t dst, xbt_dict_t filter) snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter); counter++; - StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key); - EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key); + new StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key); + new EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key); XBT_DEBUG (" linkContainers %s <-> %s", src->name, dst->name); } @@ -223,8 +223,8 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link) if (latency == nullptr) { latency = PJ_type_variable_new("latency", nullptr, container->type); } - SetVariableEvent(0, container, bandwidth, bandwidth_value); - SetVariableEvent(0, container, latency, latency_value); + new SetVariableEvent(0, container, bandwidth, bandwidth_value); + new SetVariableEvent(0, container, latency, latency_value); } if (TRACE_uncategorized()) { type_t bandwidth_used = PJ_type_get_or_null("bandwidth_used", container->type); @@ -246,7 +246,7 @@ void sg_instr_new_host(simgrid::s4u::Host& host) } double current_speed_state = host.speed(); - SetVariableEvent (0, container, speed, current_speed_state); + new SetVariableEvent (0, container, speed, current_speed_state); } if (TRACE_uncategorized()){ type_t speed_used = PJ_type_get_or_null ("power_used", container->type); diff --git a/src/surf/instr_surf.cpp b/src/surf/instr_surf.cpp index d1e986c8ca..801036a4c7 100644 --- a/src/surf/instr_surf.cpp +++ b/src/surf/instr_surf.cpp @@ -24,7 +24,7 @@ void TRACE_surf_host_set_speed(double date, const char *resource, double speed) if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) { container_t container = PJ_container_get(resource); type_t type = PJ_type_get ("power", container->type); - SetVariableEvent(date, container, type, speed); + new SetVariableEvent(date, container, type, speed); } } @@ -33,7 +33,7 @@ void TRACE_surf_link_set_bandwidth(double date, const char *resource, double ban if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) { container_t container = PJ_container_get(resource); type_t type = PJ_type_get ("bandwidth", container->type); - SetVariableEvent(date, container, type, bandwidth); + new SetVariableEvent(date, container, type, bandwidth); } }