Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Continue to reorganize instr
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 30 Oct 2017 09:54:59 +0000 (10:54 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 30 Oct 2017 09:54:59 +0000 (10:54 +0100)
13 files changed:
src/instr/instr_paje_events.cpp
src/instr/instr_paje_events.hpp [new file with mode: 0644]
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_types.hpp
src/instr/instr_paje_values.hpp [new file with mode: 0644]
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
tools/cmake/DefinePackages.cmake

index 5f897c6..c456e9d 100644 (file)
@@ -15,6 +15,25 @@ std::map<container_t, FILE*> tracing_files; // TI specific
 namespace simgrid {
 namespace instr {
 
 namespace simgrid {
 namespace instr {
 
+PajeEvent::~PajeEvent()
+{
+  XBT_DEBUG("%s not implemented for %p: event_type=%u, timestamp=%f", __FUNCTION__, this, eventType_, timestamp_);
+}
+
+LinkEvent::LinkEvent(double timestamp, container_t container, Type* type, e_event_type event_type, container_t endpoint,
+                     std::string value, std::string key)
+    : LinkEvent(timestamp, container, type, event_type, endpoint, value, key, -1)
+{
+}
+
+LinkEvent::LinkEvent(double timestamp, container_t container, Type* type, e_event_type event_type, container_t endpoint,
+                     std::string value, std::string key, int size)
+    : PajeEvent(container, type, timestamp, event_type), endpoint_(endpoint), value_(value), key_(key), size_(size)
+{
+  XBT_DEBUG("%s: event_type=%u, timestamp=%f, value:%s", __FUNCTION__, eventType_, timestamp_, value_.c_str());
+  insertIntoBuffer();
+}
+
 VariableEvent::VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value)
     : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value)
 {
 VariableEvent::VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value)
     : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value)
 {
@@ -43,6 +62,27 @@ StateEvent::StateEvent(double timestamp, Container* container, Type* type, e_eve
   insertIntoBuffer();
 };
 
   insertIntoBuffer();
 };
 
+void LinkEvent::print()
+{
+  std::stringstream stream;
+  stream << std::fixed << std::setprecision(TRACE_precision());
+  XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
+  if (instr_fmt_type != instr_fmt_paje)
+    return;
+  if (timestamp_ < 1e-12)
+    stream << eventType_ << " " << 0 << " " << type->getId() << " " << container->getId() << " " << value_;
+  else
+    stream << eventType_ << " " << timestamp_ << " " << type->getId() << " " << container->getId() << " " << value_;
+
+  stream << " " << endpoint_->getId() << " " << key_;
+
+  if (TRACE_display_sizes()) {
+    stream << " " << size_;
+  }
+  XBT_DEBUG("Dump %s", stream.str().c_str());
+  fprintf(tracing_file, "%s\n", stream.str().c_str());
+}
+
 void VariableEvent::print()
 {
   std::stringstream stream;
 void VariableEvent::print()
 {
   std::stringstream stream;
diff --git a/src/instr/instr_paje_events.hpp b/src/instr/instr_paje_events.hpp
new file mode 100644 (file)
index 0000000..ebdad78
--- /dev/null
@@ -0,0 +1,97 @@
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef INSTR_PAJE_EVENTS_HPP
+#define INSTR_PAJE_EVENTS_HPP
+
+#include "src/instr/instr_private.hpp"
+#include <string>
+
+namespace simgrid {
+namespace instr {
+class EntityValue;
+
+enum e_event_type : unsigned int {
+  PAJE_DefineContainerType,
+  PAJE_DefineVariableType,
+  PAJE_DefineStateType,
+  PAJE_DefineEventType,
+  PAJE_DefineLinkType,
+  PAJE_DefineEntityValue,
+  PAJE_CreateContainer,
+  PAJE_DestroyContainer,
+  PAJE_SetVariable,
+  PAJE_AddVariable,
+  PAJE_SubVariable,
+  PAJE_SetState,
+  PAJE_PushState,
+  PAJE_PopState,
+  PAJE_ResetState,
+  PAJE_StartLink,
+  PAJE_EndLink,
+  PAJE_NewEvent
+};
+
+class PajeEvent {
+protected:
+  Container* container;
+  Type* type;
+
+public:
+  double timestamp_;
+  e_event_type eventType_;
+  PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType)
+      : container(container), type(type), timestamp_(timestamp), eventType_(eventType){};
+  virtual ~PajeEvent();
+  virtual void print() = 0;
+  void insertIntoBuffer();
+};
+
+class VariableEvent : public PajeEvent {
+  double value;
+
+public:
+  VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value);
+  void print() override;
+};
+
+class StateEvent : public PajeEvent {
+  EntityValue* value;
+  std::string filename;
+  int linenumber;
+  void* extra_ = nullptr;
+
+public:
+  StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value);
+  StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value,
+             void* extra);
+  void print() override;
+};
+
+class LinkEvent : public PajeEvent {
+  Container* endpoint_;
+  std::string value_;
+  std::string key_;
+  int size_ = -1;
+
+public:
+  LinkEvent(double timestamp, Container* container, Type* type, e_event_type event_type, Container* sourceContainer,
+            std::string value, std::string key);
+  LinkEvent(double timestamp, Container* container, Type* type, e_event_type event_type, Container* sourceContainer,
+            std::string value, std::string key, int size);
+  void print() override;
+};
+
+class NewEvent : public PajeEvent {
+  EntityValue* val;
+
+public:
+  NewEvent(double timestamp, Container* container, Type* type, EntityValue* val);
+  void print() override;
+};
+}
+}
+
+#endif
index 555746b..0e2c89c 100644 (file)
@@ -135,11 +135,6 @@ void simgrid::instr::PajeEvent::insertIntoBuffer()
   buffer_debug(&buffer);
 }
 
   buffer_debug(&buffer);
 }
 
