Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
normalize s_type class part 3
authorTakishipp <toufik.boubehziz@gmail.com>
Fri, 18 Aug 2017 15:11:46 +0000 (17:11 +0200)
committerTakishipp <toufik.boubehziz@gmail.com>
Fri, 18 Aug 2017 15:11:46 +0000 (17:11 +0200)
14 files changed:
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
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_resource_utilization.cpp
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
src/surf/instr_surf.cpp

index 9a14d50..3e46cf0 100644 (file)
@@ -63,7 +63,7 @@ static int trace_precision;
 static bool trace_configured = false;
 static bool trace_active     = false;
 
-static type_t rootType = nullptr;        /* the root type */
+static Type* rootType = nullptr;        /* the root type */
 
 instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
 
index b75c053..baa43b3 100644 (file)
@@ -183,7 +183,7 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar
   if (not mark_value)
     THROWF (tracing_error, 1, "mark_value is nullptr");
 
-  type_t type = PJ_type_get (mark_type, PJ_type_get_root());
+  Type* type = PJ_type_get (mark_type, PJ_type_get_root());
   if (not type) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   }
@@ -239,7 +239,7 @@ void TRACE_mark(const char *mark_type, const char *mark_value)
     THROWF (tracing_error, 1, "mark_value is nullptr");
 
   //check if mark_type is already declared
-  type_t type = PJ_type_get (mark_type, PJ_type_get_root());
+  Type* type = PJ_type_get (mark_type, PJ_type_get_root());
   if (not type) {
     THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
   }
@@ -282,7 +282,7 @@ static void instr_user_variable(double time, const char* resource, const char* v
       char valuestr[100];
       snprintf(valuestr, 100, "%g", value);
       container_t container = PJ_container_get(resource);
-      type_t type = PJ_type_get (variable, container->type);
+      Type* type = PJ_type_get (variable, container->type);
       switch (what){
       case INSTR_US_SET:
         new SetVariableEvent(time, container, type, value);
@@ -945,7 +945,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);
-  type_t type = PJ_type_get (state, container->type);
+  Type* type = PJ_type_get (state, container->type);
   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);
@@ -965,7 +965,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);
-  type_t type = PJ_type_get (state, container->type);
+  Type* type = PJ_type_get (state, container->type);
   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);
@@ -984,7 +984,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);
-  type_t type = PJ_type_get (state, container->type);
+  Type* type = PJ_type_get (state, container->type);
   new PopStateEvent(MSG_get_clock(), container, type);
 }
 
index d92944f..7bae0bb 100644 (file)
@@ -124,7 +124,7 @@ container_t PJ_container_new (const char *name, e_container_types kind, containe
         THROWF (tracing_error, 0, "new container kind is unknown.");
         break;
     }
-    type_t type = Type::getOrNull (typeNameBuff, newContainer->father->type);
+    Type* type = Type::getOrNull (typeNameBuff, newContainer->father->type);
     if (type == nullptr){
       newContainer->type = Type::containerNew (typeNameBuff, newContainer->father->type);
     }else{
index cd2a3ce..13a4828 100644 (file)
@@ -267,7 +267,7 @@ void LogDefineEventType(type_t type)
   }
 }
 
-void LogLinkTypeDefinition(type_t type, type_t source, type_t dest)
+void LogLinkTypeDefinition(type_t type, Type* source, Type* dest)
 {
   XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineLinkType);
   //print it
@@ -383,7 +383,7 @@ if (instr_fmt_type == instr_fmt_paje) {
 }
 
 
-SetVariableEvent::SetVariableEvent (double timestamp, container_t container, type_t type, double value)
+SetVariableEvent::SetVariableEvent (double timestamp, container_t container, Type* type, double value)
 {
   this->event_type                         = PAJE_SetVariable;
   this->timestamp                          = timestamp;
@@ -411,7 +411,7 @@ void SetVariableEvent::print() {
   }
 }
 
-AddVariableEvent::AddVariableEvent (double timestamp, container_t container, type_t type, double value)
+AddVariableEvent::AddVariableEvent (double timestamp, container_t container, Type* type, double value)
 {
   this->event_type                         = PAJE_AddVariable;
   this->timestamp                          = timestamp;
@@ -439,7 +439,7 @@ void AddVariableEvent::print() {
   }
 }
 
