From: Martin Quinson Date: Sat, 16 Sep 2017 20:15:32 +0000 (+0200) Subject: instr: objectifies another method X-Git-Tag: v3_17~107 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d012fa8a46e5c5768de197190c5f227d82c7d452 instr: objectifies another method --- diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index f057311e48..121b6f912b 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -183,7 +183,7 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar if (not mark_value) THROWF (tracing_error, 1, "mark_value is nullptr"); - simgrid::instr::Type* type = PJ_type_get(mark_type, PJ_type_get_root()); + simgrid::instr::Type* type = PJ_type_get_root()->getChild(mark_type); if (not type) { THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type); } @@ -239,7 +239,7 @@ void TRACE_mark(const char *mark_type, const char *mark_value) THROWF (tracing_error, 1, "mark_value is nullptr"); //check if mark_type is already declared - simgrid::instr::Type* type = PJ_type_get(mark_type, PJ_type_get_root()); + simgrid::instr::Type* type = PJ_type_get_root()->getChild(mark_type); if (not type) { THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type); } @@ -283,7 +283,7 @@ static void instr_user_variable(double time, const char* resource, const char* v char valuestr[100]; snprintf(valuestr, 100, "%g", value); container_t container = PJ_container_get(resource); - simgrid::instr::Type* type = PJ_type_get(variable, container->type_); + simgrid::instr::Type* type = container->type_->getChild(variable); switch (what){ case INSTR_US_SET: new simgrid::instr::SetVariableEvent(time, container, type, value); @@ -946,7 +946,7 @@ void TRACE_host_state_declare_value (const char *state, const char *value, const void TRACE_host_set_state(const char* host, const char* state, const char* value_str) { container_t container = PJ_container_get(host); - simgrid::instr::Type* type = PJ_type_get(state, container->type_); + simgrid::instr::Type* type = container->type_->getChild(state); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new( value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ new simgrid::instr::SetStateEvent(MSG_get_clock(), container, type, val); @@ -966,7 +966,7 @@ void TRACE_host_set_state(const char* host, const char* state, const char* value void TRACE_host_push_state(const char* host, const char* state, const char* value_str) { container_t container = PJ_container_get(host); - simgrid::instr::Type* type = PJ_type_get(state, container->type_); + simgrid::instr::Type* type = container->type_->getChild(state); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new( value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */ new simgrid::instr::PushStateEvent(MSG_get_clock(), container, type, val); @@ -985,7 +985,7 @@ void TRACE_host_push_state(const char* host, const char* state, const char* valu void TRACE_host_pop_state (const char *host, const char *state) { container_t container = PJ_container_get(host); - simgrid::instr::Type* type = PJ_type_get(state, container->type_); + simgrid::instr::Type* type = container->type_->getChild(state); new simgrid::instr::PopStateEvent(MSG_get_clock(), container, type); } diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index b9e47a1898..2e765a0c79 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -62,11 +62,11 @@ simgrid::instr::Type::~Type() xbt_free(color_); } -simgrid::instr::Type* PJ_type_get(const char* name, simgrid::instr::Type* father) +simgrid::instr::Type* simgrid::instr::Type::getChild(const char* name) { - simgrid::instr::Type* ret = father->getChildOrNull(name); + simgrid::instr::Type* ret = this->getChildOrNull(name); if (ret == nullptr) - THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name, father->name_); + THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name, this->name_); return ret; } diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 1e0109ba98..a9e58f6953 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -70,7 +70,9 @@ public: xbt_dict_t values_; // valid for all types except variable and container Type(const char* typeNameBuff, const char* key, const char* color, e_entity_types kind, Type* father); ~Type(); + Type* getChild(const char* name); Type* getChildOrNull(const char* name); + static Type* containerNew(const char* name, Type* father); static Type* eventNew(const char* name, Type* father); static Type* variableNew(const char* name, const char* color, Type* father); @@ -336,7 +338,6 @@ XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container); /* instr_paje_types.c */ XBT_PRIVATE void PJ_type_release (); XBT_PUBLIC(simgrid::instr::Type*) PJ_type_get_root(); -XBT_PUBLIC(simgrid::instr::Type*) PJ_type_get(const char* name, simgrid::instr::Type* father); /* instr_config.c */ XBT_PRIVATE void TRACE_TI_start(); diff --git a/src/instr/instr_resource_utilization.cpp b/src/instr/instr_resource_utilization.cpp index bca73a0973..6b7bfec6fe 100644 --- a/src/instr/instr_resource_utilization.cpp +++ b/src/instr/instr_resource_utilization.cpp @@ -28,7 +28,7 @@ static void __TRACE_surf_check_variable_set_to_zero(double now, const char *vari // check if key exists: if it doesn't, set the variable to zero and mark this in the dict if (platform_variables.find(key) == platform_variables.end()) { container_t container = PJ_container_get (resource); - simgrid::instr::Type* type = PJ_type_get(variable, container->type_); + simgrid::instr::Type* type = container->type_->getChild(variable); new simgrid::instr::SetVariableEvent(now, container, type, 0); platform_variables[key] = std::string(""); } @@ -54,7 +54,7 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category, if (TRACE_uncategorized()){ XBT_DEBUG("UNCAT LINK [%f - %f] %s bandwidth_used %f", now, now+delta, resource, value); container_t container = PJ_container_get (resource); - simgrid::instr::Type* type = PJ_type_get("bandwidth_used", container->type_); + simgrid::instr::Type* type = container->type_->getChild("bandwidth_used"); instr_event (now, delta, type, container, value); } @@ -67,7 +67,7 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category, snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "b%s", category); XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, category_type, value); container_t container = PJ_container_get (resource); - simgrid::instr::Type* type = PJ_type_get(category_type, container->type_); + simgrid::instr::Type* type = container->type_->getChild(category_type); instr_event (now, delta, type, container, value); } } @@ -83,7 +83,7 @@ void TRACE_surf_host_set_utilization(const char *resource, const char *category, //trace uncategorized host utilization if (TRACE_uncategorized()){ XBT_DEBUG("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, resource, value); - simgrid::instr::Type* type = PJ_type_get("power_used", container->type_); + simgrid::instr::Type* type = container->type_->getChild("power_used"); instr_event (now, delta, type, container, value); } @@ -95,7 +95,7 @@ void TRACE_surf_host_set_utilization(const char *resource, const char *category, char category_type[INSTR_DEFAULT_STR_SIZE]; snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "p%s", category); XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, category_type, value); - simgrid::instr::Type* type = PJ_type_get(category_type, container->type_); + simgrid::instr::Type* type = container->type_->getChild(category_type); instr_event (now, delta, type, container, value); } } diff --git a/src/msg/instr_msg_process.cpp b/src/msg/instr_msg_process.cpp index af391fb2d6..a3a69f9d24 100644 --- a/src/msg/instr_msg_process.cpp +++ b/src/msg/instr_msg_process.cpp @@ -37,7 +37,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host) //start link container_t msg = PJ_container_get (instr_process_id(process, str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_LINK", PJ_type_get_root()); + simgrid::instr::Type* type = PJ_type_get_root()->getChild("MSG_PROCESS_LINK"); new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); //destroy existing container of this process @@ -48,7 +48,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host) //end link msg = PJ_container_get(instr_process_id(process, str, len)); - type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root()); + type = PJ_type_get_root()->getChild("MSG_PROCESS_LINK"); new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); } } @@ -94,7 +94,7 @@ void TRACE_msg_process_suspend(msg_process_t process) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(process, str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get("suspend", type); new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val); } @@ -107,7 +107,7 @@ void TRACE_msg_process_resume(msg_process_t process) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(process, str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type); } } @@ -119,7 +119,7 @@ void TRACE_msg_process_sleep_in(msg_process_t process) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(process, str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get("sleep", type); new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val); } @@ -132,7 +132,7 @@ void TRACE_msg_process_sleep_out(msg_process_t process) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(process, str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type); } } diff --git a/src/msg/instr_msg_task.cpp b/src/msg/instr_msg_task.cpp index 8b35b94e3d..49f94db619 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) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get("task_execute", type); new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val); } @@ -68,7 +68,7 @@ void TRACE_msg_task_execute_end(msg_task_t task) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type); } } @@ -93,7 +93,7 @@ void TRACE_msg_task_get_start() char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get("receive", type); new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val); } @@ -108,12 +108,12 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); new simgrid::instr::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()); + type = PJ_type_get_root()->getChild("MSG_PROCESS_TASK_LINK"); new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key); } } @@ -128,13 +128,13 @@ int TRACE_msg_task_put_start(msg_task_t task) char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get("send", type); new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val); 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()); + type = PJ_type_get_root()->getChild("MSG_PROCESS_TASK_LINK"); new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key); } @@ -150,7 +150,7 @@ void TRACE_msg_task_put_end() char str[INSTR_DEFAULT_STR_SIZE]; container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); - simgrid::instr::Type* type = PJ_type_get("MSG_PROCESS_STATE", process_container->type_); + simgrid::instr::Type* type = process_container->type_->getChild("MSG_PROCESS_STATE"); new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type); } } diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index be46babecb..c385ac7087 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -187,7 +187,7 @@ void MSG_vm_start(msg_vm_t vm) vm->start(); if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); - simgrid::instr::Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type_); + simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("start", "0 0 1", type); // start is blue new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val); } @@ -296,7 +296,7 @@ static int migration_rx_fun(int argc, char *argv[]) // start link container_t msg = PJ_container_get(vm->getCname()); - simgrid::instr::Type* type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root()); + simgrid::instr::Type* type = PJ_type_get_root()->getChild("MSG_VM_LINK"); new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); // destroy existing container of this vm @@ -310,7 +310,7 @@ static int migration_rx_fun(int argc, char *argv[]) // end link msg = PJ_container_get(vm->getCname()); - type = PJ_type_get("MSG_VM_LINK", PJ_type_get_root()); + type = PJ_type_get_root()->getChild("MSG_VM_LINK"); new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key); } @@ -775,7 +775,7 @@ void MSG_vm_suspend(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); - simgrid::instr::Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type_); + simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("suspend", "1 0 0", type); // suspend is red new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val); } @@ -792,7 +792,7 @@ void MSG_vm_resume(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); - simgrid::instr::Type* type = PJ_type_get("MSG_VM_STATE", vm_container->type_); + simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE"); new simgrid::instr::PopStateEvent(MSG_get_clock(), vm_container, type); } } diff --git a/src/smpi/internals/instr_smpi.cpp b/src/smpi/internals/instr_smpi.cpp index 288a8e3267..69ffcb27b3 100644 --- a/src/smpi/internals/instr_smpi.cpp +++ b/src/smpi/internals/instr_smpi.cpp @@ -236,7 +236,7 @@ void TRACE_smpi_collective_in(int rank, const char *operation, instr_extra_data char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); const char *color = instr_find_color (operation); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(operation, color, type); new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); @@ -250,7 +250,7 @@ void TRACE_smpi_collective_out(int rank, const char *operation) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type); } @@ -264,7 +264,7 @@ void TRACE_smpi_computing_init(int rank) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get(str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); const char* color = instr_find_color("computing"); new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, simgrid::instr::Value::get_or_new("computing", color, type)); @@ -281,7 +281,7 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("computing", nullptr, type); new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } @@ -293,7 +293,7 @@ void TRACE_smpi_computing_out(int rank) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type); } @@ -306,7 +306,7 @@ void TRACE_smpi_sleeping_init(int rank) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); const char *color = instr_find_color ("sleeping"); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("sleeping", color, type); new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val); @@ -323,7 +323,7 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("sleeping", nullptr, type); new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } @@ -335,7 +335,7 @@ void TRACE_smpi_sleeping_out(int rank) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type); } @@ -350,7 +350,7 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new("test", nullptr, type); new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } @@ -362,7 +362,7 @@ void TRACE_smpi_testing_out(int rank) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type); } @@ -376,7 +376,7 @@ void TRACE_smpi_ptp_in(int rank, const char *operation, instr_extra_data extra) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); const char *color = instr_find_color (operation); simgrid::instr::Value* val = simgrid::instr::Value::get_or_new(operation, color, type); new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); @@ -390,7 +390,7 @@ void TRACE_smpi_ptp_out(int rank, int dst, const char *operation) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_STATE", container->type_); + simgrid::instr::Type* type = container->type_->getChild("MPI_STATE"); new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type); } @@ -406,7 +406,7 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(src, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_LINK", PJ_type_get_root()); + simgrid::instr::Type* type = PJ_type_get_root()->getChild("MPI_LINK"); XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key); new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size); } @@ -422,7 +422,7 @@ void TRACE_smpi_recv(int src, int dst, int tag) char str[INSTR_DEFAULT_STR_SIZE]; smpi_container(dst, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); - simgrid::instr::Type* type = PJ_type_get("MPI_LINK", PJ_type_get_root()); + simgrid::instr::Type* type = PJ_type_get_root()->getChild("MPI_LINK"); XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key); new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key); } diff --git a/src/surf/instr_surf.cpp b/src/surf/instr_surf.cpp index d82ef1b992..83f7e1e227 100644 --- a/src/surf/instr_surf.cpp +++ b/src/surf/instr_surf.cpp @@ -13,7 +13,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); - simgrid::instr::Type* type = PJ_type_get("power", container->type_); + simgrid::instr::Type* type = container->type_->getChild("power"); new simgrid::instr::SetVariableEvent(date, container, type, speed); } } @@ -22,7 +22,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); - simgrid::instr::Type* type = PJ_type_get("bandwidth", container->type_); + simgrid::instr::Type* type = container->type_->getChild("bandwidth"); new simgrid::instr::SetVariableEvent(date, container, type, bandwidth); } }