Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
instr: objectifies another method
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Sep 2017 20:15:32 +0000 (22:15 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 16 Sep 2017 20:15:32 +0000 (22:15 +0200)
src/instr/instr_interface.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_private.h
src/instr/instr_resource_utilization.cpp
src/msg/instr_msg_process.cpp
src/msg/instr_msg_task.cpp
src/msg/msg_vm.cpp
src/smpi/internals/instr_smpi.cpp
src/surf/instr_surf.cpp

index f057311..121b6f9 100644 (file)
@@ -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);
 }
 
index b9e47a1..2e765a0 100644 (file)
@@ -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;
 }
 
index 1e0109b..a9e58f6 100644 (file)
@@ -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();
index bca73a0..6b7bfec 100644 (file)
@@ -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);
   }
 }
index af391fb..a3a69f9 100644 (file)
@@ -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);
   }
 }
index 8b35b94..49f94db 100644 (file)
@@ -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);
   }
 }
index be46bab..c385ac7 100644 (file)
@@ -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);
   }
 }
index 288a8e3..69ffcb2 100644 (file)
@@ -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<void*>(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<void*>(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<void*>(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<void*>(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<void*>(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);
 }
index d82ef1b..83f7e1e 100644 (file)
@@ -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);
   }
 }