-SubVariableEvent::SubVariableEvent (double timestamp, container_t container, type_t type, double value)
+SubVariableEvent::SubVariableEvent (double timestamp, container_t container, Type* type, double value)
 {
   this->event_type                         = PAJE_SubVariable;
   this->timestamp                          = timestamp;
@@ -467,7 +467,7 @@ void SubVariableEvent::print() {
   }
 }
 
-SetStateEvent::SetStateEvent(double timestamp, container_t container, type_t type, value* val)
+SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, value* val)
 {
   this->event_type                      = PAJE_SetState;
   this->timestamp                       = timestamp;
@@ -509,7 +509,7 @@ void SetStateEvent::print() {
   }
 }
 
-PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra)
+PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, value* val, void* extra)
 {
   this->event_type                  = PAJE_PushState;
   this->timestamp                   = timestamp;
@@ -531,7 +531,7 @@ PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t t
   insert_into_buffer (this);
 }
 
-PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val)
+PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, value* val)
     : PushStateEvent(timestamp, container, type, val, nullptr)
 {}
 void PushStateEvent::print() {
@@ -699,7 +699,7 @@ void PushStateEvent::print() {
 }
 
 
-PopStateEvent::PopStateEvent (double timestamp, container_t container, type_t type)
+PopStateEvent::PopStateEvent (double timestamp, container_t container, Type* type)
 {
   this->event_type                      = PAJE_PopState;
   this->timestamp                       = timestamp;
@@ -726,7 +726,7 @@ void PopStateEvent::print() {
   }
 }
 
-ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_t type)
+ResetStateEvent::ResetStateEvent (double timestamp, container_t container, Type* type)
 {
   this->event_type                        = PAJE_ResetState;
   this->timestamp                         = timestamp;
@@ -760,11 +760,11 @@ StartLinkEvent::~StartLinkEvent()
   free(key);
 }
 StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
-    type_t type, container_t sourceContainer, const char *value, const char *key)
+    Type* type, container_t sourceContainer, const char *value, const char *key)
   : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
 {}
 
