Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
update requested changes
authorTakishipp <toufik.boubehziz@gmail.com>
Tue, 13 Jun 2017 15:00:50 +0000 (17:00 +0200)
committerTakishipp <toufik.boubehziz@gmail.com>
Tue, 13 Jun 2017 15:00:50 +0000 (17:00 +0200)
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_values.cpp
src/instr/instr_private.h

index 16bbd9b..c2b6515 100644 (file)
@@ -138,7 +138,7 @@ container_t PJ_container_new (const char *name, e_container_types kind, containe
   newContainer->children = xbt_dict_new_homogeneous(nullptr);
   if (newContainer->father){
     xbt_dict_set(newContainer->father->children, newContainer->name, newContainer, nullptr);
-    CreateContainerEvent(newContainer);
+    LogContainerCreation(newContainer);
   }
 
   //register all kinds by name
@@ -206,7 +206,7 @@ void PJ_container_free (container_t container)
   if (not TRACE_disable_destroy() && container != PJ_container_get_root()) {
     //do not trace the container destruction if user requests
     //or if the container is root
-    DestroyContainerEvent(container);
+    LogContainerDestruction(container);
   }
 
   //remove it from allContainers data structure
index 5cabc10..3a61d20 100644 (file)
@@ -214,14 +214,12 @@ void TRACE_paje_end() {
 
 void DefineContainerEvent(type_t type)
 {
-  e_event_type event_type                            = PAJE_DefineContainerType;
-  double timestamp                             = 0;
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineContainerType);
   //print it
   if (instr_fmt_type == instr_fmt_paje) {
-               XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
+               XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineContainerType, TRACE_precision(), 0.);
                stream << std::fixed << std::setprecision(TRACE_precision());
-               stream << (int)event_type;
+               stream << PAJE_DefineContainerType;
                stream << " " << type->id
                                << " " << type->father->id
                                << " " << type->name;
@@ -236,18 +234,16 @@ void DefineContainerEvent(type_t type)
 
 
 
-void DefineVariableTypeEvent(type_t type)
+void LogVariableTypeDefinition(type_t type)
 {
-  e_event_type event_type                           = PAJE_DefineVariableType;
-  double timestamp                            = 0;
 
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineVariableType);
 
   //print it
 if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineVariableType, TRACE_precision(), 0.);
     stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)event_type;
+    stream << PAJE_DefineVariableType;
     stream << " " << type->id << " " << type->father->id << " " << type->name;
     if (type->color)
       stream << " \"" << type->color << "\"";
@@ -260,18 +256,16 @@ if (instr_fmt_type == instr_fmt_paje) {
 }
 
 
-void DefineStateTypeEvent(type_t type)
+void LogStateTypeDefinition(type_t type)
 {
-  e_event_type event_type                        = PAJE_DefineStateType;
-  double timestamp                         = 0;
 
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineStateType);
 
   //print it
 if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineStateType, TRACE_precision(), 0.);
     stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)event_type;
+    stream << PAJE_DefineStateType;
     stream << " " << type->id << " " << type->father->id << " " << type->name;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
@@ -309,18 +303,14 @@ void DefineEventTypeEvent::print() {
   }
 }
 
-void DefineLinkTypeEvent(type_t type, type_t source, type_t dest)
+void LogLinkTypeDefinition(type_t type, type_t source, type_t dest)
 {
-  e_event_type event_type                         = PAJE_DefineLinkType;
-  double timestamp                          = 0;
-
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type);
-
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineLinkType);
   //print it
 if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineLinkType, TRACE_precision(), 0.);
     stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)event_type;
+    stream << PAJE_DefineLinkType;
     stream << " " << type->id << " " << type->father->id << " " << source->id << " " << dest->id << " " << type->name;
     print_row();
   } else if (instr_fmt_type == instr_fmt_TI) {
@@ -330,18 +320,14 @@ if (instr_fmt_type == instr_fmt_paje) {
   }
 }
 
