Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics in instr: use sensible identifier names
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 24 Jul 2017 20:33:30 +0000 (22:33 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 24 Jul 2017 20:43:55 +0000 (22:43 +0200)
src/instr/instr_interface.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_values.cpp
src/instr/instr_private.h
src/msg/instr_msg_process.cpp
src/msg/instr_msg_task.cpp
src/msg/msg_vm.cpp
src/smpi/colls/smpi_automatic_selector.cpp
src/smpi/internals/instr_smpi.cpp
src/surf/instr_routing.cpp

index 7c17b84..726b68a 100644 (file)
@@ -196,7 +196,7 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar
     mark_color = white;
 
   XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
     mark_color = white;
 
   XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color);
-  s_val rett(mark_value, mark_color, type);
+  value rett(mark_value, mark_color, type);
 }
 
 /** \ingroup TRACE_mark
 }
 
 /** \ingroup TRACE_mark
@@ -247,9 +247,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);
   }
 
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   }
 
-  val_t value = s_val::PJ_value_get (mark_value, type);
   XBT_DEBUG("MARK %s %s", mark_type, mark_value);
   XBT_DEBUG("MARK %s %s", mark_type, mark_value);
-  new NewEvent (MSG_get_clock(), PJ_container_get_root(), type, value);
+  new NewEvent(MSG_get_clock(), PJ_container_get_root(), type, value::get(mark_value, type));
 }
 
 /** \ingroup TRACE_mark
 }
 
 /** \ingroup TRACE_mark
@@ -946,11 +945,12 @@ void TRACE_host_state_declare_value (const char *state, const char *value, const
  *
  *  \see TRACE_host_state_declare, TRACE_host_push_state, TRACE_host_pop_state, TRACE_host_reset_state
  */
  *
  *  \see TRACE_host_state_declare, TRACE_host_push_state, TRACE_host_pop_state, TRACE_host_reset_state
  */
-void TRACE_host_set_state (const char *host, const char *state, const char *value)
+void TRACE_host_set_state(const char* host, const char* state, const char* value_str)
 {
   container_t container = PJ_container_get(host);
   type_t type = PJ_type_get (state, container->type);
 {
   container_t container = PJ_container_get(host);
   type_t type = PJ_type_get (state, container->type);
-  val_t val = s_val::PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+  value* val =
+      value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
   new SetStateEvent(MSG_get_clock(), container, type, val);
 }
 
   new SetStateEvent(MSG_get_clock(), container, type, val);
 }
 
@@ -965,11 +965,12 @@ void TRACE_host_set_state (const char *host, const char *state, const char *valu
  *
  *  \see TRACE_host_state_declare, TRACE_host_set_state, TRACE_host_pop_state, TRACE_host_reset_state
  */
  *
  *  \see TRACE_host_state_declare, TRACE_host_set_state, TRACE_host_pop_state, TRACE_host_reset_state
  */
-void TRACE_host_push_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);
   type_t type = PJ_type_get (state, container->type);
 {
   container_t container = PJ_container_get(host);
   type_t type = PJ_type_get (state, container->type);
-  val_t val = s_val::PJ_value_get_or_new (value, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
+  value* val =
+      value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
   new PushStateEvent(MSG_get_clock(), container, type, val);
 }
 
   new PushStateEvent(MSG_get_clock(), container, type, val);
 }
 
index cfaf78f..c7c4f7c 100644 (file)
@@ -284,16 +284,16 @@ if (instr_fmt_type == instr_fmt_paje) {
   }
 }
 
   }
 }
 
-void LogEntityValue (val_t value)
+void LogEntityValue(value* val)
 {
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue);
   //print it
 if (instr_fmt_type == instr_fmt_paje) {
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << PAJE_DefineEntityValue;
 {
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue);
   //print it
 if (instr_fmt_type == instr_fmt_paje) {
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << PAJE_DefineEntityValue;
-    stream << " " << value->id << " " << value->father->id << " " << value->name;
-    if (value->color)
-      stream << " \"" << value->color << "\"";
+    stream << " " << val->id << " " << val->father->id << " " << val->name;
+    if (val->color)
+      stream << " \"" << val->color << "\"";
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
@@ -467,13 +467,13 @@ void SubVariableEvent::print() {
   }
 }
 
   }
 }
 