-simgrid::instr::PajeEvent::~PajeEvent()
-{
-  XBT_DEBUG("%s not implemented for %p: event_type=%u, timestamp=%f", __FUNCTION__, this, eventType_, timestamp_);
-}
-
 void TRACE_paje_start() {
   char *filename = TRACE_get_filename();
   tracing_file = fopen(filename, "w");
 void TRACE_paje_start() {
   char *filename = TRACE_get_filename();
   tracing_file = fopen(filename, "w");
@@ -176,74 +171,6 @@ void TRACE_paje_end() {
   XBT_DEBUG("Filename %s is closed", filename);
 }
 
   XBT_DEBUG("Filename %s is closed", filename);
 }
 
-simgrid::instr::StartLinkEvent::StartLinkEvent(double timestamp, container_t container, Type* type,
-                                               container_t sourceContainer, std::string value, std::string key)
-    : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
-{}
-
-simgrid::instr::StartLinkEvent::StartLinkEvent(double timestamp, container_t container, Type* type,
-                                               container_t sourceContainer, std::string value, std::string key,
-                                               int size)
-    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_StartLink)
-    , sourceContainer_(sourceContainer)
-    , value_(value)
-    , key_(key)
-    , size_(size)
-{
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f, value:%s", __FUNCTION__, eventType_, this->timestamp_,
-            this->value_.c_str());
-  insertIntoBuffer();
-}
-
-void simgrid::instr::StartLinkEvent::print()
-{
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << eventType_;
-    print_timestamp(this);
-    stream << " " << type->getId() << " " << container->getId() << " " << value_;
-    stream << " " << sourceContainer_->getId() << " " << key_;
-
-    if (TRACE_display_sizes()) {
-      stream << " " << size_;
-    }
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
-simgrid::instr::EndLinkEvent::EndLinkEvent(double timestamp, container_t container, Type* type,
-                                           container_t destContainer, std::string value, std::string key)
-    : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_EndLink)
-    , destContainer(destContainer)
-    , value(value)
-    , key(key)
-{
-  XBT_DEBUG("%s: event_type=%u, timestamp=%f", __FUNCTION__, eventType_, this->timestamp_);
-  insertIntoBuffer();
-}
-
-void simgrid::instr::EndLinkEvent::print()
-{
-  if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __FUNCTION__, eventType_, TRACE_precision(), timestamp_);
-    stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << eventType_;
-    print_timestamp(this);
-    stream << " " << type->getId() << " " << container->getId() << " " << value;
-    stream << " " << destContainer->getId() << " " << key;
-    print_row();
-  } else if (instr_fmt_type == instr_fmt_TI) {
-    /* Nothing to do */
-  } else {
-    THROW_IMPOSSIBLE;
-  }
-}
-
 simgrid::instr::NewEvent::NewEvent(double timestamp, container_t container, Type* type, EntityValue* val)
     : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent), val(val)
 {
 simgrid::instr::NewEvent::NewEvent(double timestamp, container_t container, Type* type, EntityValue* val)
     : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent), val(val)
 {
@@ -287,6 +214,5 @@ void TRACE_TI_start()
 void TRACE_TI_end()
 {
   fclose(tracing_file);
 void TRACE_TI_end()
 {
   fclose(tracing_file);
-  char *filename = TRACE_get_filename();
-  XBT_DEBUG("Filename %s is closed", filename);
+  XBT_DEBUG("Filename %s is closed", TRACE_get_filename());
 }
 }
index 4ae22bb..c842064 100644 (file)
@@ -110,6 +110,23 @@ void VariableType::subEvent(double timestamp, Container* container, double value
 LinkType::LinkType(std::string name, std::string alias, Type* father) : ValueType(name, alias, father)
 {
 }
 LinkType::LinkType(std::string name, std::string alias, Type* father) : ValueType(name, alias, father)
 {
 }
+void LinkType::startEvent(double timestamp, Container* container, container_t endpoint, std::string value,
+                          std::string key)
+{
+  startEvent(timestamp, container, endpoint, value, key, -1);
+}
+
+void LinkType::startEvent(double timestamp, Container* container, container_t endpoint, std::string value,
+                          std::string key, int size)
+{
+  new LinkEvent(timestamp, container, this, PAJE_StartLink, endpoint, value, key, size);
+}
+
+void LinkType::endEvent(double timestamp, Container* container, container_t endpoint, std::string value,
+                        std::string key)
+{
+  new LinkEvent(timestamp, container, this, PAJE_EndLink, endpoint, value, key);
+}
 
 void Type::logDefinition(e_event_type event_type)
 {
 
 void Type::logDefinition(e_event_type event_type)
 {
index 8306af0..5a18cc0 100644 (file)
@@ -85,6 +85,12 @@ public:
 class LinkType : public ValueType {
 public:
   LinkType(std::string name, std::string alias, Type* father);
 class LinkType : public ValueType {
 public:
   LinkType(std::string name, std::string alias, Type* father);
+  void startEvent(double timestamp, Container* source_container, Container* sourceContainer, std::string value,
+                  std::string key);
+  void startEvent(double timestamp, Container* source_container, Container* sourceContainer, std::string value,
+                  std::string key, int size);
+  void endEvent(double timestamp, Container* source_container, Container* destContainer, std::string value,
+                std::string key);
 };
 
 class EventType : public ValueType {
 };
 
 class EventType : public ValueType {
diff --git a/src/instr/instr_paje_values.hpp b/src/instr/instr_paje_values.hpp
new file mode 100644 (file)
index 0000000..7e180ba
--- /dev/null
@@ -0,0 +1,31 @@
+/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef INSTR_PAJE_VALUES_HPP
+#define INSTR_PAJE_VALUES_HPP
+
+#include "src/instr/instr_private.hpp"
+#include <string>
+
+namespace simgrid {
+namespace instr {
+
+class EntityValue {
+  long long int id_;
+  std::string name_;
+  std::string color_;
+  Type* father_;
+
+public:
+  explicit EntityValue(std::string name, std::string color, Type* father);
+  ~EntityValue() = default;
+  const char* getCname() { return name_.c_str(); }
+  long long int getId() { return id_; }
+  void print();
+};
+}
+}
+
+#endif
index 97b9e9b..60e6bca 100644 (file)
@@ -12,7 +12,9 @@
 #include "simgrid/instr.h"
 #include "simgrid_config.h"
 #include "src/instr/instr_paje_containers.hpp"
 #include "simgrid/instr.h"
 #include "simgrid_config.h"
 #include "src/instr/instr_paje_containers.hpp"
+#include "src/instr/instr_paje_events.hpp"
 #include "src/instr/instr_paje_types.hpp"
 #include "src/instr/instr_paje_types.hpp"
+#include "src/instr/instr_paje_values.hpp"
 #include "src/internal_config.h"
 #include "xbt/graph.h"
 #include <iomanip> /** std::setprecision **/
 #include "src/internal_config.h"
 #include "xbt/graph.h"
 #include <iomanip> /** std::setprecision **/
 #define drand48() (rand() / (RAND_MAX + 1.0))
 #endif
 
 #define drand48() (rand() / (RAND_MAX + 1.0))
 #endif
 
-namespace simgrid {
-namespace instr {
-
-class Container;
-class Type;
-class EntityValue;
-class ContainerType;
-class EventType;
-class LinkType;
-class StateType;
-class VariableType;
-
-enum e_event_type : unsigned int {
-  PAJE_DefineContainerType,
-  PAJE_DefineVariableType,
-  PAJE_DefineStateType,
-  PAJE_DefineEventType,
-  PAJE_DefineLinkType,
-  PAJE_DefineEntityValue,
-  PAJE_CreateContainer,
-  PAJE_DestroyContainer,
-  PAJE_SetVariable,
-  PAJE_AddVariable,
-  PAJE_SubVariable,
-  PAJE_SetState,
-  PAJE_PushState,
-  PAJE_PopState,
-  PAJE_ResetState,
-  PAJE_StartLink,
-  PAJE_EndLink,
-  PAJE_NewEvent
-};
-
-class EntityValue {
-  long long int id_;
-  std::string name_;
-  std::string color_;
-  Type* father_;
-
-public:
-  explicit EntityValue(std::string name, std::string color, Type* father);
-  ~EntityValue() = default;
-  const char* getCname() { return name_.c_str(); }
-  long long int getId() { return id_; }
-  void print();
-};
-
-class PajeEvent {
-protected:
-  Container* container;
-  Type* type;
-
-public:
-  double timestamp_;
-  e_event_type eventType_;
-  PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType)
-      : container(container), type(type), timestamp_(timestamp), eventType_(eventType){};
-  virtual ~PajeEvent();
-  virtual void print() = 0;
-  void insertIntoBuffer();
-};
-
-class VariableEvent : public PajeEvent {
-  double value;
-
-public:
-  VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value);
-  void print() override;
-};
-
-class StateEvent : public PajeEvent {
-  EntityValue* value;
-  std::string filename;
-  int linenumber;
-  void* extra_ = nullptr;
-
-public:
-  StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value);
-  StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value,
-             void* extra);
-  void print() override;
-};
-
-class StartLinkEvent : public PajeEvent {
-  Container* sourceContainer_;
-  std::string value_;
-  std::string key_;
-  int size_;
-
-public:
-  StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, std::string value,
-                 std::string key);
-  StartLinkEvent(double timestamp, Container* container, Type* type, Container* sourceContainer, std::string value,
-                 std::string key, int size);
-  void print() override;
-};
-
-class EndLinkEvent : public PajeEvent {
-  Container* destContainer;
-  std::string value;
-  std::string key;
-
-public:
-  EndLinkEvent(double timestamp, Container* container, Type* type, Container* destContainer, std::string value,
-               std::string key);
-  ~EndLinkEvent() = default;
-  void print() override;
-};
-
-class NewEvent : public PajeEvent {
-  EntityValue* val;
-
-public:
-  NewEvent(double timestamp, Container* container, Type* type, EntityValue* val);
-  void print() override;
-};
-}
-} // namespace simgrid::instr
 typedef simgrid::instr::Container* container_t;
 
 extern "C" {
 typedef simgrid::instr::Container* container_t;
 
 extern "C" {
index 4a6eedc..c3e5b86 100644 (file)
@@ -24,9 +24,9 @@ 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));
 
     //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(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
-                                       key);
+    simgrid::instr::LinkType* link =
+        static_cast<simgrid::instr::LinkType*>(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK"));
+    link->startEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key);
 
     //destroy existing container of this process
     TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process));
 
     //destroy existing container of this process
     TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process));
