Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Refactoring instr
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 11 Oct 2017 13:23:03 +0000 (15:23 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 11 Oct 2017 13:23:03 +0000 (15:23 +0200)
PJ_container_get and PJ_container_get_or_null functions become
byName(std::string name) and byNameOrNull(std::string name) methods of
the Container class.

12 files changed:
src/instr/instr_interface.cpp
src/instr/instr_paje_containers.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/plugins/vm/s4u_VirtualMachine.cpp
src/smpi/colls/smpi_automatic_selector.cpp
src/smpi/internals/instr_smpi.cpp
src/surf/instr_routing.cpp
src/surf/instr_surf.cpp

index 61b1891..76fd855 100644 (file)
@@ -277,7 +277,7 @@ static void instr_user_variable(double time, const char* resource, const char* v
     if (created != filter->end()) { // declared, let's work
       char valuestr[100];
       snprintf(valuestr, 100, "%g", value);
-      container_t container = PJ_container_get(resource);
+      container_t container      = simgrid::instr::Container::byName(resource);
       simgrid::instr::Type* type = container->type_->getChild(variable);
       switch (what){
       case INSTR_US_SET:
@@ -940,7 +940,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);
+  container_t container      = simgrid::instr::Container::byName(host);
   simgrid::instr::Type* type = container->type_->getChild(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 */
@@ -960,7 +960,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);
+  container_t container      = simgrid::instr::Container::byName(host);
   simgrid::instr::Type* type = container->type_->getChild(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 */
@@ -979,7 +979,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);
+  container_t container      = simgrid::instr::Container::byName(host);
   simgrid::instr::Type* type = container->type_->getChild(state);
   new simgrid::instr::PopStateEvent(MSG_get_clock(), container, type);
 }
index 9922c8a..fe66156 100644 (file)
@@ -15,8 +15,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_containers, instr, "Paje tracing event system (containers)");
 
 static container_t rootContainer = nullptr;    /* the root container */
-static std::unordered_map<std::string, simgrid::instr::Container*>
-    allContainers;                              /* all created containers indexed by name */
+static std::unordered_map<std::string, container_t> allContainers; /* all created containers indexed by name */
 std::set<std::string> trivaNodeTypes;           /* all host types defined */
 std::set<std::string> trivaEdgeTypes;           /* all link types defined */
 
@@ -151,19 +150,19 @@ simgrid::instr::Container::~Container()
   allContainers.erase(name_);
 }
 
-simgrid::instr::Container* PJ_container_get(const char* name)
+simgrid::instr::Container* simgrid::instr::Container::byNameOrNull(std::string name)
 {
-  container_t ret = PJ_container_get_or_null (name);
-  if (ret == nullptr){
-    THROWF(tracing_error, 1, "container with name %s not found", name);
-  }
-  return ret;
+  auto cont = allContainers.find(name);
+  return cont == allContainers.end() ? nullptr : cont->second;
 }
 
-simgrid::instr::Container* PJ_container_get_or_null(const char* name)
+simgrid::instr::Container* simgrid::instr::Container::byName(std::string name)
 {
-  auto cont = allContainers.find(name);
-  return cont == allContainers.end() ? nullptr : cont->second;
+  container_t ret = simgrid::instr::Container::byNameOrNull(name);
+  if (ret == nullptr)
+    THROWF(tracing_error, 1, "container with name %s not found", name.c_str());
+
+  return ret;
 }
 
 simgrid::instr::Container* PJ_container_get_root()
index 32e36b8..caea5fe 100644 (file)
@@ -127,6 +127,8 @@ public:
   e_container_types kind_; /* This container is of what kind */
   Container* father_;
   std::map<std::string, Container*> children_;
+  static simgrid::instr::Container* byNameOrNull(std::string name);
+  static simgrid::instr::Container* byName(std::string name);
 };
 
 //--------------------------------------------------