-SetStateEvent::SetStateEvent (double timestamp, container_t container, type_t type, val_t value)
+SetStateEvent::SetStateEvent(double timestamp, container_t container, type_t type, value* val)
 {
   this->event_type                      = PAJE_SetState;
   this->timestamp                       = timestamp;
   this->type      = type;
   this->container = container;
 {
   this->event_type                      = PAJE_SetState;
   this->timestamp                       = timestamp;
   this->type      = type;
   this->container = container;
-  this->value     = value;
+  this->val                             = val;
 
 #if HAVE_SMPI
   if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
 
 #if HAVE_SMPI
   if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
@@ -495,7 +495,7 @@ void SetStateEvent::print() {
     stream << (int)this->event_type;
     print_timestamp(this);
     stream << " " << type->id << " " << container->id;
     stream << (int)this->event_type;
     print_timestamp(this);
     stream << " " << type->id << " " << container->id;
-    stream << " " << value->id;
+    stream << " " << val->id;
 #if HAVE_SMPI
     if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
       stream << " \"" << filename << "\" " << linenumber;
 #if HAVE_SMPI
     if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
       stream << " \"" << filename << "\" " << linenumber;
@@ -509,13 +509,13 @@ void SetStateEvent::print() {
   }
 }
 
   }
 }
 
-PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value, void* extra)
+PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra)
 {
   this->event_type                  = PAJE_PushState;
   this->timestamp                   = timestamp;
   this->type = type;
   this->container = container;
 {
   this->event_type                  = PAJE_PushState;
   this->timestamp                   = timestamp;
   this->type = type;
   this->container = container;
-  this->value     = value;
+  this->val                         = val;
   this->extra_     = extra;
 
 #if HAVE_SMPI
   this->extra_     = extra;
 
 #if HAVE_SMPI
@@ -531,8 +531,8 @@ PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t
   insert_into_buffer (this);
 }
 
   insert_into_buffer (this);
 }
 
-PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value)
: PushStateEvent(timestamp, container, type, value, nullptr)
+PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val)
   : PushStateEvent(timestamp, container, type, val, nullptr)
 {}
 void PushStateEvent::print() {
   if (instr_fmt_type == instr_fmt_paje) {
 {}
 void PushStateEvent::print() {
   if (instr_fmt_type == instr_fmt_paje) {
@@ -541,7 +541,7 @@ void PushStateEvent::print() {
     stream << (int)this->event_type;
     print_timestamp(this);
     stream << " " << type->id << " " << container->id;
     stream << (int)this->event_type;
     print_timestamp(this);
     stream << " " << type->id << " " << container->id;
-    stream << " " << value->id;
+    stream << " " << val->id;
 
     if (TRACE_display_sizes()) {
       stream << " ";
 
     if (TRACE_display_sizes()) {
       stream << " ";
@@ -680,7 +680,7 @@ void PushStateEvent::print() {
       case TRACING_SSEND:
       case TRACING_ISSEND:
       default:
       case TRACING_SSEND:
       case TRACING_ISSEND:
       default:
-        XBT_WARN("Call from %s impossible to translate into replay command : Not implemented (yet)", value->name);
+        XBT_WARN("Call from %s impossible to translate into replay command : Not implemented (yet)", val->name);
         break;
     }
 
         break;
     }
 
@@ -837,13 +837,13 @@ void EndLinkEvent::print() {
   }
 }
 
   }
 }
 
-NewEvent::NewEvent (double timestamp, container_t container, type_t type, val_t value)
+NewEvent::NewEvent(double timestamp, container_t container, type_t type, value* val)
 {
   this->event_type                      = PAJE_NewEvent;
   this->timestamp                       = timestamp;
   this->type      = type;
   this->container = container;
 {
   this->event_type                      = PAJE_NewEvent;
   this->timestamp                       = timestamp;
   this->type      = type;
   this->container = container;
-  this->value     = value;
+  this->val                             = val;
 
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
 
 
   XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp);
 
@@ -856,7 +856,7 @@ void NewEvent::print () {
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->event_type;
     print_timestamp(this);
     stream << std::fixed << std::setprecision(TRACE_precision());
     stream << (int)this->event_type;
     print_timestamp(this);
-    stream << " " << type->id << " " << container->id << " " << value->id;
+    stream << " " << type->id << " " << container->id << " " << val->id;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
     /* Nothing to do */
index 872e890..494ef42 100644 (file)
@@ -47,15 +47,15 @@ static type_t newType (const char *typeNameBuff, const char *key, const char *co
 
 void PJ_type_free (type_t type)
 {
 
 void PJ_type_free (type_t type)
 {
-  val_t value;
+  value* val;
   char *value_name;
   xbt_dict_cursor_t cursor = nullptr;
   char *value_name;
   xbt_dict_cursor_t cursor = nullptr;
-  xbt_dict_foreach(type->values, cursor, value_name, value) {
-     XBT_DEBUG("free value %s, child of %s", value->name, value->father->name);
-     xbt_free(value->name);
-     xbt_free(value->color);
-     xbt_free(value->id);
-     xbt_free(value);
+  xbt_dict_foreach (type->values, cursor, value_name, val) {
+    XBT_DEBUG("free value %s, child of %s", val->name, val->father->name);
+    xbt_free(val->name);
+    xbt_free(val->color);
+    xbt_free(val->id);
+    xbt_free(val);
   }
   xbt_dict_free (&type->values);
   xbt_free (type->name);
   }
   xbt_dict_free (&type->values);
   xbt_free (type->name);
index 10060e2..0eaefe2 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
 
-s_val::s_val(const char *name, const char *color, type_t father){
+value::value(const char* name, const char* color, type_t father)
+{
   if (name == nullptr || father == nullptr){
     THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
   }
   if (name == nullptr || father == nullptr){
     THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
   }
-  this->ret = xbt_new0(s_val, 1);
+  this->ret         = xbt_new0(value, 1);
   this->ret->name = xbt_strdup (name);
   this->ret->father = father;
   this->ret->color = xbt_strdup (color);
   this->ret->name = xbt_strdup (name);
   this->ret->father = father;
   this->ret->color = xbt_strdup (color);
@@ -28,20 +29,20 @@ s_val::s_val(const char *name, const char *color, type_t father){
   LogEntityValue(this->ret);
 };
 
   LogEntityValue(this->ret);
 };
 
-val_t s_val::PJ_value_get_or_new (const char *name, const char *color, type_t father)
+value* value::get_or_new(const char* name, const char* color, type_t father)
 {
 {
-  val_t ret = 0;
+  value* ret = 0;
   try {
   try {
-    ret = s_val::PJ_value_get(name, father);
+    ret = value::get(name, father);
   }
   catch(xbt_ex& e) {
   }
   catch(xbt_ex& e) {
-    s_val rett(name, color, father);
+    value rett(name, color, father);
     ret = rett.ret;
   }
   return ret;
 }
 
     ret = rett.ret;
   }
   return ret;
 }
 
-val_t s_val::PJ_value_get (const char *name, type_t father)
+value* value::get(const char* name, type_t father)
 {
   if (name == nullptr || father == nullptr){
     THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
 {
   if (name == nullptr || father == nullptr){
     THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
@@ -49,7 +50,7 @@ val_t s_val::PJ_value_get (const char *name, type_t father)
 
   if (father->kind == TYPE_VARIABLE)
     THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name);
 
   if (father->kind == TYPE_VARIABLE)
     THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name);
-  val_t ret = (val_t)xbt_dict_get_or_null (father->values, name);
+  value* ret = (value*)xbt_dict_get_or_null(father->values, name);
   if (ret == nullptr) {
     THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name);
   }
   if (ret == nullptr) {
     THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name);
   }
index 17f635c..a15dc2b 100644 (file)
@@ -72,19 +72,16 @@ class s_type {
 typedef s_type s_type_t;
 
 //--------------------------------------------------
 typedef s_type s_type_t;
 
 //--------------------------------------------------
-class s_val;
-typedef s_val *val_t;
-
-class s_val {
-  public:
+class value {
+public:
   char *id;
   char *name;
   char *color;
   type_t father;
   char *id;
   char *name;
   char *color;
   type_t father;
-  val_t ret;
-  s_val(const char *name, const char *color, type_t father);
-  static val_t PJ_value_get_or_new (const char *name, const char *color, type_t father);
-  static val_t PJ_value_get (const char *name, type_t father);
+  value* ret;
+  value(const char* name, const char* color, type_t father);
+  static value* get_or_new(const char* name, const char* color, type_t father);
+  static value* get(const char* name, type_t father);
 };
 
 
 };
 
 
@@ -185,12 +182,12 @@ class SetStateEvent : public PajeEvent  {
   private:
   container_t container;
   type_t type;
   private:
   container_t container;
   type_t type;
-  val_t value;
+  value* val;
   const char* filename;
   int linenumber;
   public:
   const char* filename;
   int linenumber;
   public:
-  SetStateEvent (double timestamp, container_t container, type_t type, val_t value);
-  void print() override;
+    SetStateEvent(double timestamp, container_t container, type_t type, value* val);
+    void print() override;
 };
 
 
 };
 
 
@@ -198,16 +195,15 @@ class PushStateEvent : public PajeEvent  {
   public:
   container_t container;
   type_t type;
   public:
   container_t container;
   type_t type;
-  val_t value;
+  value* val;
   int size;
   const char* filename;
   int linenumber;
   void* extra_;
   public:
   int size;
   const char* filename;
   int linenumber;
   void* extra_;
   public:
-  PushStateEvent (double timestamp, container_t container, type_t type, val_t value);
-  PushStateEvent (double timestamp, container_t container, type_t type, val_t value,
-                                             void* extra);
-  void print() override;
+    PushStateEvent(double timestamp, container_t container, type_t type, value* val);
+    PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra);
+    void print() override;
 };
 
 class PopStateEvent : public PajeEvent  {
 };
 
 class PopStateEvent : public PajeEvent  {
@@ -261,9 +257,10 @@ class NewEvent : public PajeEvent  {
   public:
   container_t container;
   type_t type;
   public:
   container_t container;
   type_t type;
-  val_t value;
-  public:
-  NewEvent (double timestamp, container_t container, type_t type, val_t value);
+  value* val;
+
+public:
+  NewEvent(double timestamp, container_t container, type_t type, value* val);
   void print() override;
 
 };
   void print() override;
 
 };
@@ -433,7 +430,7 @@ void DefineContainerEvent(type_t type);
 void LogVariableTypeDefinition(type_t type);
 void LogStateTypeDefinition(type_t type);
 void LogLinkTypeDefinition(type_t type, type_t source, type_t dest);
 void LogVariableTypeDefinition(type_t type);
 void LogStateTypeDefinition(type_t type);
 void LogLinkTypeDefinition(type_t type, type_t source, type_t dest);
-void LogEntityValue (val_t value);
+void LogEntityValue(value* val);
 void LogContainerCreation (container_t container);
 void LogContainerDestruction (container_t container);
 void LogDefineEventType(type_t type);
 void LogContainerCreation (container_t container);
 void LogContainerDestruction (container_t container);
 void LogDefineEventType(type_t type);
index b0ad430..3ce2884 100644 (file)
@@ -94,8 +94,8 @@ void TRACE_msg_process_suspend(msg_process_t process)
 
     container_t process_container = PJ_container_get (instr_process_id(process, str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 
     container_t process_container = PJ_container_get (instr_process_id(process, str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = s_val::PJ_value_get ("suspend", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
+    value* val                    = value::get("suspend", type);
+    new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
 
   }
 }
 
@@ -119,8 +119,8 @@ void TRACE_msg_process_sleep_in(msg_process_t process)
 
     container_t process_container = PJ_container_get (instr_process_id(process, str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 
     container_t process_container = PJ_container_get (instr_process_id(process, str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = s_val::PJ_value_get ("sleep", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
+    value* val                    = value::get("sleep", type);
+    new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
 
   }
 }
 
index c1190d8..1ac51f1 100644 (file)
@@ -54,8 +54,8 @@ void TRACE_msg_task_execute_start(msg_task_t task)
 
     container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 
     container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = s_val::PJ_value_get ("task_execute", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
+    value* val                    = value::get("task_execute", type);
+    new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
 
   }
 }
 
@@ -94,8 +94,8 @@ void TRACE_msg_task_get_start()
 
     container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 
     container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = s_val::PJ_value_get ("receive", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
+    value* val                    = value::get("receive", type);
+    new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
 }
 
   }
 }
 
@@ -129,8 +129,8 @@ int TRACE_msg_task_put_start(msg_task_t task)
 
     container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
 
     container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len));
     type_t type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
-    val_t value = s_val::PJ_value_get ("send", type);
-    new PushStateEvent (MSG_get_clock(), process_container, type, value);
+    value* val                    = value::get("send", type);
+    new PushStateEvent(MSG_get_clock(), process_container, type, val);
 
     char key[INSTR_DEFAULT_STR_SIZE];
     snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
 
     char key[INSTR_DEFAULT_STR_SIZE];
     snprintf (key, INSTR_DEFAULT_STR_SIZE, "p%lld", task->counter);
index f82eb11..99a3c5d 100644 (file)
@@ -215,8 +215,8 @@ void MSG_vm_start(msg_vm_t vm)
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container = PJ_container_get(vm->getCname());
     type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container = PJ_container_get(vm->getCname());
     type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
-    val_t value              = s_val::PJ_value_get_or_new("start", "0 0 1", type); // start is blue
-    new PushStateEvent(MSG_get_clock(), vm_container, type, value);
+    value* val               = value::get_or_new("start", "0 0 1", type); // start is blue
+    new PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
 }
 
   }
 }
 
@@ -815,8 +815,8 @@ void MSG_vm_suspend(msg_vm_t vm)
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container = PJ_container_get(vm->getCname());
     type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container = PJ_container_get(vm->getCname());
     type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
-    val_t value              = s_val::PJ_value_get_or_new("suspend", "1 0 0", type); // suspend is red
-    new PushStateEvent(MSG_get_clock(), vm_container, type, value);
+    value* val               = value::get_or_new("suspend", "1 0 0", type); // suspend is red
+    new PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
 }
 
   }
 }
 
index e336785..017e61e 100644 (file)
@@ -22,8 +22,8 @@
     }                                                                                                                  \
     char cont_name[25];                                                                                                \
     snprintf(cont_name, 25, "rank-%d", smpi_process()->index());                                                       \
     }                                                                                                                  \
     char cont_name[25];                                                                                                \
     snprintf(cont_name, 25, "rank-%d", smpi_process()->index());                                                       \
-    val_t value = s_val::PJ_value_get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type);               \
-    new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, value);                                         \
+    value* val = value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type);                  \
+    new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val);                                           \
   }
 
 #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)                                                                    \
   }
 
 #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)                                                                    \
