Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
refactoring and namespacing
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 12 Oct 2017 15:29:10 +0000 (17:29 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 12 Oct 2017 15:29:10 +0000 (17:29 +0200)
include/simgrid/s4u/NetZone.hpp
src/instr/instr_interface.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_private.hpp
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_routing.cpp
src/surf/instr_surf.cpp

index 0f50b37..cdfbf84 100644 (file)
@@ -45,6 +45,7 @@ public:
   /** @brief Seal your netzone once you're done adding content, and before routing stuff through it */
   virtual void seal();
   const char* getCname();
+  std::string getName() { return name_; }
   NetZone* getFather();
 
   std::vector<NetZone*>* getChildren();             // Sub netzones
index 76fd855..fa1917b 100644 (file)
@@ -178,7 +178,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_root()->getChild(mark_type);
+  simgrid::instr::Type* type = PJ_type_get_root()->byName(mark_type);
   if (not type) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   }
@@ -234,7 +234,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_root()->getChild(mark_type);
+  simgrid::instr::Type* type = PJ_type_get_root()->byName(mark_type);
   if (not type) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   }
@@ -278,7 +278,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      = simgrid::instr::Container::byName(resource);
-      simgrid::instr::Type* type = container->type_->getChild(variable);
+      simgrid::instr::Type* type = container->type_->byName(variable);
       switch (what){
       case INSTR_US_SET:
         new simgrid::instr::SetVariableEvent(time, container, type, value);
@@ -941,7 +941,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      = simgrid::instr::Container::byName(host);
-  simgrid::instr::Type* type = container->type_->getChild(state);
+  simgrid::instr::Type* type = container->type_->byName(state);
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(
       value_str, "", type); /* if user didn't declare a value with a color, use no color */
   new simgrid::instr::SetStateEvent(MSG_get_clock(), container, type, val);
@@ -961,7 +961,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      = simgrid::instr::Container::byName(host);
-  simgrid::instr::Type* type = container->type_->getChild(state);
+  simgrid::instr::Type* type = container->type_->byName(state);
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(
       value_str, "", type); /* if user didn't declare a value with a color, use no color */
   new simgrid::instr::PushStateEvent(MSG_get_clock(), container, type, val);
@@ -980,7 +980,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      = simgrid::instr::Container::byName(host);
-  simgrid::instr::Type* type = container->type_->getChild(state);
+  simgrid::instr::Type* type = container->type_->byName(state);
   new simgrid::instr::PopStateEvent(MSG_get_clock(), container, type);
 }
 
index 711a8a6..d5d3e14 100644 (file)
@@ -15,14 +15,17 @@ simgrid::instr::Type* PJ_type_get_root()
   return rootType;
 }
 