@@ -306,8 +308,6 @@ XBT_PUBLIC(void) TRACE_surf_resource_utilization_alloc();
 extern XBT_PRIVATE std::set<std::string> trivaNodeTypes;
 extern XBT_PRIVATE std::set<std::string> trivaEdgeTypes;
 XBT_PRIVATE long long int instr_new_paje_id();
-XBT_PUBLIC(container_t) PJ_container_get(const char* name);
-XBT_PUBLIC(simgrid::instr::Container*) PJ_container_get_or_null(const char* name);
 XBT_PUBLIC(container_t) PJ_container_get_root ();
 XBT_PUBLIC(void) PJ_container_set_root (container_t root);
 XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container);
index ead0ea4..e4d8d9d 100644 (file)
@@ -27,7 +27,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.c_str());
+    container_t container      = simgrid::instr::Container::byName(resource);
     simgrid::instr::Type* type = container->type_->getChild(variable);
     new simgrid::instr::SetVariableEvent(now, container, type, 0);
     platform_variables[key] = std::string("");
@@ -45,7 +45,7 @@ static void instr_event(double now, double delta, simgrid::instr::Type* variable
 void TRACE_surf_link_set_utilization(const char *resource, const char *category, double value, double now, double delta)
 {
   //only trace link utilization if link is known by tracing mechanism
-  if (not PJ_container_get_or_null(resource))
+  if (not simgrid::instr::Container::byNameOrNull(resource))
     return;
   if (not value)
     return;
@@ -53,7 +53,7 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
   //trace uncategorized link utilization
   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);
+    container_t container      = simgrid::instr::Container::byName(resource);
     simgrid::instr::Type* type = container->type_->getChild("bandwidth_used");
     instr_event (now, delta, type, container, value);
   }
@@ -66,7 +66,7 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
     char category_type[INSTR_DEFAULT_STR_SIZE];
     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);
+    container_t container      = simgrid::instr::Container::byName(resource);
     simgrid::instr::Type* type = container->type_->getChild(category_type);
     instr_event (now, delta, type, container, value);
   }
@@ -76,7 +76,7 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
 void TRACE_surf_host_set_utilization(const char *resource, const char *category, double value, double now, double delta)
 {
   //only trace host utilization if host is known by tracing mechanism
-  container_t container = PJ_container_get_or_null(resource);
+  container_t container = simgrid::instr::Container::byNameOrNull(resource);
   if (not container || not value)
     return;
 
index 81526f6..e9cd03d 100644 (file)
@@ -36,7 +36,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     //start link
-    container_t msg = PJ_container_get (instr_process_id(process, str, len));
+    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");
     new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
@@ -47,7 +47,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host)
     TRACE_msg_process_create (MSG_process_get_name (process), MSG_process_get_PID (process), new_host);
 
     //end link
-    msg = PJ_container_get(instr_process_id(process, str, len));
+    msg  = simgrid::instr::Container::byName(instr_process_id(process, str, len));
     type = PJ_type_get_root()->getChild("MSG_PROCESS_LINK");
     new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
   }
@@ -59,7 +59,7 @@ void TRACE_msg_process_create (const char *process_name, int process_pid, msg_ho
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t host_container = PJ_container_get(host->getCname());
+    container_t host_container = simgrid::instr::Container::byName(host->getName());
     new simgrid::instr::Container(instr_process_id_2(process_name, process_pid, str, len),
                                   simgrid::instr::INSTR_MSG_PROCESS, host_container);
   }