index 0eeccfa..52e6e4b 100644 (file)
@@ -245,8 +245,8 @@ void TRACE_smpi_collective_in(int rank, const char *operation, instr_extra_data
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
-  val_t value = s_val::PJ_value_get_or_new (operation, color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new(operation, color, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_collective_out(int rank, const char *operation)
 }
 
 void TRACE_smpi_collective_out(int rank, const char *operation)
@@ -273,8 +273,7 @@ void TRACE_smpi_computing_init(int rank)
  container_t container = PJ_container_get(str);
  type_t type           = PJ_type_get("MPI_STATE", container->type);
  const char* color     = instr_find_color("computing");
  container_t container = PJ_container_get(str);
  type_t type           = PJ_type_get("MPI_STATE", container->type);
  const char* color     = instr_find_color("computing");
- val_t value           = s_val::PJ_value_get_or_new("computing", color, type);
- new PushStateEvent(SIMIX_get_clock(), container, type, value);
+ new PushStateEvent(SIMIX_get_clock(), container, type, value::get_or_new("computing", color, type));
 }
 
 void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
 }
 
 void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
@@ -289,8 +288,8 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra)
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = s_val::PJ_value_get_or_new ("computing", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new("computing", nullptr, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_computing_out(int rank)
 }
 
 void TRACE_smpi_computing_out(int rank)
@@ -315,8 +314,8 @@ void TRACE_smpi_sleeping_init(int rank)
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color ("sleeping");
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color ("sleeping");
-  val_t value = s_val::PJ_value_get_or_new ("sleeping", color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value);
+  value* val            = value::get_or_new("sleeping", color, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val);
 }
 
 void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
 }
 
 void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