@@ -36,9 +36,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));
 
     //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(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
-                                     key);
+    link->endEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key);
   }
 }
 
   }
 }
 
index 166e199..7a146ac 100644 (file)
@@ -102,9 +102,9 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task)
     state->popEvent(MSG_get_clock(), process_container);
 
     std::string key = std::string("p") + std::to_string(task->counter);
     state->popEvent(MSG_get_clock(), process_container);
 
     std::string key = std::string("p") + std::to_string(task->counter);
-    simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK");
-    new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
-                                     process_container, "SR", key);
+    simgrid::instr::LinkType* link =
+        static_cast<simgrid::instr::LinkType*>(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK"));
+    link->endEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), process_container, "SR", key);
   }
 }
 
   }
 }
 
@@ -120,10 +120,9 @@ int TRACE_msg_task_put_start(msg_task_t task)
     state->pushEvent(MSG_get_clock(), process_container, "send");
 
     std::string key = std::string("p") + std::to_string(task->counter);
     state->pushEvent(MSG_get_clock(), process_container, "send");
 
     std::string key = std::string("p") + std::to_string(task->counter);
-    simgrid::instr::LinkType* type =
+    simgrid::instr::LinkType* link =
         static_cast<simgrid::instr::LinkType*>(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK"));
         static_cast<simgrid::instr::LinkType*>(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_TASK_LINK"));
-    new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type,
-                                       process_container, "SR", key);
+    link->startEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), process_container, "SR", key);
   }
 
   return 1;
   }
 
   return 1;