@@ -71,7 +71,8 @@ void TRACE_msg_process_destroy (const char *process_name, int process_pid)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process = PJ_container_get_or_null(instr_process_id_2(process_name, process_pid, str, len));
+    container_t process =
+        simgrid::instr::Container::byNameOrNull(instr_process_id_2(process_name, process_pid, str, len));
     if (process) {
       PJ_container_remove_from_parent (process);
       delete process;
@@ -93,7 +94,7 @@ void TRACE_msg_process_suspend(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
+    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::Value* val    = simgrid::instr::Value::byName("suspend", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
@@ -106,7 +107,7 @@ void TRACE_msg_process_resume(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
+    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");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
@@ -118,7 +119,7 @@ void TRACE_msg_process_sleep_in(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
+    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::Value* val    = simgrid::instr::Value::byName("sleep", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
@@ -131,7 +132,7 @@ void TRACE_msg_process_sleep_out(msg_process_t process)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(process, str, len));
+    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");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
index 369aa77..5702ed8 100644 (file)
@@ -52,7 +52,7 @@ void TRACE_msg_task_execute_start(msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
+    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::Value* val    = simgrid::instr::Value::byName("task_execute", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
@@ -67,7 +67,7 @@ void TRACE_msg_task_execute_end(msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
+    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");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
@@ -92,7 +92,7 @@ void TRACE_msg_task_get_start()
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
+    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::Value* val    = simgrid::instr::Value::byName("receive", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
@@ -107,7 +107,7 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
+    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");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
 
@@ -127,7 +127,7 @@ int TRACE_msg_task_put_start(msg_task_t task)
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
+    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::Value* val    = simgrid::instr::Value::byName("send", type);
     new simgrid::instr::PushStateEvent(MSG_get_clock(), process_container, type, val);
@@ -149,7 +149,7 @@ void TRACE_msg_task_put_end()
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
+    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");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), process_container, type);
   }
index c6449bb..cf9f09f 100644 (file)
@@ -170,7 +170,7 @@ void MSG_vm_destroy(msg_vm_t vm)
   simgrid::simix::kernelImmediate([vm]() { vm->destroy(); });
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t container = PJ_container_get(vm->getCname());
+    container_t container = simgrid::instr::Container::byName(vm->getName());
     PJ_container_remove_from_parent(container);
     delete container;
   }
@@ -185,7 +185,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());
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
     simgrid::instr::Type* type = vm_container->type_->getChild("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);
@@ -294,21 +294,21 @@ static int migration_rx_fun(int argc, char *argv[])
     counter++;
 
     // start link
-    container_t msg = PJ_container_get(vm->getCname());
+    container_t msg            = simgrid::instr::Container::byName(vm->getName());
     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
-    container_t existing_container = PJ_container_get(vm->getCname());
+    container_t existing_container = simgrid::instr::Container::byName(vm->getName());
     PJ_container_remove_from_parent(existing_container);
     delete existing_container;
 
     // create new container on the new_host location
     new simgrid::instr::Container(vm->getCname(), simgrid::instr::INSTR_MSG_VM,
-                                  PJ_container_get(ms->dst_pm->getCname()));
+                                  simgrid::instr::Container::byName(ms->dst_pm->getName()));
 
     // end link
-    msg  = PJ_container_get(vm->getCname());
+    msg  = simgrid::instr::Container::byName(vm->getName());
     type = PJ_type_get_root()->getChild("MSG_VM_LINK");
     new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
   }
@@ -768,7 +768,7 @@ void MSG_vm_suspend(msg_vm_t vm)
   XBT_DEBUG("vm_suspend done");
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
     simgrid::instr::Type* type = vm_container->type_->getChild("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);
@@ -785,7 +785,7 @@ void MSG_vm_resume(msg_vm_t vm)
   vm->pimpl_vm_->resume();
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t vm_container = PJ_container_get(vm->getCname());
+    container_t vm_container   = simgrid::instr::Container::byName(vm->getName());
     simgrid::instr::Type* type = vm_container->type_->getChild("MSG_VM_STATE");
     new simgrid::instr::PopStateEvent(MSG_get_clock(), vm_container, type);
   }
index d6369ee..8e74223 100644 (file)
@@ -32,7 +32,7 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm, int coreAmount)
   extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
 
   if (TRACE_msg_vm_is_enabled()) {
-    container_t host_container = PJ_container_get(pm->getCname());
+    container_t host_container = simgrid::instr::Container::byName(pm->getName());
     new simgrid::instr::Container(name, simgrid::instr::INSTR_MSG_VM, host_container);
   }
 }
index ec28e51..c86f315 100644 (file)
@@ -24,7 +24,7 @@
     snprintf(cont_name, 25, "rank-%d", smpi_process()->index());                                                       \
     simgrid::instr::Value* val =                                                                                       \
         simgrid::instr::Value::byNameOrCreate(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type);       \
-    new simgrid::instr::NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val);                           \
+    new simgrid::instr::NewEvent(SIMIX_get_clock(), simgrid::instr::Container::byName(cont_name), type, val);          \
   }
 
 #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)                                                                    \
index a83443b..5807ffc 100644 (file)
@@ -189,7 +189,7 @@ void TRACE_smpi_init(int rank)
 
   container_t father;
   if (TRACE_smpi_is_grouped()){
-    father = PJ_container_get(sg_host_self_get_name());
+    father = simgrid::instr::Container::byName(sg_host_self_get_name());
   }else{
     father = PJ_container_get_root ();
   }
@@ -220,7 +220,7 @@ void TRACE_smpi_finalize(int rank)
     return;
 
   char str[INSTR_DEFAULT_STR_SIZE];
-  container_t container = PJ_container_get(smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE));
+  container_t container = simgrid::instr::Container::byName(smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE));
   PJ_container_remove_from_parent (container);
   delete container;
 }
