Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename last PJ_ functions
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 20 Oct 2017 13:28:40 +0000 (15:28 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 20 Oct 2017 13:28:40 +0000 (15:28 +0200)
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/instr/instr_paje_containers.cpp
src/instr/instr_private.hpp
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

index 546c055..0ab998e 100644 (file)
@@ -142,7 +142,7 @@ int TRACE_end()
     TRACE_paje_dump_buffer(true);
 
     /* destroy all data structures of tracing (and free) */
-    delete PJ_container_get_root();
+    delete simgrid::instr::Container::getRootContainer();
     delete simgrid::instr::Type::getRootType();
     rootType = nullptr;
 
index b1979f3..3cea149 100644 (file)
@@ -238,7 +238,8 @@ void TRACE_mark(const char *mark_type, const char *mark_value)
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   } else {
     XBT_DEBUG("MARK %s %s", mark_type, mark_value);
-    new simgrid::instr::NewEvent(MSG_get_clock(), PJ_container_get_root(), type, type->getEntityValue(mark_value));
+    new simgrid::instr::NewEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
+                                 type->getEntityValue(mark_value));
   }
 }
 
index 1c8e4b4..efb6238 100644 (file)
@@ -26,19 +26,15 @@ long long int instr_new_paje_id ()
   return type_id++;
 }
 
-container_t PJ_container_get_root()
-{
-  return rootContainer;
-}
-
-void PJ_container_set_root (container_t root)
-{
-  rootContainer = root;
-}
 
 namespace simgrid {
 namespace instr {
 
+container_t Container::getRootContainer()
+{
+  return rootContainer;
+}
+
 NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZoneContainer* father)
     : Container::Container(name, "", father)
 {
@@ -50,7 +46,7 @@ NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZone
     logCreation();
   } else {
     type_ = Type::createRootType();
-    PJ_container_set_root(this);
+    rootContainer = this;
   }
 }
 
@@ -116,7 +112,7 @@ Container::~Container()
   TRACE_paje_dump_buffer(true);
 
   // trace my destruction
-  if (not TRACE_disable_destroy() && this != PJ_container_get_root()) {
+  if (not TRACE_disable_destroy() && this != Container::getRootContainer()) {
     // do not trace the container destruction if user requests or if the container is root
     logDestruction();
   }
index 3e632e5..4eb5eee 100644 (file)
@@ -132,6 +132,8 @@ public:
   void removeFromParent();
   void logCreation();
   void logDestruction();
+
+  static Container* getRootContainer();
 };
 
 class NetZoneContainer : public Container {
@@ -324,8 +326,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_root ();
-XBT_PUBLIC(void) PJ_container_set_root (container_t root);
 void instr_new_variable_type(std::string new_typename, std::string color);
 void instr_new_user_variable_type(std::string father_type, std::string new_typename, std::string color);
 void instr_new_user_state_type(std::string father_type, std::string new_typename);
index 0343d4f..2d0d43d 100644 (file)
@@ -25,7 +25,8 @@ 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));
     simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK");
-    new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+                                       key);
 
     //destroy existing container of this process
     TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process));
@@ -36,7 +37,8 @@ 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));
     type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK");
-    new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+                                     key);
   }
 }
 
index 8d2f078..39f0254 100644 (file)
@@ -101,7 +101,8 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task)
 
     std::string key = std::string("p") + std::to_string(task->counter);
     type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
-    new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+    new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
+                                     process_container, "SR", key);
   }
 }
 
@@ -118,7 +119,8 @@ int TRACE_msg_task_put_start(msg_task_t task)
 
     std::string key = std::string("p") + std::to_string(task->counter);
     type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
-    new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, process_container, "SR", key);
+    new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
+                                       process_container, "SR", key);
   }
 
   return 1;
index 00ea1e8..a18f43c 100644 (file)
@@ -295,7 +295,8 @@ static int migration_rx_fun(int argc, char *argv[])
     // start link
     container_t msg            = simgrid::instr::Container::byName(vm->getName());
     simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
-    new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+                                       key);
 
     // destroy existing container of this vm
     container_t existing_container = simgrid::instr::Container::byName(vm->getName());
@@ -308,7 +309,8 @@ static int migration_rx_fun(int argc, char *argv[])
     // end link
     msg  = simgrid::instr::Container::byName(vm->getName());
     type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
-    new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+                                     key);
   }
 
   // Inform the SRC that the migration has been correctly performed
index f5f7708..648be99 100644 (file)
@@ -156,9 +156,9 @@ void TRACE_smpi_init(int rank)
 
   container_t father;
   if (TRACE_smpi_is_grouped()){
-    father = simgrid::instr::Container::byName(sg_host_self_get_name());
+    father = simgrid::instr::Container::byNameOrNull(sg_host_self_get_name());
   }else{
-    father = PJ_container_get_root ();
+    father = simgrid::instr::Container::getRootContainer();
   }
   xbt_assert(father != nullptr, "Could not find a parent for mpi rank %s at function %s", str.c_str(), __FUNCTION__);
 #if HAVE_PAPI
@@ -350,7 +350,8 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
   container_t container      = simgrid::instr::Container::byName(smpi_container(rank));
   simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
   XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key.c_str());
-  new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
+  new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), type, container,
+                                     "PTP", key, size);
 }
 
 void TRACE_smpi_recv(int src, int dst, int tag)
@@ -363,5 +364,6 @@ void TRACE_smpi_recv(int src, int dst, int tag)
   container_t container      = simgrid::instr::Container::byName(smpi_container(dst));
   simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
   XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key.c_str());
-  new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
+  new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), type, container,
+                                   "PTP", key);
 }
index 1a68583..6d6e819 100644 (file)
@@ -153,7 +153,7 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
 {
   std::string id = netzone.getName();
 
-  if (PJ_container_get_root() == nullptr){
+  if (simgrid::instr::Container::getRootContainer() == nullptr) {
     simgrid::instr::NetZoneContainer* root = new simgrid::instr::NetZoneContainer(id, 0, nullptr);
 
     if (TRACE_smpi_is_enabled()) {
@@ -253,7 +253,8 @@ static void instr_routing_parse_end_platform ()
   currentContainer.clear();
   std::set<std::string>* filter = new std::set<std::string>;
   XBT_DEBUG ("Starting graph extraction.");
-  recursiveGraphExtraction(simgrid::s4u::Engine::getInstance()->getNetRoot(), PJ_container_get_root(), filter);
+  recursiveGraphExtraction(simgrid::s4u::Engine::getInstance()->getNetRoot(),
+                           simgrid::instr::Container::getRootContainer(), filter);
   XBT_DEBUG ("Graph extraction finished.");
   delete filter;
   platform_created = 1;
@@ -367,7 +368,7 @@ xbt_graph_t instr_routing_platform_graph ()
   std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
   std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
   recursiveXBTGraphExtraction(ret, nodes, edges, simgrid::s4u::Engine::getInstance()->getNetRoot(),
-                              PJ_container_get_root());
+                              simgrid::instr::Container::getRootContainer());
   delete nodes;
   delete edges;
   return ret;