index ce7c0a4..6f5c673 100644 (file)
@@ -295,9 +295,9 @@ static int migration_rx_fun(int argc, char *argv[])
 
     // start link
     container_t msg            = simgrid::instr::Container::byName(vm->getName());
 
     // 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(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
-                                       key);
+    simgrid::instr::LinkType* link =
+        static_cast<simgrid::instr::LinkType*>(simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK"));
+    link->startEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key);
 
     // destroy existing container of this vm
     container_t existing_container = simgrid::instr::Container::byName(vm->getName());
 
     // destroy existing container of this vm
     container_t existing_container = simgrid::instr::Container::byName(vm->getName());
@@ -309,9 +309,7 @@ static int migration_rx_fun(int argc, char *argv[])
 
     // end link
     msg  = simgrid::instr::Container::byName(vm->getName());
 
     // 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(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
-                                     key);
+    link->endEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), msg, "M", key);
   }
 
   // Inform the SRC that the migration has been correctly performed
   }
 
   // Inform the SRC that the migration has been correctly performed
index 5c9cf7d..3dc3f33 100644 (file)
@@ -341,10 +341,10 @@ void TRACE_smpi_send(int rank, int src, int dst, int tag, int size)
   std::string key = TRACE_smpi_get_key(src, dst, tag, 1);
 
   container_t container      = simgrid::instr::Container::byName(smpi_container(rank));
   std::string key = TRACE_smpi_get_key(src, dst, tag, 1);
 
   container_t container      = simgrid::instr::Container::byName(smpi_container(rank));