-StartLinkEvent::StartLinkEvent (double timestamp, container_t container, type_t type, container_t sourceContainer,
+StartLinkEvent::StartLinkEvent (double timestamp, container_t container, Type* type, container_t sourceContainer,
                                 const char *value, const char *key, int size)
 {
   event_type                             = PAJE_StartLink;
@@ -802,7 +802,7 @@ void StartLinkEvent::print() {
   }
 }
 
-EndLinkEvent::EndLinkEvent (double timestamp, container_t container, type_t type, container_t destContainer,
+EndLinkEvent::EndLinkEvent (double timestamp, container_t container, Type* type, container_t destContainer,
                       const char *value, const char *key)
 {
   this->event_type                         = PAJE_EndLink;
@@ -839,7 +839,7 @@ void EndLinkEvent::print() {
   }
 }
 
-NewEvent::NewEvent(double timestamp, container_t container, type_t type, value* val)
+NewEvent::NewEvent(double timestamp, container_t container, Type* type, value* val)
 {
   this->event_type                      = PAJE_NewEvent;
   this->timestamp                       = timestamp;
index aa29a39..3bf1061 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)");
 
-static type_t rootType = nullptr;        /* the root type */
+static Type* rootType = nullptr;        /* the root type */
 
 void PJ_type_release ()
 {
@@ -20,7 +20,7 @@ type_t PJ_type_get_root ()
   return rootType;
 }
 
-Type::Type (const char *typeNameBuff, const char *key, const char *color, e_entity_types kind, type_t father)
+Type::Type (const char *typeNameBuff, const char *key, const char *color, e_entity_types kind, Type* father)
 {
   if (typeNameBuff == nullptr || key == nullptr){
     THROWF(tracing_error, 0, "can't create a new type with name or key equal nullptr");
@@ -65,7 +65,7 @@ void recursiveDestroyType (type_t type)
 {
   XBT_DEBUG("recursiveDestroyType %s", type->name);
   xbt_dict_cursor_t cursor = nullptr;
-  type_t child;
+  Type* child;
   char *child_name;
   xbt_dict_foreach(type->children, cursor, child_name, child) {
     recursiveDestroyType (child);
@@ -73,23 +73,23 @@ void recursiveDestroyType (type_t type)
   PJ_type_free(type);
 }
 
-type_t PJ_type_get (const char *name, type_t father)
+type_t PJ_type_get (const char *name, Type* father)
 {
-  type_t ret = Type::getOrNull (name, father);
+  Type* ret = Type::getOrNull (name, father);
   if (ret == nullptr){
     THROWF (tracing_error, 2, "type with name (%s) not found in father type (%s)", name, father->name);
   }
   return ret;
 }
 
-type_t Type::getOrNull (const char *name, type_t father)
+type_t Type::getOrNull (const char *name, Type* father)
 {
   if (name == nullptr || father == nullptr){
     THROWF (tracing_error, 0, "can't get type with a nullptr name or from a nullptr father");
   }
 
-  type_t ret = nullptr;
-  type_t child;
+  Type* ret = nullptr;
+  Type* child;
   char *child_name;
   xbt_dict_cursor_t cursor = nullptr;
   xbt_dict_foreach(father->children, cursor, child_name, child) {
@@ -104,13 +104,13 @@ type_t Type::getOrNull (const char *name, type_t father)
   return ret;
 }
 
-type_t Type::containerNew (const char *name, type_t father)
+type_t Type::containerNew (const char *name, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a container type with a nullptr name");
   }
 
-  type_t ret = new Type (name, name, nullptr, TYPE_CONTAINER, father);
+  Type* ret = new Type (name, name, nullptr, TYPE_CONTAINER, father);
   if (father == nullptr) {
     rootType = ret;
   } else {
@@ -120,25 +120,25 @@ type_t Type::containerNew (const char *name, type_t father)
   return ret;
 }
 
-type_t Type::eventNew (const char *name, type_t father)
+type_t Type::eventNew (const char *name, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create an event type with a nullptr name");
   }
 
-  type_t ret = new Type (name, name, nullptr, TYPE_EVENT, father);
+  Type* ret = new Type (name, name, nullptr, TYPE_EVENT, father);
   XBT_DEBUG("EventType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
   LogDefineEventType(ret);
   return ret;
 }
 
-type_t Type::variableNew (const char *name, const char *color, type_t father)
+type_t Type::variableNew (const char *name, const char *color, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a variable type with a nullptr name");
   }
 
-  type_t ret = nullptr;
+  Type* ret = nullptr;
 
   if (not color) {
     char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
@@ -151,13 +151,13 @@ type_t Type::variableNew (const char *name, const char *color, type_t father)
   return ret;
 }
 
-type_t Type::linkNew (const char *name, type_t father, type_t source, type_t dest)
+type_t Type::linkNew (const char *name, Type* father, Type* source, Type* dest)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a link type with a nullptr name");
   }
 
-  type_t ret = nullptr;
+  Type* ret = nullptr;
 
   char key[INSTR_DEFAULT_STR_SIZE];
   snprintf (key, INSTR_DEFAULT_STR_SIZE, "%s-%s-%s", name, source->id, dest->id);
@@ -168,13 +168,13 @@ type_t Type::linkNew (const char *name, type_t father, type_t source, type_t des
   return ret;
 }
 
-type_t Type::stateNew (const char *name, type_t father)
+type_t Type::stateNew (const char *name, Type* father)
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a state type with a nullptr name");
   }
 
-  type_t ret = nullptr;
+  Type* ret = nullptr;
 
   ret = new Type (name, name, nullptr, TYPE_STATE, father);
   XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
index 84152ec..5372bf2 100644 (file)
@@ -10,7 +10,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
 
-value::value(const char* name, const char* color, type_t father)
+value::value(const char* name, const char* color, Type* father)
 {
   if (name == nullptr || father == nullptr){
     THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)");
@@ -38,7 +38,7 @@ value::~value()
   */
 }
 
-value* 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* father)
 {
   value* ret = 0;
   try {
@@ -51,7 +51,7 @@ value* value::get_or_new(const char* name, const char* color, type_t father)
   return ret;
 }
 
-value* value::get(const char* name, type_t father)
+value* value::get(const char* name, Type* father)
 {
   if (name == nullptr || father == nullptr){
     THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)");
index 7606f22..0bc2972 100644 (file)
@@ -28,13 +28,13 @@ 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);
-    type_t type = PJ_type_get (variable, container->type);
+    Type* type = PJ_type_get (variable, container->type);
     new SetVariableEvent (now, container, type, 0);
     platform_variables[key] = std::string("");
   }
 }
 
-static void instr_event (double now, double delta, type_t variable, container_t resource, double value)
+static void instr_event (double now, double delta, Type* variable, container_t resource, double value)
 {
   __TRACE_surf_check_variable_set_to_zero(now, variable->name, resource->name);
   new AddVariableEvent(now, resource, variable, value);
@@ -54,7 +54,7 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
   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);
-    type_t type = PJ_type_get ("bandwidth_used", container->type);
+    Type* type = PJ_type_get ("bandwidth_used", container->type);
     instr_event (now, delta, type, container, value);
   }
 
@@ -67,7 +67,7 @@ void TRACE_surf_link_set_utilization(const char *resource, const char *category,
     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);
-    type_t type = PJ_type_get (category_type, container->type);
+    Type* type = PJ_type_get (category_type, container->type);
     instr_event (now, delta, type, container, value);
   }
 }