@@ -331,8 +330,8 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra)
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = s_val::PJ_value_get_or_new ("sleeping", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new("sleeping", nullptr, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_sleeping_out(int rank)
 }
 
 void TRACE_smpi_sleeping_out(int rank)
@@ -358,8 +357,8 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra)
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
-  val_t value = s_val::PJ_value_get_or_new ("test", nullptr, type);
-  new PushStateEvent  (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new("test", nullptr, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_testing_out(int rank)
 }
 
 void TRACE_smpi_testing_out(int rank)
@@ -385,8 +384,8 @@ void TRACE_smpi_ptp_in(int rank, const char *operation, instr_extra_data extra)
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
   container_t container = PJ_container_get (str);
   type_t type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
-  val_t value = s_val::PJ_value_get_or_new (operation, color, type);
-  new PushStateEvent (SIMIX_get_clock(), container, type, value, static_cast<void*>(extra));
+  value* val            = value::get_or_new(operation, color, type);
+  new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
 
 void TRACE_smpi_ptp_out(int rank, int dst, const char *operation)
 }
 
 void TRACE_smpi_ptp_out(int rank, int dst, const char *operation)
index fab1c56..588afb7 100644 (file)
@@ -267,11 +267,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
     if (msg_process == nullptr){
       msg_process = PJ_type_container_new("MSG_PROCESS", container->type);
       type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process);
     if (msg_process == nullptr){
       msg_process = PJ_type_container_new("MSG_PROCESS", container->type);
       type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process);