@@ -234,7 +234,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
   const char *color = instr_find_color (operation);
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(operation, color, type);
@@ -248,7 +248,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
 
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
@@ -262,7 +262,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);
+ container_t container      = simgrid::instr::Container::byName(str);
  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,
@@ -279,7 +279,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("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));
@@ -291,7 +291,7 @@ void TRACE_smpi_computing_out(int rank)
     return;
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
@@ -304,7 +304,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
   const char *color = instr_find_color ("sleeping");
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate("sleeping", color, type);
@@ -321,7 +321,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("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));
@@ -333,7 +333,7 @@ void TRACE_smpi_sleeping_out(int rank)
     return;
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
@@ -348,7 +348,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("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));
@@ -360,7 +360,7 @@ void TRACE_smpi_testing_out(int rank)
     return;
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
-  container_t container = PJ_container_get (str);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
 }
@@ -374,7 +374,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
   const char *color = instr_find_color (operation);
   simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(operation, color, type);
@@ -388,7 +388,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   simgrid::instr::Type* type = container->type_->getChild("MPI_STATE");
 
   new simgrid::instr::PopStateEvent(SIMIX_get_clock(), container, type);
@@ -404,7 +404,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   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);
@@ -420,7 +420,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);
+  container_t container      = simgrid::instr::Container::byName(str);
   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 1bfe237..ecbacce 100644 (file)
@@ -145,9 +145,8 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t
 
   static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
   xbt_dict_foreach(edges,cursor,edge_name,edge) {
-    linkContainers(
-          PJ_container_get(static_cast<const char*>(edge->src->data)),
-          PJ_container_get(static_cast<const char*>(edge->dst->data)), filter);
+    linkContainers(simgrid::instr::Container::byName(static_cast<const char*>(edge->src->data)),
+                   simgrid::instr::Container::byName(static_cast<const char*>(edge->dst->data)), filter);
   }
   xbt_dict_free (&nodes);
   xbt_dict_free (&edges);
index 43c84ed..ea05489 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
 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);
+    container_t container      = simgrid::instr::Container::byName(resource);
     simgrid::instr::Type* type = container->type_->getChild("power");
     new simgrid::instr::SetVariableEvent(date, container, type, speed);
   }
@@ -21,7 +21,7 @@ void TRACE_surf_host_set_speed(double date, const char *resource, double speed)
 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth)
 {
   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
-    container_t container = PJ_container_get(resource);
+    container_t container      = simgrid::instr::Container::byName(resource);
     simgrid::instr::Type* type = container->type_->getChild("bandwidth");
     new simgrid::instr::SetVariableEvent(date, container, type, bandwidth);
   }