@@ -83,7 +83,7 @@ void TRACE_surf_host_set_utilization(const char *resource, const char *category,
   //trace uncategorized host utilization
   if (TRACE_uncategorized()){
     XBT_DEBUG("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, resource, value);
-    type_t type = PJ_type_get ("power_used", container->type);
+    Type* type = PJ_type_get ("power_used", container->type);
     instr_event (now, delta, type, container, value);
   }
 
@@ -95,7 +95,7 @@ void TRACE_surf_host_set_utilization(const char *resource, const char *category,
     char category_type[INSTR_DEFAULT_STR_SIZE];
     snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "p%s", category);
     XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
-    type_t type = PJ_type_get (category_type, container->type);
+    Type* type = PJ_type_get (category_type, container->type);
     instr_event (now, delta, type, container, value);
   }
 }
index 3ce2884..11bbb18 100644 (file)
@@ -37,7 +37,7 @@ void TRACE_msg_process_change_host(msg_process_t process, msg_host_t new_host)
 
     //start link
     container_t msg = PJ_container_get (instr_process_id(process, str, len));
-    type_t type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
+    Type* type = PJ_type_get ("MSG_PROCESS_LINK", PJ_type_get_root());
     new StartLinkEvent (MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
     //destroy existing container of this process
@@ -93,7 +93,7 @@ void TRACE_msg_process_suspend(msg_process_t process)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     value* val                    = value::get("suspend", type);
     new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
@@ -106,7 +106,7 @@ void TRACE_msg_process_resume(msg_process_t process)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     new PopStateEvent (MSG_get_clock(), process_container, type);
   }
 }
@@ -118,7 +118,7 @@ void TRACE_msg_process_sleep_in(msg_process_t process)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     value* val                    = value::get("sleep", type);
     new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
@@ -131,7 +131,7 @@ void TRACE_msg_process_sleep_out(msg_process_t process)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     new PopStateEvent (MSG_get_clock(), process_container, type);
   }
 }
index 1ac51f1..cfd1d38 100644 (file)
@@ -53,7 +53,7 @@ void TRACE_msg_task_execute_start(msg_task_t task)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     value* val                    = value::get("task_execute", type);
     new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
@@ -68,7 +68,7 @@ void TRACE_msg_task_execute_end(msg_task_t task)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     new PopStateEvent (MSG_get_clock(), process_container, type);
   }
 }
@@ -93,7 +93,7 @@ void TRACE_msg_task_get_start()
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     value* val                    = value::get("receive", type);
     new PushStateEvent(MSG_get_clock(), process_container, type, val);
   }