-      s_val PJ_value("suspend", "1 0 1", state);
-      s_val::PJ_value_get_or_new("sleep", "1 1 0", state);
-      s_val::PJ_value_get_or_new("receive", "1 0 0", state);
-      s_val::PJ_value_get_or_new("send", "0 0 1", state);
-      s_val::PJ_value_get_or_new("task_execute", "0 1 1", state);
+      value PJ_value("suspend", "1 0 1", state);
+      value::get_or_new("sleep", "1 1 0", state);
+      value::get_or_new("receive", "1 0 0", state);
+      value::get_or_new("send", "0 0 1", state);
+      value::get_or_new("task_execute", "0 1 1", state);
       PJ_type_link_new ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
       PJ_type_link_new ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
     }
       PJ_type_link_new ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
       PJ_type_link_new ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
     }
@@ -282,11 +282,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
     if (msg_vm == nullptr){
       msg_vm = PJ_type_container_new("MSG_VM", container->type);
       type_t state = PJ_type_state_new ("MSG_VM_STATE", msg_vm);
     if (msg_vm == nullptr){
       msg_vm = PJ_type_container_new("MSG_VM", container->type);
       type_t state = PJ_type_state_new ("MSG_VM_STATE", msg_vm);
-      s_val PJ_value("suspend", "1 0 1", state);
-      s_val::PJ_value_get_or_new ("sleep", "1 1 0", state);
-      s_val::PJ_value_get_or_new ("receive", "1 0 0", state);
-      s_val::PJ_value_get_or_new ("send", "0 0 1", state);
-      s_val::PJ_value_get_or_new ("task_execute", "0 1 1", state);
+      value PJ_value("suspend", "1 0 1", state);
+      value::get_or_new("sleep", "1 1 0", state);
+      value::get_or_new("receive", "1 0 0", state);
+      value::get_or_new("send", "0 0 1", state);
+      value::get_or_new("task_execute", "0 1 1", state);
       PJ_type_link_new ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
       PJ_type_link_new ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
     }
       PJ_type_link_new ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
       PJ_type_link_new ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
     }
@@ -400,16 +400,16 @@ void instr_new_user_state_type (const char *father_type, const char *new_typenam
   recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root());
 }
 
   recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root());
 }
 
-static void recursiveNewValueForUserStateType (const char *type_name, const char *value, const char *color, type_t root)
+static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, type_t root)
 {
   if (not strcmp(root->name, type_name)) {
 {
   if (not strcmp(root->name, type_name)) {
-    s_val PJ_value (value, color, root);
+    value PJ_value(val, color, root);
   }
   xbt_dict_cursor_t cursor = nullptr;
   type_t child_type;
   char *name;
   xbt_dict_foreach(root->children, cursor, name, child_type) {
   }
   xbt_dict_cursor_t cursor = nullptr;
   type_t child_type;
   char *name;
   xbt_dict_foreach(root->children, cursor, name, child_type) {
-    recursiveNewValueForUserStateType (type_name, value, color, child_type);
+    recursiveNewValueForUserStateType(type_name, val, color, child_type);
   }
 }
 
   }
 }