-simgrid::instr::Type::Type(std::string name, const char* key, std::string color, e_entity_types kind, Type* father)
+namespace simgrid {
+namespace instr {
+
+Type::Type(std::string name, const char* key, std::string color, e_entity_types kind, Type* father)
     : name_(name), color_(color), kind_(kind), father_(father)
 {
   if (name.empty() || key == nullptr) {
     THROWF(tracing_error, 0, "can't create a new type with name or key equal nullptr");
   }
 
-  this->id_ = std::to_string(instr_new_paje_id());
+  id_ = std::to_string(instr_new_paje_id());
 
   if (father != nullptr){
     father->children_.insert({key, this});
@@ -30,7 +33,7 @@ simgrid::instr::Type::Type(std::string name, const char* key, std::string color,
   }
 }
 
-simgrid::instr::Type::~Type()
+Type::~Type()
 {
   for (auto elm : values_) {
     XBT_DEBUG("free value %s, child of %s", elm.second->getCname(), elm.second->father_->getCname());
@@ -41,19 +44,19 @@ simgrid::instr::Type::~Type()
   }
 }
 
-simgrid::instr::Type* simgrid::instr::Type::getChild(std::string name)
+Type* Type::byName(std::string name)
 {
-  simgrid::instr::Type* ret = this->getChildOrNull(name);
+  Type* ret = this->getChildOrNull(name);
   if (ret == nullptr)
     THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name.c_str(), getCname());
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::getChildOrNull(std::string name)
+Type* Type::getChildOrNull(std::string name)
 {
   xbt_assert(not name.empty(), "can't get type with a nullptr name");
 
-  simgrid::instr::Type* ret = nullptr;
+  Type* ret = nullptr;
   for (auto elm : children_) {
     if (elm.second->name_ == name) {
       if (ret != nullptr) {
@@ -66,7 +69,7 @@ simgrid::instr::Type* simgrid::instr::Type::getChildOrNull(std::string name)
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::containerNew(const char* name, simgrid::instr::Type* father)
+Type* simgrid::instr::Type::containerNew(const char* name, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a container type with a nullptr name");
@@ -83,7 +86,7 @@ simgrid::instr::Type* simgrid::instr::Type::containerNew(const char* name, simgr
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::eventNew(const char* name, simgrid::instr::Type* father)
+Type* Type::eventNew(const char* name, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create an event type with a nullptr name");
@@ -95,8 +98,7 @@ simgrid::instr::Type* simgrid::instr::Type::eventNew(const char* name, simgrid::
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::variableNew(const char* name, std::string color,
-                                                        simgrid::instr::Type* father)
+Type* Type::variableNew(const char* name, std::string color, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a variable type with a nullptr name");
@@ -115,7 +117,7 @@ simgrid::instr::Type* simgrid::instr::Type::variableNew(const char* name, std::s
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::linkNew(const char* name, Type* father, Type* source, Type* dest)
+Type* Type::linkNew(const char* name, Type* father, Type* source, Type* dest)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a link type with a nullptr name");
@@ -130,7 +132,7 @@ simgrid::instr::Type* simgrid::instr::Type::linkNew(const char* name, Type* fath
   return ret;
 }
 
-simgrid::instr::Type* simgrid::instr::Type::stateNew(const char* name, Type* father)
+Type* Type::stateNew(const char* name, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a state type with a nullptr name");
@@ -141,3 +143,5 @@ simgrid::instr::Type* simgrid::instr::Type::stateNew(const char* name, Type* fat
   LogStateTypeDefinition(ret);
   return ret;
 }
+}
+}
index 0f63eaa..dffb962 100644 (file)
@@ -67,7 +67,7 @@ public:
   std::map<std::string, Value*> values_; // valid for all types except variable and container
   Type(std::string name, const char* key, std::string color, e_entity_types kind, Type* father);
   ~Type();
-  Type* getChild(std::string name);
+  Type* byName(std::string name);
   Type* getChildOrNull(std::string name);
 
   static Type* containerNew(const char* name, Type* father);
index c8b0252..86d76d8 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      = simgrid::instr::Container::byName(resource);
-    simgrid::instr::Type* type = container->type_->getChild(variable);
+    simgrid::instr::Type* type = container->type_->byName(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      = simgrid::instr::Container::byName(resource);
-    simgrid::instr::Type* type = container->type_->getChild("bandwidth_used");
+    simgrid::instr::Type* type = container->type_->byName("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      = simgrid::instr::Container::byName(resource);
-    simgrid::instr::Type* type = container->type_->getChild(category_type);
+    simgrid::instr::Type* type = container->type_->byName(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 = container->type_->getChild("power_used");
+    simgrid::instr::Type* type = container->type_->byName("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 = container->type_->getChild(category_type);
+    simgrid::instr::Type* type = container->type_->byName(category_type);
     instr_event (now, delta, type, container, value);
   }
 }
index e7e4604..16fd3ca 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            = simgrid::instr::Container::byName(instr_process_id(process, str, len));
-    simgrid::instr::Type* type = PJ_type_get_root()->getChild("MSG_PROCESS_LINK");
+    simgrid::instr::Type* type = PJ_type_get_root()->byName("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  = simgrid::instr::Container::byName(instr_process_id(process, str, len));
-    type = PJ_type_get_root()->getChild("MSG_PROCESS_LINK");
+    type = PJ_type_get_root()->byName("MSG_PROCESS_LINK");
     new simgrid::instr::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)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     simgrid::instr::Value* val    = simgrid::instr::Value::byName("suspend", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
@@ -108,7 +108,7 @@ void TRACE_msg_process_resume(msg_process_t process)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
 }
@@ -120,7 +120,7 @@ void TRACE_msg_process_sleep_in(msg_process_t process)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     simgrid::instr::Value* val    = simgrid::instr::Value::byName("sleep", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
@@ -133,7 +133,7 @@ void TRACE_msg_process_sleep_out(msg_process_t process)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     container_t process_container = simgrid::instr::Container::byName(instr_process_id(process, str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
 }
index 5702ed8..1237b18 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 = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     simgrid::instr::Value* val    = simgrid::instr::Value::byName("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 = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("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 = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     simgrid::instr::Value* val    = simgrid::instr::Value::byName("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 = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("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_root()->getChild("MSG_PROCESS_TASK_LINK");
+    type = PJ_type_get_root()->byName("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 = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     simgrid::instr::Value* val    = simgrid::instr::Value::byName("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_root()->getChild("MSG_PROCESS_TASK_LINK");
+    type = PJ_type_get_root()->byName("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 = simgrid::instr::Container::byName(instr_process_id(MSG_process_self(), str, len));
-    simgrid::instr::Type* type    = process_container->type_->getChild("MSG_PROCESS_STATE");
+    simgrid::instr::Type* type    = process_container->type_->byName("MSG_PROCESS_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
 }
index efc25d9..deb8f4a 100644 (file)
@@ -186,7 +186,7 @@ void MSG_vm_start(msg_vm_t vm)
   vm->start();
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
     simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("start", "0 0 1", type); // start is blue
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
@@ -295,7 +295,7 @@ static int migration_rx_fun(int argc, char *argv[])
 
     // start link
     container_t msg            = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* type = PJ_type_get_root()->getChild("MSG_VM_LINK");
+    simgrid::instr::Type* type = PJ_type_get_root()->byName("MSG_VM_LINK");
     new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
     // destroy existing container of this vm
@@ -309,7 +309,7 @@ static int migration_rx_fun(int argc, char *argv[])
 
     // end link
     msg  = simgrid::instr::Container::byName(vm->getName());
-    type = PJ_type_get_root()->getChild("MSG_VM_LINK");
+    type = PJ_type_get_root()->byName("MSG_VM_LINK");
     new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
   }
 
@@ -769,7 +769,7 @@ void MSG_vm_suspend(msg_vm_t vm)
 
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
     simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("suspend", "1 0 0", type); // suspend is red
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
@@ -786,7 +786,7 @@ void MSG_vm_resume(msg_vm_t vm)
 
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
+    simgrid::instr::Type* type = vm_container->type_->byName("MSG_VM_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), vm_container, type);
   }
 }
index 28ef28b..4e55c8c 100644 (file)
@@ -235,7 +235,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   const char *color = instr_find_color (operation);
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(operation, color, type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
@@ -249,7 +249,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
 
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
@@ -263,7 +263,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      = simgrid::instr::Container::byName(str);
- simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+ simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
  const char* color     = instr_find_color("computing");
  new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type,
                                     simgrid::instr::Value::byNameOrCreate("computing", color, type));
@@ -280,7 +280,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("computing", "", type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
@@ -292,7 +292,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
 
@@ -305,7 +305,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   const char *color = instr_find_color ("sleeping");
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("sleeping", color, type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val);
@@ -322,7 +322,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("sleeping", "", type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
@@ -334,7 +334,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
 
@@ -349,7 +349,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("test", "", type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
@@ -361,7 +361,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
 
@@ -375,7 +375,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
   const char *color = instr_find_color (operation);
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(operation, color, type);
   new simgrid::instr::PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
@@ -389,7 +389,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
+  simgrid::instr::Type* type = container->type_->byName("MPI_STATE");
 
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
@@ -405,7 +405,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = PJ_type_get_root()->getChild("MPI_LINK");
+  simgrid::instr::Type* type = PJ_type_get_root()->byName("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);
 }
@@ -421,7 +421,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      = simgrid::instr::Container::byName(str);
-  simgrid::instr::Type* type = PJ_type_get_root()->getChild("MPI_LINK");
+  simgrid::instr::Type* type = PJ_type_get_root()->byName("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 4766523..7451da2 100644 (file)
@@ -158,7 +158,7 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t
  */
 static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
 {
-  const char* id = netzone.getCname();
+  std::string id = netzone.getName();
 
   if (PJ_container_get_root() == nullptr){
     container_t root = new simgrid::instr::Container(id, simgrid::instr::INSTR_AS, nullptr);
@@ -306,8 +306,7 @@ static void instr_routing_parse_end_platform ()
 
 void instr_routing_define_callbacks ()
 {
-  //always need the call backs to ASes (we need only the root AS),
-  //to create the rootContainer and the rootType properly
+  // always need the callbacks to ASes (we need only the root AS), to create the rootContainer and the rootType properly
   if (not TRACE_is_enabled())
     return;
   if (TRACE_needs_platform()) {
index ea05489..8c6e0b1 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      = simgrid::instr::Container::byName(resource);
-    simgrid::instr::Type* type = container->type_->getChild("power");
+    simgrid::instr::Type* type = container->type_->byName("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      = simgrid::instr::Container::byName(resource);
-    simgrid::instr::Type* type = container->type_->getChild("bandwidth");
+    simgrid::instr::Type* type = container->type_->byName("bandwidth");
     new simgrid::instr::SetVariableEvent(date, container, type, bandwidth);
   }
 }