@@ -108,7 +108,7 @@ void TRACE_msg_task_get_end(double start_time, msg_task_t task)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     new PopStateEvent (MSG_get_clock(), process_container, type);
 
     char key[INSTR_DEFAULT_STR_SIZE];
@@ -128,7 +128,7 @@ int TRACE_msg_task_put_start(msg_task_t task)
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     value* val                    = value::get("send", type);
     new PushStateEvent(MSG_get_clock(), process_container, type, val);
 
@@ -150,7 +150,7 @@ void TRACE_msg_task_put_end()
     char str[INSTR_DEFAULT_STR_SIZE];
 
     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);
+    Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type);
     new PopStateEvent (MSG_get_clock(), process_container, type);
   }
 }
index 1b3829c..da329f3 100644 (file)
@@ -187,7 +187,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());
-    type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
+    Type* type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
     value* val               = value::get_or_new("start", "0 0 1", type); // start is blue
     new PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
@@ -296,7 +296,7 @@ static int migration_rx_fun(int argc, char *argv[])
 
     // start link
     container_t msg = PJ_container_get(vm->getCname());
-    type_t type     = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
+    Type* type     = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
     new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
 
     // destroy existing container of this vm
@@ -774,7 +774,7 @@ 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);
+    Type* type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
     value* val               = value::get_or_new("suspend", "1 0 0", type); // suspend is red
     new PushStateEvent(MSG_get_clock(), vm_container, type, val);
   }
@@ -791,7 +791,7 @@ void MSG_vm_resume(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);
+    Type* type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
     new PopStateEvent(MSG_get_clock(), vm_container, type);
   }
 }
index e4ed65a..2530f40 100644 (file)
@@ -16,7 +16,7 @@
 
 #define TRACE_AUTO_COLL(cat)                                                                                           \
   if (TRACE_is_enabled()) {                                                                                            \
-    type_t type = Type::getOrNull(#cat, PJ_type_get_root());                                                       \
+    Type* type = Type::getOrNull(#cat, PJ_type_get_root());                                                       \
     if (not type) {                                                                                                    \
       type = Type::eventNew(#cat, PJ_type_get_root());                                                              \
     }                                                                                                                  \
index 52133eb..522a228 100644 (file)
@@ -236,7 +236,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
   value* val            = value::get_or_new(operation, color, type);
   new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
@@ -250,7 +250,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
 
   new PopStateEvent (SIMIX_get_clock(), container, type);
 }
@@ -264,7 +264,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);
type_t type           = PJ_type_get("MPI_STATE", container->type);
Type* type           = PJ_type_get("MPI_STATE", container->type);
  const char* color     = instr_find_color("computing");
  new PushStateEvent(SIMIX_get_clock(), container, type, value::get_or_new("computing", color, type));
 }
@@ -280,7 +280,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   value* val            = value::get_or_new("computing", nullptr, type);
   new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
@@ -292,7 +292,7 @@ void TRACE_smpi_computing_out(int rank)
   char str[INSTR_DEFAULT_STR_SIZE];
   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);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   new PopStateEvent (SIMIX_get_clock(), container, type);
 }
 
@@ -305,7 +305,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color ("sleeping");
   value* val            = value::get_or_new("sleeping", color, type);
   new PushStateEvent(SIMIX_get_clock(), container, type, val);
@@ -322,7 +322,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   value* val            = value::get_or_new("sleeping", nullptr, type);
   new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
@@ -334,7 +334,7 @@ void TRACE_smpi_sleeping_out(int rank)
   char str[INSTR_DEFAULT_STR_SIZE];
   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);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   new PopStateEvent (SIMIX_get_clock(), container, type);
 }
 
@@ -349,7 +349,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   value* val            = value::get_or_new("test", nullptr, type);
   new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
 }
@@ -361,7 +361,7 @@ void TRACE_smpi_testing_out(int rank)
   char str[INSTR_DEFAULT_STR_SIZE];
   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);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   new PopStateEvent (SIMIX_get_clock(), container, type);
 }
 
@@ -375,7 +375,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
   const char *color = instr_find_color (operation);
   value* val            = value::get_or_new(operation, color, type);
   new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