-void DefineEntityValueEvent (val_t value)
+void LogEntityValue (val_t value)
 {
-  e_event_type event_type                           = PAJE_DefineEntityValue;
-  double timestamp                            = 0;
-
-  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type);
-
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue);
   //print it
 if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineEntityValue, TRACE_precision(),0.);
     stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)event_type;
+    stream << PAJE_DefineEntityValue;
     stream << " " << value->id << " " << value->father->id << " " << value->name;
     if (value->color)
       stream << " \"" << value->color << "\"";
@@ -354,17 +340,16 @@ if (instr_fmt_type == instr_fmt_paje) {
 }
 
 
-void CreateContainerEvent (container_t container)
+void LogContainerCreation (container_t container)
 {
-  e_event_type event_type                             = PAJE_CreateContainer;
   double timestamp                              = SIMIX_get_clock();
 
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type,timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, PAJE_CreateContainer,timestamp);
 
 if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_CreateContainer, TRACE_precision(), timestamp);
     stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)event_type;
+    stream << PAJE_CreateContainer;
     stream << " ";
   /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
      if (timestamp < 1e-12)
@@ -407,17 +392,16 @@ if (instr_fmt_type == instr_fmt_paje) {
   }
 }
 
-void DestroyContainerEvent (container_t container)
+void LogContainerDestruction(container_t container)
 {
-  e_event_type event_type                              = PAJE_DestroyContainer;
   double timestamp                               = SIMIX_get_clock();
 
-  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, PAJE_DestroyContainer, timestamp);
 
 if (instr_fmt_type == instr_fmt_paje) {
-    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
+    XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DestroyContainer, TRACE_precision(), timestamp);
     stream << std::fixed << std::setprecision(TRACE_precision());
-    stream << (int)event_type;
+    stream << PAJE_DestroyContainer;
     stream << " ";
   /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
     if (timestamp < 1e-12)
index 461f96b..56fa62b 100644 (file)
@@ -162,7 +162,7 @@ type_t PJ_type_variable_new (const char *name, const char *color, type_t father)
     ret = newType (name, name, color, TYPE_VARIABLE, father);
   }
   XBT_DEBUG("VariableType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
-  DefineVariableTypeEvent (ret);
+  LogVariableTypeDefinition (ret);
   return ret;
 }
 
@@ -179,7 +179,7 @@ type_t PJ_type_link_new (const char *name, type_t father, type_t source, type_t
   ret = newType (name, key, nullptr, TYPE_LINK, father);
   XBT_DEBUG("LinkType %s(%s), child of %s(%s)  %s(%s)->%s(%s)", ret->name, ret->id, father->name, father->id,
             source->name, source->id, dest->name, dest->id);
-  DefineLinkTypeEvent(ret, source, dest);
+  LogLinkTypeDefinition(ret, source, dest);
   return ret;
 }
 
@@ -193,6 +193,6 @@ type_t PJ_type_state_new (const char *name, type_t father)
 
   ret = newType (name, name, nullptr, TYPE_STATE, father);
   XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
-  DefineStateTypeEvent(ret);
+  LogStateTypeDefinition(ret);
   return ret;
 }
index f07a640..7c0505f 100644 (file)
@@ -27,7 +27,7 @@ val_t PJ_value_new (const char *name, const char *color, type_t father)
 
   xbt_dict_set (father->values, name, ret, nullptr);
   XBT_DEBUG("new value %s, child of %s", ret->name, ret->father->name);
-  DefineEntityValueEvent(ret);
+  LogEntityValue(ret);
   return ret;
 }
 
index 9b3d7a8..78e8aec 100644 (file)
@@ -421,11 +421,11 @@ extern instr_fmt_type_t instr_fmt_type;
 SG_END_DECL()
 
 void DefineContainerEvent(type_t type);
-void DefineVariableTypeEvent(type_t type);
-void DefineStateTypeEvent(type_t type);
-void DefineLinkTypeEvent(type_t type, type_t source, type_t dest);
-void DefineEntityValueEvent (val_t value);
-void CreateContainerEvent (container_t container);
-void DestroyContainerEvent (container_t container);
+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 LogContainerCreation (container_t container);
+void LogContainerDestruction (container_t container);
 
 #endif