-  simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
+  simgrid::instr::LinkType* link =
+      static_cast<simgrid::instr::LinkType*>(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());
   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(), simgrid::instr::Container::getRootContainer(), type, container,
-                                     "PTP", key, size);
+  link->startEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), container, "PTP", key, size);
 }
 
 void TRACE_smpi_recv(int src, int dst, int tag)
 }
 
 void TRACE_smpi_recv(int src, int dst, int tag)
@@ -355,8 +355,8 @@ void TRACE_smpi_recv(int src, int dst, int tag)
   std::string key = TRACE_smpi_get_key(src, dst, tag, 0);
 
   container_t container      = simgrid::instr::Container::byName(smpi_container(dst));
   std::string key = TRACE_smpi_get_key(src, dst, tag, 0);
 
   container_t container      = simgrid::instr::Container::byName(smpi_container(dst));
-  simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MPI_LINK");
+  simgrid::instr::LinkType* link =
+      static_cast<simgrid::instr::LinkType*>(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());
   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(), simgrid::instr::Container::getRootContainer(), type, container,
-                                   "PTP", key);
+  link->endEvent(SIMIX_get_clock(), simgrid::instr::Container::getRootContainer(), container, "PTP", key);
 }
 }
index 3272ca9..e9c886b 100644 (file)
@@ -99,10 +99,10 @@ static void linkContainers(container_t src, container_t dst, std::set<std::strin
   std::string link_typename = father->type_->getName() + "-" + src->type_->getName() +
                               std::to_string(src->type_->getId()) + "-" + dst->type_->getName() +
                               std::to_string(dst->type_->getId());
   std::string link_typename = father->type_->getName() + "-" + src->type_->getName() +
                               std::to_string(src->type_->getId()) + "-" + dst->type_->getName() +
                               std::to_string(dst->type_->getId());
-  simgrid::instr::Type* link_type = father->type_->getOrCreateLinkType(link_typename, src->type_, dst->type_);
+  simgrid::instr::LinkType* link = father->type_->getOrCreateLinkType(link_typename, src->type_, dst->type_);
 
   //register EDGE types for triva configuration
 
   //register EDGE types for triva configuration
-  trivaEdgeTypes.insert(link_type->getName());
+  trivaEdgeTypes.insert(link->getName());
 
   //create the link
   static long long counter = 0;
 
   //create the link
   static long long counter = 0;
@@ -110,8 +110,8 @@ static void linkContainers(container_t src, container_t dst, std::set<std::strin
   std::string key = std::to_string(counter);
   counter++;
 
   std::string key = std::to_string(counter);
   counter++;
 
-  new simgrid::instr::StartLinkEvent(SIMIX_get_clock(), father, link_type, src, "topology", key);
-  new simgrid::instr::EndLinkEvent(SIMIX_get_clock(), father, link_type, dst, "topology", key);
+  link->startEvent(SIMIX_get_clock(), father, src, "topology", key);
+  link->endEvent(SIMIX_get_clock(), father, dst, "topology", key);
 
   XBT_DEBUG("  linkContainers %s <-> %s", src->getCname(), dst->getCname());
 }
 
   XBT_DEBUG("  linkContainers %s <-> %s", src->getCname(), dst->getCname());
 }
index e4b0078..6dddf5a 100644 (file)
@@ -551,11 +551,13 @@ set(TRACING_SRC
   src/instr/instr_paje_containers.cpp
   src/instr/instr_paje_containers.hpp
   src/instr/instr_paje_events.cpp
   src/instr/instr_paje_containers.cpp
   src/instr/instr_paje_containers.hpp
   src/instr/instr_paje_events.cpp
+  src/instr/instr_paje_events.hpp
   src/instr/instr_paje_header.cpp
   src/instr/instr_paje_trace.cpp
   src/instr/instr_paje_types.cpp
   src/instr/instr_paje_types.hpp
   src/instr/instr_paje_values.cpp
   src/instr/instr_paje_header.cpp
   src/instr/instr_paje_trace.cpp
   src/instr/instr_paje_types.cpp
   src/instr/instr_paje_types.hpp
   src/instr/instr_paje_values.cpp
+  src/instr/instr_paje_values.hpp
   src/instr/instr_private.hpp
   src/instr/instr_smpi.hpp
   src/instr/instr_resource_utilization.cpp
   src/instr/instr_private.hpp
   src/instr/instr_smpi.hpp
   src/instr/instr_resource_utilization.cpp