@@ -389,7 +389,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);
-  type_t type = PJ_type_get ("MPI_STATE", container->type);
+  Type* type = PJ_type_get ("MPI_STATE", container->type);
 
   new PopStateEvent (SIMIX_get_clock(), container, type);
 }
@@ -405,7 +405,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);
-  type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
+  Type* type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
   XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
   new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
 }
@@ -421,7 +421,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);
-  type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
+  Type* type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
   XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
   new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
 }
index 185bb86..6fe981c 100644 (file)
@@ -105,7 +105,7 @@ static void linkContainers (container_t src, container_t dst, xbt_dict_t filter)
             father->type->name,
             src->type->name, src->type->id,
             dst->type->name, dst->type->id);
-  type_t link_type = Type::getOrNull (link_typename, father->type);
+  Type* link_type = Type::getOrNull (link_typename, father->type);
   if (link_type == nullptr){
     link_type = Type::linkNew (link_typename, father->type, src->type, dst->type);
   }
@@ -173,7 +173,7 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
     PJ_container_set_root (root);
 
     if (TRACE_smpi_is_enabled()) {
-      type_t mpi = Type::getOrNull ("MPI", root->type);
+      Type* mpi = Type::getOrNull ("MPI", root->type);
       if (mpi == nullptr){
         mpi = Type::containerNew("MPI", root->type);
         if (not TRACE_smpi_is_grouped())
@@ -214,11 +214,11 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link)
   container_t container = PJ_container_new(link.name(), INSTR_LINK, father);
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
-    type_t bandwidth = Type::getOrNull("bandwidth", container->type);
+    Type* bandwidth = Type::getOrNull("bandwidth", container->type);
     if (bandwidth == nullptr) {
       bandwidth = Type::variableNew("bandwidth", nullptr, container->type);
     }
-    type_t latency = Type::getOrNull("latency", container->type);
+    Type* latency = Type::getOrNull("latency", container->type);
     if (latency == nullptr) {
       latency = Type::variableNew("latency", nullptr, container->type);
     }
@@ -226,7 +226,7 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link)
     new SetVariableEvent(0, container, latency, latency_value);
   }
   if (TRACE_uncategorized()) {
-    type_t bandwidth_used = Type::getOrNull("bandwidth_used", container->type);
+    Type* bandwidth_used = Type::getOrNull("bandwidth_used", container->type);
     if (bandwidth_used == nullptr) {
       Type::variableNew("bandwidth_used", "0.5 0.5 0.5", container->type);
     }
@@ -239,7 +239,7 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
   container_t container = PJ_container_new(host.getCname(), INSTR_HOST, father);
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
-    type_t speed = Type::getOrNull ("power", container->type);
+    Type* speed = Type::getOrNull ("power", container->type);
     if (speed == nullptr){
       speed = Type::variableNew ("power", nullptr, container->type);
     }
@@ -248,14 +248,14 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
     new SetVariableEvent (0, container, speed, current_speed_state);
   }
   if (TRACE_uncategorized()){
-    type_t speed_used = Type::getOrNull ("power_used", container->type);
+    Type* speed_used = Type::getOrNull ("power_used", container->type);
     if (speed_used == nullptr){
       Type::variableNew ("power_used", "0.5 0.5 0.5", container->type);
     }
   }
 
   if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
-    type_t mpi = Type::getOrNull ("MPI", container->type);
+    Type* mpi = Type::getOrNull ("MPI", container->type);
     if (mpi == nullptr){
       mpi = Type::containerNew("MPI", container->type);
       Type::stateNew ("MPI_STATE", mpi);
@@ -263,10 +263,10 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
   }
 
   if (TRACE_msg_process_is_enabled()) {
-    type_t msg_process = Type::getOrNull ("MSG_PROCESS", container->type);
+    Type* msg_process = Type::getOrNull ("MSG_PROCESS", container->type);
     if (msg_process == nullptr){
       msg_process = Type::containerNew("MSG_PROCESS", container->type);
-      type_t state = Type::stateNew ("MSG_PROCESS_STATE", msg_process);
+      Type* state = Type::stateNew ("MSG_PROCESS_STATE", msg_process);
       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);
@@ -278,10 +278,10 @@ static void sg_instr_new_host(simgrid::s4u::Host& host)
   }
 
   if (TRACE_msg_vm_is_enabled()) {
-    type_t msg_vm = Type::getOrNull ("MSG_VM", container->type);
+    Type* msg_vm = Type::getOrNull ("MSG_VM", container->type);
     if (msg_vm == nullptr){
       msg_vm = Type::containerNew("MSG_VM", container->type);
-      type_t state = Type::stateNew ("MSG_VM_STATE", msg_vm);
+      Type* state = Type::stateNew ("MSG_VM_STATE", msg_vm);
       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);
@@ -334,7 +334,7 @@ void instr_routing_define_callbacks ()
 /*
  * user categories support
  */
-static void recursiveNewVariableType (const char *new_typename, const char *color, type_t root)
+static void recursiveNewVariableType (const char *new_typename, const char *color, Type* root)
 {
   if (not strcmp(root->name, "HOST")) {
     char tnstr[INSTR_DEFAULT_STR_SIZE];
@@ -352,7 +352,7 @@ static void recursiveNewVariableType (const char *new_typename, const char *colo
     Type::variableNew (tnstr, color, root);
   }
   xbt_dict_cursor_t cursor = nullptr;
-  type_t child_type;
+  Type* child_type;
   char *name;
   xbt_dict_foreach(root->children, cursor, name, child_type) {
     recursiveNewVariableType (new_typename, color, child_type);
@@ -364,13 +364,13 @@ void instr_new_variable_type (const char *new_typename, const char *color)
   recursiveNewVariableType (new_typename, color, PJ_type_get_root());
 }
 
-static void recursiveNewUserVariableType (const char *father_type, const char *new_typename, const char *color, type_t root)
+static void recursiveNewUserVariableType (const char *father_type, const char *new_typename, const char *color, Type* root)
 {
   if (not strcmp(root->name, father_type)) {
     Type::variableNew (new_typename, color, root);
   }
   xbt_dict_cursor_t cursor = nullptr;
-  type_t child_type;
+  Type* child_type;
   char *name;
   xbt_dict_foreach(root->children, cursor, name, child_type) {
     recursiveNewUserVariableType (father_type, new_typename, color, child_type);
@@ -382,13 +382,13 @@ void instr_new_user_variable_type  (const char *father_type, const char *new_typ
   recursiveNewUserVariableType (father_type, new_typename, color, PJ_type_get_root());
 }
 
-static void recursiveNewUserStateType (const char *father_type, const char *new_typename, type_t root)
+static void recursiveNewUserStateType (const char *father_type, const char *new_typename, Type* root)
 {
   if (not strcmp(root->name, father_type)) {
     Type::stateNew (new_typename, root);
   }
   xbt_dict_cursor_t cursor = nullptr;
-  type_t child_type;
+  Type* child_type;
   char *name;
   xbt_dict_foreach(root->children, cursor, name, child_type) {
     recursiveNewUserStateType (father_type, new_typename, child_type);
@@ -400,13 +400,13 @@ void instr_new_user_state_type (const char *father_type, const char *new_typenam
   recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root());
 }
 
-static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, type_t root)
+static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, Type* root)
 {
   if (not strcmp(root->name, type_name)) {
     value PJ_value(val, color, root);
   }
   xbt_dict_cursor_t cursor = nullptr;
-  type_t child_type;
+  Type* child_type;
   char *name;
   xbt_dict_foreach(root->children, cursor, name, child_type) {
     recursiveNewValueForUserStateType(type_name, val, color, child_type);
index 4d45aa1..69d8a98 100644 (file)
@@ -13,7 +13,7 @@ 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);
-    type_t type = PJ_type_get ("power", container->type);
+    Type* type = PJ_type_get ("power", container->type);
     new SetVariableEvent(date, container, type, speed);
   }
 }
@@ -22,7 +22,7 @@ void TRACE_surf_link_set_bandwidth(double date, const char *resource, double ban
 {
   if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
     container_t container = PJ_container_get(resource);
-    type_t type = PJ_type_get ("bandwidth", container->type);
+    Type* type = PJ_type_get ("bandwidth", container->type);
     new SetVariableEvent(date, container, type, bandwidth);
   }
 }