Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the code so that it compiles in supernovae mode
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 20 Nov 2009 09:47:53 +0000 (09:47 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 20 Nov 2009 09:47:53 +0000 (09:47 +0000)
 - _simgrid_log_channel__default is then a macro defined in
   mk_supernovae.sh instead of a global static to the compilation unit
 - lots and lots of static symbol renaming (prefixing) to avoid name
   clashes. I love eclipse refactoring functions

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6844 48e7efb5-ca39-0410-a469-dd3cf9ba447f

13 files changed:
include/xbt/log.h
include/xbt/misc.h
src/gras/DataDesc/cbps.c
src/surf/cpu.c
src/surf/cpu_im.c
src/surf/cpu_ti.c
src/surf/network.c
src/surf/network_constant.c
src/surf/workstation.c
src/surf/workstation_ptask_L07.c
src/xbt/xbt_log_appender_file.c
src/xbt/xbt_log_layout_format.c
src/xbt/xbt_log_layout_simple.c

index cd31e12..9cdd785 100644 (file)
@@ -168,7 +168,7 @@ SG_BEGIN_DECL()
  * Indicates which category is the default one.
  */
 
  * Indicates which category is the default one.
  */
 
-#if defined(XBT_LOG_MAYDAY)     /*|| defined (NLOG) * turning logging off */
+#if defined(XBT_LOG_MAYDAY) || defined(SUPERNOVAE_MODE)     /*|| defined (NLOG) * turning logging off */
 # define XBT_LOG_DEFAULT_CATEGORY(cname)
 #else
 # define XBT_LOG_DEFAULT_CATEGORY(cname) \
 # define XBT_LOG_DEFAULT_CATEGORY(cname)
 #else
 # define XBT_LOG_DEFAULT_CATEGORY(cname) \
index 42173ad..8b408b5 100644 (file)
 #  define _XBT_CALL
 #endif
 
 #  define _XBT_CALL
 #endif
 
+/* Support for SuperNovae compilation mode, where we stuff every source file
+ *  into the same compilation unit to help GCC inlining what should be.
+ * To go further on this, the internal getters/setters are then marked
+ *  "static inline", while they are regular symbols otherwise.
+ */
+#ifdef SUPERNOVAE_MODE
+# define SUPERNOVAE_INLINE static inline
+#else
+# define SUPERNOVAE_INLINE
+#endif
+
 /* Handle import/export stuff
  * 
  * Rational of XBT_PUBLIC: 
 /* Handle import/export stuff
  * 
  * Rational of XBT_PUBLIC: 
index add6192..fdea5eb 100644 (file)
@@ -123,7 +123,7 @@ void
 gras_cbps_v_pop(gras_cbps_t ps,
                 const char *name, gras_datadesc_type_t * ddt, void **res)
 {
 gras_cbps_v_pop(gras_cbps_t ps,
                 const char *name, gras_datadesc_type_t * ddt, void **res)
 {
-  xbt_dynar_t varstack, frame;
+  xbt_dynar_t varstack=NULL, frame=NULL;
   gras_cbps_elm_t var = NULL;
   void *data = NULL;
   xbt_ex_t e;
   gras_cbps_elm_t var = NULL;
   void *data = NULL;
   xbt_ex_t e;
index 6a9f6e5..d37afd5 100644 (file)
@@ -29,7 +29,7 @@ surf_model_t surf_cpu_model = NULL;
 lmm_system_t cpu_maxmin_system = NULL;
 
 
 lmm_system_t cpu_maxmin_system = NULL;
 
 
-static xbt_swag_t running_action_set_that_does_not_need_being_checked = NULL;
+static xbt_swag_t cpu_running_action_set_that_does_not_need_being_checked = NULL;
 
 static cpu_Cas01_t cpu_new(char *name, double power_peak,
                            double power_scale,
 
 static cpu_Cas01_t cpu_new(char *name, double power_peak,
                            double power_scale,
@@ -128,20 +128,20 @@ static void add_traces_cpu(void)
   }
 }
 
   }
 }
 
-static void define_callbacks(const char *file)
+static void cpu_define_callbacks(const char *file)
 {
   surf_parse_reset_parser();
   surfxml_add_callback(STag_surfxml_host_cb_list, parse_cpu_init);
   surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces_cpu);
 }
 
 {
   surf_parse_reset_parser();
   surfxml_add_callback(STag_surfxml_host_cb_list, parse_cpu_init);
   surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces_cpu);
 }
 
-static int resource_used(void *resource_id)
+static int cpu_resource_used(void *resource_id)
 {
   return lmm_constraint_used(cpu_maxmin_system,
                              ((cpu_Cas01_t) resource_id)->constraint);
 }
 
 {
   return lmm_constraint_used(cpu_maxmin_system,
                              ((cpu_Cas01_t) resource_id)->constraint);
 }
 
-static int action_unref(surf_action_t action)
+static int cpu_action_unref(surf_action_t action)
 {
   action->refcount--;
   if (!action->refcount) {
 {
   action->refcount--;
   if (!action->refcount) {
@@ -155,7 +155,7 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
   return 0;
 }
 
-static void action_cancel(surf_action_t action)
+static void cpu_action_cancel(surf_action_t action)
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
   return;
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
   return;
@@ -174,7 +174,7 @@ static void cpu_action_state_set(surf_action_t action,
   return;
 }
 
   return;
 }
 
-static double share_resources(double now)
+static double cpu_share_resources(double now)
 {
   s_surf_action_cpu_Cas01_t action;
   return generic_maxmin_share_resources(surf_cpu_model->
 {
   s_surf_action_cpu_Cas01_t action;
   return generic_maxmin_share_resources(surf_cpu_model->
@@ -183,7 +183,7 @@ static double share_resources(double now)
                                         cpu_maxmin_system, lmm_solve);
 }
 
                                         cpu_maxmin_system, lmm_solve);
 }
 
-static void update_actions_state(double now, double delta)
+static void cpu_update_actions_state(double now, double delta)
 {
   surf_action_cpu_Cas01_t action = NULL;
   surf_action_cpu_Cas01_t next_action = NULL;
 {
   surf_action_cpu_Cas01_t action = NULL;
   surf_action_cpu_Cas01_t next_action = NULL;
@@ -208,7 +208,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
   return;
 }
 
-static void update_resource_state(void *id,
+static void cpu_update_resource_state(void *id,
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
@@ -251,7 +251,7 @@ static void update_resource_state(void *id,
   return;
 }
 
   return;
 }
 
-static surf_action_t execute(void *cpu, double size)
+static surf_action_t cpu_execute(void *cpu, double size)
 {
   surf_action_cpu_Cas01_t action = NULL;
   cpu_Cas01_t CPU = cpu;
 {
   surf_action_cpu_Cas01_t action = NULL;
   cpu_Cas01_t CPU = cpu;
@@ -272,7 +272,7 @@ static surf_action_t execute(void *cpu, double size)
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-static surf_action_t action_sleep(void *cpu, double duration)
+static surf_action_t cpu_action_sleep(void *cpu, double duration)
 {
   surf_action_cpu_Cas01_t action = NULL;
 
 {
   surf_action_cpu_Cas01_t action = NULL;
 
@@ -280,7 +280,7 @@ static surf_action_t action_sleep(void *cpu, double duration)
     duration = MAX(duration, MAXMIN_PRECISION);
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
     duration = MAX(duration, MAXMIN_PRECISION);
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
-  action = (surf_action_cpu_Cas01_t) execute(cpu, 1.0);
+  action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   if (duration == NO_MAX_DURATION) {
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   if (duration == NO_MAX_DURATION) {
@@ -288,7 +288,7 @@ static surf_action_t action_sleep(void *cpu, double duration)
        is used to speed up update_resource_state  */
     xbt_swag_remove(action, ((surf_action_t) action)->state_set);
     ((surf_action_t) action)->state_set =
        is used to speed up update_resource_state  */
     xbt_swag_remove(action, ((surf_action_t) action)->state_set);
     ((surf_action_t) action)->state_set =
-      running_action_set_that_does_not_need_being_checked;
+      cpu_running_action_set_that_does_not_need_being_checked;
     xbt_swag_insert(action, ((surf_action_t) action)->state_set);
   }
 
     xbt_swag_insert(action, ((surf_action_t) action)->state_set);
   }
 
@@ -297,7 +297,7 @@ static surf_action_t action_sleep(void *cpu, double duration)
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-static void action_suspend(surf_action_t action)
+static void cpu_action_suspend(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
@@ -309,7 +309,7 @@ static void action_suspend(surf_action_t action)
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static void action_resume(surf_action_t action)
+static void cpu_action_resume(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
@@ -321,19 +321,19 @@ static void action_resume(surf_action_t action)
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static int action_is_suspended(surf_action_t action)
+static int cpu_action_is_suspended(surf_action_t action)
 {
   return (((surf_action_cpu_Cas01_t) action)->suspended == 1);
 }
 
 {
   return (((surf_action_cpu_Cas01_t) action)->suspended == 1);
 }
 
-static void action_set_max_duration(surf_action_t action, double duration)
+static void cpu_action_set_max_duration(surf_action_t action, double duration)
 {
   XBT_IN2("(%p,%g)", action, duration);
   action->max_duration = duration;
   XBT_OUT;
 }
 
 {
   XBT_IN2("(%p,%g)", action, duration);
   action->max_duration = duration;
   XBT_OUT;
 }
 
-static void action_set_priority(surf_action_t action, double priority)
+static void cpu_action_set_priority(surf_action_t action, double priority)
 {
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
 {
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
@@ -344,30 +344,30 @@ static void action_set_priority(surf_action_t action, double priority)
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static double action_get_remains(surf_action_t action)
+static double cpu_action_get_remains(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   return action->remains;
   XBT_OUT;
 }
 
 {
   XBT_IN1("(%p)", action);
   return action->remains;
   XBT_OUT;
 }
 
-static e_surf_resource_state_t get_state(void *cpu)
+static e_surf_resource_state_t cpu_get_state(void *cpu)
 {
   return ((cpu_Cas01_t) cpu)->state_current;
 }
 
 {
   return ((cpu_Cas01_t) cpu)->state_current;
 }
 
-static double get_speed(void *cpu, double load)
+static double cpu_get_speed(void *cpu, double load)
 {
   return load * (((cpu_Cas01_t) cpu)->power_peak);
 }
 
 {
   return load * (((cpu_Cas01_t) cpu)->power_peak);
 }
 
-static double get_available_speed(void *cpu)
+static double cpu_get_available_speed(void *cpu)
 {
   /* number between 0 and 1 */
   return ((cpu_Cas01_t) cpu)->power_scale;
 }
 
 {
   /* number between 0 and 1 */
   return ((cpu_Cas01_t) cpu)->power_scale;
 }
 
-static void finalize(void)
+static void cpu_finalize(void)
 {
   lmm_system_free(cpu_maxmin_system);
   cpu_maxmin_system = NULL;
 {
   lmm_system_free(cpu_maxmin_system);
   cpu_maxmin_system = NULL;
@@ -375,8 +375,8 @@ static void finalize(void)
   surf_model_exit(surf_cpu_model);
   surf_cpu_model = NULL;
 
   surf_model_exit(surf_cpu_model);
   surf_cpu_model = NULL;
 
-  xbt_swag_free(running_action_set_that_does_not_need_being_checked);
-  running_action_set_that_does_not_need_being_checked = NULL;
+  xbt_swag_free(cpu_running_action_set_that_does_not_need_being_checked);
+  cpu_running_action_set_that_does_not_need_being_checked = NULL;
 }
 
 static void surf_cpu_model_init_internal(void)
 }
 
 static void surf_cpu_model_init_internal(void)
@@ -385,35 +385,35 @@ static void surf_cpu_model_init_internal(void)
 
   surf_cpu_model = surf_model_init();
 
 
   surf_cpu_model = surf_model_init();
 
-  running_action_set_that_does_not_need_being_checked =
+  cpu_running_action_set_that_does_not_need_being_checked =
     xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
   surf_cpu_model->name = "CPU";
 
     xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
   surf_cpu_model->name = "CPU";
 
-  surf_cpu_model->action_unref = action_unref;
-  surf_cpu_model->action_cancel = action_cancel;
+  surf_cpu_model->action_unref = cpu_action_unref;
+  surf_cpu_model->action_cancel = cpu_action_cancel;
   surf_cpu_model->action_state_set = cpu_action_state_set;
 
   surf_cpu_model->action_state_set = cpu_action_state_set;
 
-  surf_cpu_model->model_private->resource_used = resource_used;
-  surf_cpu_model->model_private->share_resources = share_resources;
-  surf_cpu_model->model_private->update_actions_state = update_actions_state;
+  surf_cpu_model->model_private->resource_used = cpu_resource_used;
+  surf_cpu_model->model_private->share_resources = cpu_share_resources;
+  surf_cpu_model->model_private->update_actions_state = cpu_update_actions_state;
   surf_cpu_model->model_private->update_resource_state =
   surf_cpu_model->model_private->update_resource_state =
-    update_resource_state;
-  surf_cpu_model->model_private->finalize = finalize;
+    cpu_update_resource_state;
+  surf_cpu_model->model_private->finalize = cpu_finalize;
 
 
-  surf_cpu_model->suspend = action_suspend;
-  surf_cpu_model->resume = action_resume;
-  surf_cpu_model->is_suspended = action_is_suspended;
-  surf_cpu_model->set_max_duration = action_set_max_duration;
-  surf_cpu_model->set_priority = action_set_priority;
-  surf_cpu_model->get_remains = action_get_remains;
+  surf_cpu_model->suspend = cpu_action_suspend;
+  surf_cpu_model->resume = cpu_action_resume;
+  surf_cpu_model->is_suspended = cpu_action_is_suspended;
+  surf_cpu_model->set_max_duration = cpu_action_set_max_duration;
+  surf_cpu_model->set_priority = cpu_action_set_priority;
+  surf_cpu_model->get_remains = cpu_action_get_remains;
 
 
-  surf_cpu_model->extension.cpu.execute = execute;
-  surf_cpu_model->extension.cpu.sleep = action_sleep;
+  surf_cpu_model->extension.cpu.execute = cpu_execute;
+  surf_cpu_model->extension.cpu.sleep = cpu_action_sleep;
 
 
-  surf_cpu_model->extension.cpu.get_state = get_state;
-  surf_cpu_model->extension.cpu.get_speed = get_speed;
-  surf_cpu_model->extension.cpu.get_available_speed = get_available_speed;
+  surf_cpu_model->extension.cpu.get_state = cpu_get_state;
+  surf_cpu_model->extension.cpu.get_speed = cpu_get_speed;
+  surf_cpu_model->extension.cpu.get_available_speed = cpu_get_available_speed;
 
   if (!cpu_maxmin_system)
     cpu_maxmin_system = lmm_system_new();
 
   if (!cpu_maxmin_system)
     cpu_maxmin_system = lmm_system_new();
@@ -439,6 +439,6 @@ void surf_cpu_model_init_Cas01(const char *filename)
   if (surf_cpu_model)
     return;
   surf_cpu_model_init_internal();
   if (surf_cpu_model)
     return;
   surf_cpu_model_init_internal();
-  define_callbacks(filename);
+  cpu_define_callbacks(filename);
   xbt_dynar_push(model_list, &surf_cpu_model);
 }
   xbt_dynar_push(model_list, &surf_cpu_model);
 }
index 34d4542..ca0a98b 100644 (file)
@@ -7,6 +7,9 @@
 
 #include "surf_private.h"
 
 
 #include "surf_private.h"
 
+#undef GENERIC_LMM_ACTION
+#undef GENERIC_ACTION
+#undef ACTION_GET_CPU
 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
 #define ACTION_GET_CPU(action) ((surf_action_cpu_Cas01_im_t) action)->cpu
 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
 #define ACTION_GET_CPU(action) ((surf_action_cpu_Cas01_im_t) action)->cpu
@@ -36,14 +39,14 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_im, surf,
 
 
 lmm_system_t cpu_im_maxmin_system = NULL;
 
 
 lmm_system_t cpu_im_maxmin_system = NULL;
-static xbt_swag_t modified_cpu = NULL;
-static xbt_heap_t action_heap = NULL;
+static xbt_swag_t cpu_im_modified_cpu = NULL;
+static xbt_heap_t cpu_im_action_heap = NULL;
 extern int sg_maxmin_selective_update;
 
 
 extern int sg_maxmin_selective_update;
 
 
-static xbt_swag_t running_action_set_that_does_not_need_being_checked = NULL;
+static xbt_swag_t cpu_im_running_action_set_that_does_not_need_being_checked = NULL;
 
 
-static cpu_Cas01_im_t cpu_new(char *name, double power_peak,
+static cpu_Cas01_im_t cpu_im_new(char *name, double power_peak,
                               double power_scale,
                               tmgr_trace_t power_trace,
                               e_surf_resource_state_t state_initial,
                               double power_scale,
                               tmgr_trace_t power_trace,
                               e_surf_resource_state_t state_initial,
@@ -81,7 +84,7 @@ static cpu_Cas01_im_t cpu_new(char *name, double power_peak,
 }
 
 
 }
 
 
-static void parse_cpu_init(void)
+static void parse_cpu_im_init(void)
 {
   double power_peak = 0.0;
   double power_scale = 0.0;
 {
   double power_peak = 0.0;
   double power_scale = 0.0;
@@ -103,12 +106,12 @@ static void parse_cpu_init(void)
   state_trace = tmgr_trace_new(A_surfxml_host_state_file);
 
   current_property_set = xbt_dict_new();
   state_trace = tmgr_trace_new(A_surfxml_host_state_file);
 
   current_property_set = xbt_dict_new();
-  cpu_new(xbt_strdup(A_surfxml_host_id), power_peak, power_scale,
+  cpu_im_new(xbt_strdup(A_surfxml_host_id), power_peak, power_scale,
           power_trace, state_initial, state_trace, current_property_set);
 
 }
 
           power_trace, state_initial, state_trace, current_property_set);
 
 }
 
-static void add_traces_cpu(void)
+static void cpu_im_add_traces_cpu(void)
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
@@ -142,20 +145,20 @@ static void add_traces_cpu(void)
   }
 }
 
   }
 }
 
-static void define_callbacks(const char *file)
+static void cpu_im_define_callbacks(const char *file)
 {
   surf_parse_reset_parser();
 {
   surf_parse_reset_parser();
-  surfxml_add_callback(STag_surfxml_host_cb_list, parse_cpu_init);
-  surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces_cpu);
+  surfxml_add_callback(STag_surfxml_host_cb_list, parse_cpu_im_init);
+  surfxml_add_callback(ETag_surfxml_platform_cb_list, &cpu_im_add_traces_cpu);
 }
 
 }
 
-static int resource_used(void *resource_id)
+static int cpu_im_resource_used(void *resource_id)
 {
   return lmm_constraint_used(cpu_im_maxmin_system,
                              ((cpu_Cas01_im_t) resource_id)->constraint);
 }
 
 {
   return lmm_constraint_used(cpu_im_maxmin_system,
                              ((cpu_Cas01_im_t) resource_id)->constraint);
 }
 
-static int action_unref(surf_action_t action)
+static int cpu_im_action_unref(surf_action_t action)
 {
   action->refcount--;
   if (!action->refcount) {
 {
   action->refcount--;
   if (!action->refcount) {
@@ -164,28 +167,28 @@ static int action_unref(surf_action_t action)
       lmm_variable_free(cpu_im_maxmin_system,
                         ((surf_action_lmm_t) action)->variable);
     /* remove from heap */
       lmm_variable_free(cpu_im_maxmin_system,
                         ((surf_action_lmm_t) action)->variable);
     /* remove from heap */
-    xbt_heap_remove(action_heap,
+    xbt_heap_remove(cpu_im_action_heap,
                     ((surf_action_cpu_Cas01_im_t) action)->index_heap);
     xbt_swag_remove(action,
                     ((cpu_Cas01_im_t) ACTION_GET_CPU(action))->action_set);
                     ((surf_action_cpu_Cas01_im_t) action)->index_heap);
     xbt_swag_remove(action,
                     ((cpu_Cas01_im_t) ACTION_GET_CPU(action))->action_set);
-    xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+    xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
     free(action);
     return 1;
   }
   return 0;
 }
 
     free(action);
     return 1;
   }
   return 0;
 }
 
-static void action_cancel(surf_action_t action)
+static void cpu_im_action_cancel(surf_action_t action)
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
-  xbt_heap_remove(action_heap,
+  xbt_heap_remove(cpu_im_action_heap,
                   ((surf_action_cpu_Cas01_im_t) action)->index_heap);
   xbt_swag_remove(action,
                   ((cpu_Cas01_im_t) ACTION_GET_CPU(action))->action_set);
   return;
 }
 
                   ((surf_action_cpu_Cas01_im_t) action)->index_heap);
   xbt_swag_remove(action,
                   ((cpu_Cas01_im_t) ACTION_GET_CPU(action))->action_set);
   return;
 }
 
-static void cpu_action_state_set(surf_action_t action,
+static void cpu_im_cpu_action_state_set(surf_action_t action,
                                  e_surf_action_state_t state)
 {
 /*   if((state==SURF_ACTION_DONE) || (state==SURF_ACTION_FAILED)) */
                                  e_surf_action_state_t state)
 {
 /*   if((state==SURF_ACTION_DONE) || (state==SURF_ACTION_FAILED)) */
@@ -198,7 +201,7 @@ static void cpu_action_state_set(surf_action_t action,
   return;
 }
 
   return;
 }
 
-static void cpu_update_remains(cpu_Cas01_im_t cpu, double now)
+static void cpu_im_update_remains(cpu_Cas01_im_t cpu, double now)
 {
   surf_action_cpu_Cas01_im_t action;
 
 {
   surf_action_cpu_Cas01_im_t action;
 
@@ -225,19 +228,19 @@ static void cpu_update_remains(cpu_Cas01_im_t cpu, double now)
   cpu->last_update = now;
 }
 
   cpu->last_update = now;
 }
 
-static double share_resources(double now)
+static double cpu_im_share_resources(double now)
 {
   surf_action_cpu_Cas01_im_t action;
   double min;
   double value;
   cpu_Cas01_im_t cpu, cpu_next;
 
 {
   surf_action_cpu_Cas01_im_t action;
   double min;
   double value;
   cpu_Cas01_im_t cpu, cpu_next;
 
-  xbt_swag_foreach(cpu, modified_cpu)
-    cpu_update_remains(cpu, now);
+  xbt_swag_foreach(cpu, cpu_im_modified_cpu)
+    cpu_im_update_remains(cpu, now);
 
   lmm_solve(cpu_im_maxmin_system);
 
 
   lmm_solve(cpu_im_maxmin_system);
 
-  xbt_swag_foreach_safe(cpu, cpu_next, modified_cpu) {
+  xbt_swag_foreach_safe(cpu, cpu_next, cpu_im_modified_cpu) {
     xbt_swag_foreach(action, cpu->action_set) {
       if (GENERIC_ACTION(action).state_set !=
           surf_cpu_model->states.running_action_set)
     xbt_swag_foreach(action, cpu->action_set) {
       if (GENERIC_ACTION(action).state_set !=
           surf_cpu_model->states.running_action_set)
@@ -271,39 +274,39 @@ static double share_resources(double now)
 
       if (action->index_heap >= 0) {
         surf_action_cpu_Cas01_im_t heap_act =
 
       if (action->index_heap >= 0) {
         surf_action_cpu_Cas01_im_t heap_act =
-          xbt_heap_remove(action_heap, action->index_heap);
+          xbt_heap_remove(cpu_im_action_heap, action->index_heap);
         if (heap_act != action)
           DIE_IMPOSSIBLE;
       }
       if (min != -1) {
         if (heap_act != action)
           DIE_IMPOSSIBLE;
       }
       if (min != -1) {
-        xbt_heap_push(action_heap, action, min);
+        xbt_heap_push(cpu_im_action_heap, action, min);
         DEBUG2("Insert at heap action(%p) min %lf", action, min);
       }
     }
         DEBUG2("Insert at heap action(%p) min %lf", action, min);
       }
     }
-    xbt_swag_remove(cpu, modified_cpu);
+    xbt_swag_remove(cpu, cpu_im_modified_cpu);
   }
   }
-  return xbt_heap_size(action_heap) >
-    0 ? xbt_heap_maxkey(action_heap) - now : -1;
+  return xbt_heap_size(cpu_im_action_heap) >
+    0 ? xbt_heap_maxkey(cpu_im_action_heap) - now : -1;
 }
 
 }
 
-static void update_actions_state(double now, double delta)
+static void cpu_im_update_actions_state(double now, double delta)
 {
   surf_action_cpu_Cas01_im_t action;
 
 {
   surf_action_cpu_Cas01_im_t action;
 
-  while ((xbt_heap_size(action_heap) > 0)
-         && (double_equals(xbt_heap_maxkey(action_heap), now))) {
-    action = xbt_heap_pop(action_heap);
+  while ((xbt_heap_size(cpu_im_action_heap) > 0)
+         && (double_equals(xbt_heap_maxkey(cpu_im_action_heap), now))) {
+    action = xbt_heap_pop(cpu_im_action_heap);
     DEBUG1("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     GENERIC_ACTION(action).remains = 0;
     DEBUG1("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     GENERIC_ACTION(action).remains = 0;
-    cpu_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
-    cpu_update_remains(action->cpu, surf_get_clock());
+    cpu_im_cpu_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+    cpu_im_update_remains(action->cpu, surf_get_clock());
   }
   return;
 }
 
   }
   return;
 }
 
-static void update_resource_state(void *id,
+static void cpu_im_update_resource_state(void *id,
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
@@ -313,7 +316,7 @@ static void update_resource_state(void *id,
     cpu->power_scale = value;
     lmm_update_constraint_bound(cpu_im_maxmin_system, cpu->constraint,
                                 cpu->power_scale * cpu->power_peak);
     cpu->power_scale = value;
     lmm_update_constraint_bound(cpu_im_maxmin_system, cpu->constraint,
                                 cpu->power_scale * cpu->power_peak);
-    xbt_swag_insert(cpu, modified_cpu);
+    xbt_swag_insert(cpu, cpu_im_modified_cpu);
     if (tmgr_trace_event_free(event_type))
       cpu->power_event = NULL;
   } else if (event_type == cpu->state_event) {
     if (tmgr_trace_event_free(event_type))
       cpu->power_event = NULL;
   } else if (event_type == cpu->state_event) {
@@ -333,7 +336,7 @@ static void update_resource_state(void *id,
             surf_action_state_get(action) == SURF_ACTION_READY ||
             surf_action_state_get(action) == SURF_ACTION_NOT_IN_THE_SYSTEM) {
           action->finish = date;
             surf_action_state_get(action) == SURF_ACTION_READY ||
             surf_action_state_get(action) == SURF_ACTION_NOT_IN_THE_SYSTEM) {
           action->finish = date;
-          cpu_action_state_set(action, SURF_ACTION_FAILED);
+          cpu_im_cpu_action_state_set(action, SURF_ACTION_FAILED);
         }
       }
     }
         }
       }
     }
@@ -347,7 +350,7 @@ static void update_resource_state(void *id,
   return;
 }
 
   return;
 }
 
-static surf_action_t execute(void *cpu, double size)
+static surf_action_t cpu_im_execute(void *cpu, double size)
 {
   surf_action_cpu_Cas01_im_t action = NULL;
   cpu_Cas01_im_t CPU = cpu;
 {
   surf_action_cpu_Cas01_im_t action = NULL;
   cpu_Cas01_im_t CPU = cpu;
@@ -365,7 +368,7 @@ static surf_action_t execute(void *cpu, double size)
                      GENERIC_ACTION(action).priority, -1.0, 1);
   action->index_heap = -1;
   action->cpu = CPU;
                      GENERIC_ACTION(action).priority, -1.0, 1);
   action->index_heap = -1;
   action->cpu = CPU;
-  xbt_swag_insert(CPU, modified_cpu);
+  xbt_swag_insert(CPU, cpu_im_modified_cpu);
   xbt_swag_insert(action, CPU->action_set);
   lmm_expand(cpu_im_maxmin_system, CPU->constraint,
              GENERIC_LMM_ACTION(action).variable, 1.0);
   xbt_swag_insert(action, CPU->action_set);
   lmm_expand(cpu_im_maxmin_system, CPU->constraint,
              GENERIC_LMM_ACTION(action).variable, 1.0);
@@ -373,7 +376,7 @@ static surf_action_t execute(void *cpu, double size)
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-static surf_action_t action_sleep(void *cpu, double duration)
+static surf_action_t cpu_im_action_sleep(void *cpu, double duration)
 {
   surf_action_cpu_Cas01_im_t action = NULL;
 
 {
   surf_action_cpu_Cas01_im_t action = NULL;
 
@@ -381,7 +384,7 @@ static surf_action_t action_sleep(void *cpu, double duration)
     duration = MAX(duration, MAXMIN_PRECISION);
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
     duration = MAX(duration, MAXMIN_PRECISION);
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
-  action = (surf_action_cpu_Cas01_im_t) execute(cpu, 1.0);
+  action = (surf_action_cpu_Cas01_im_t) cpu_im_execute(cpu, 1.0);
   GENERIC_ACTION(action).max_duration = duration;
   GENERIC_LMM_ACTION(action).suspended = 2;
   if (duration == NO_MAX_DURATION) {
   GENERIC_ACTION(action).max_duration = duration;
   GENERIC_LMM_ACTION(action).suspended = 2;
   if (duration == NO_MAX_DURATION) {
@@ -389,32 +392,32 @@ static surf_action_t action_sleep(void *cpu, double duration)
        is used to speed up update_resource_state  */
     xbt_swag_remove(action, ((surf_action_t) action)->state_set);
     ((surf_action_t) action)->state_set =
        is used to speed up update_resource_state  */
     xbt_swag_remove(action, ((surf_action_t) action)->state_set);
     ((surf_action_t) action)->state_set =
-      running_action_set_that_does_not_need_being_checked;
+      cpu_im_running_action_set_that_does_not_need_being_checked;
     xbt_swag_insert(action, ((surf_action_t) action)->state_set);
   }
 
   lmm_update_variable_weight(cpu_im_maxmin_system,
                              GENERIC_LMM_ACTION(action).variable, 0.0);
     xbt_swag_insert(action, ((surf_action_t) action)->state_set);
   }
 
   lmm_update_variable_weight(cpu_im_maxmin_system,
                              GENERIC_LMM_ACTION(action).variable, 0.0);
-  xbt_swag_insert(cpu, modified_cpu);
+  xbt_swag_insert(cpu, cpu_im_modified_cpu);
   XBT_OUT;
   return (surf_action_t) action;
 }
 
   XBT_OUT;
   return (surf_action_t) action;
 }
 
-static void action_suspend(surf_action_t action)
+static void cpu_im_action_suspend(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_lmm_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_im_maxmin_system,
                                ((surf_action_lmm_t) action)->variable, 0.0);
     ((surf_action_lmm_t) action)->suspended = 1;
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_lmm_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_im_maxmin_system,
                                ((surf_action_lmm_t) action)->variable, 0.0);
     ((surf_action_lmm_t) action)->suspended = 1;
-    xbt_heap_remove(action_heap,
+    xbt_heap_remove(cpu_im_action_heap,
                     ((surf_action_cpu_Cas01_im_t) action)->index_heap);
                     ((surf_action_cpu_Cas01_im_t) action)->index_heap);
-    xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+    xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
   }
   XBT_OUT;
 }
 
   }
   XBT_OUT;
 }
 
-static void action_resume(surf_action_t action)
+static void cpu_im_action_resume(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_lmm_t) action)->suspended != 2) {
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_lmm_t) action)->suspended != 2) {
@@ -422,27 +425,27 @@ static void action_resume(surf_action_t action)
                                ((surf_action_lmm_t) action)->variable,
                                action->priority);
     ((surf_action_lmm_t) action)->suspended = 0;
                                ((surf_action_lmm_t) action)->variable,
                                action->priority);
     ((surf_action_lmm_t) action)->suspended = 0;
-    xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+    xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
   }
   XBT_OUT;
 }
 
   }
   XBT_OUT;
 }
 
-static int action_is_suspended(surf_action_t action)
+static int cpu_im_action_is_suspended(surf_action_t action)
 {
   return (((surf_action_lmm_t) action)->suspended == 1);
 }
 
 {
   return (((surf_action_lmm_t) action)->suspended == 1);
 }
 
-static void action_set_max_duration(surf_action_t action, double duration)
+static void cpu_im_action_set_max_duration(surf_action_t action, double duration)
 {
   XBT_IN2("(%p,%g)", action, duration);
 
   action->max_duration = duration;
   /* insert cpu in modified_cpu set to notice the max duration change */
 {
   XBT_IN2("(%p,%g)", action, duration);
 
   action->max_duration = duration;
   /* insert cpu in modified_cpu set to notice the max duration change */
-  xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+  xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static void action_set_priority(surf_action_t action, double priority)
+static void cpu_im_action_set_priority(surf_action_t action, double priority)
 {
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
 {
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
@@ -450,41 +453,41 @@ static void action_set_priority(surf_action_t action, double priority)
                              ((surf_action_lmm_t) action)->variable,
                              priority);
 
                              ((surf_action_lmm_t) action)->variable,
                              priority);
 
-  xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+  xbt_swag_insert(ACTION_GET_CPU(action), cpu_im_modified_cpu);
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static double action_get_remains(surf_action_t action)
+static double cpu_im_action_get_remains(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   /* update remains before return it */
 {
   XBT_IN1("(%p)", action);
   /* update remains before return it */
-  cpu_update_remains(ACTION_GET_CPU(action), surf_get_clock());
+  cpu_im_update_remains(ACTION_GET_CPU(action), surf_get_clock());
   return action->remains;
   XBT_OUT;
 }
 
   return action->remains;
   XBT_OUT;
 }
 
-static e_surf_resource_state_t get_state(void *cpu)
+static e_surf_resource_state_t cpu_im_get_state(void *cpu)
 {
   return ((cpu_Cas01_im_t) cpu)->state_current;
 }
 
 {
   return ((cpu_Cas01_im_t) cpu)->state_current;
 }
 
-static double get_speed(void *cpu, double load)
+static double cpu_im_get_speed(void *cpu, double load)
 {
   return load * (((cpu_Cas01_im_t) cpu)->power_peak);
 }
 
 {
   return load * (((cpu_Cas01_im_t) cpu)->power_peak);
 }
 
-static double get_available_speed(void *cpu)
+static double cpu_im_get_available_speed(void *cpu)
 {
   /* number between 0 and 1 */
   return ((cpu_Cas01_im_t) cpu)->power_scale;
 }
 
 {
   /* number between 0 and 1 */
   return ((cpu_Cas01_im_t) cpu)->power_scale;
 }
 
-static void action_update_index_heap(void *action, int i)
+static void cpu_im_action_update_index_heap(void *action, int i)
 {
   ((surf_action_cpu_Cas01_im_t) action)->index_heap = i;
 }
 
 {
   ((surf_action_cpu_Cas01_im_t) action)->index_heap = i;
 }
 
-static void finalize(void)
+static void cpu_im_finalize(void)
 {
   void *cpu;
   xbt_dict_cursor_t cursor;
 {
   void *cpu;
   xbt_dict_cursor_t cursor;
@@ -500,56 +503,56 @@ static void finalize(void)
   surf_model_exit(surf_cpu_model);
   surf_cpu_model = NULL;
 
   surf_model_exit(surf_cpu_model);
   surf_cpu_model = NULL;
 
-  xbt_swag_free(running_action_set_that_does_not_need_being_checked);
-  running_action_set_that_does_not_need_being_checked = NULL;
-  xbt_heap_free(action_heap);
-  xbt_swag_free(modified_cpu);
+  xbt_swag_free(cpu_im_running_action_set_that_does_not_need_being_checked);
+  cpu_im_running_action_set_that_does_not_need_being_checked = NULL;
+  xbt_heap_free(cpu_im_action_heap);
+  xbt_swag_free(cpu_im_modified_cpu);
 }
 
 }
 
-static void surf_cpu_model_init_internal(void)
+static void surf_cpu_im_model_init_internal(void)
 {
   s_surf_action_t action;
   s_cpu_Cas01_im_t cpu;
 
   surf_cpu_model = surf_model_init();
 
 {
   s_surf_action_t action;
   s_cpu_Cas01_im_t cpu;
 
   surf_cpu_model = surf_model_init();
 
-  running_action_set_that_does_not_need_being_checked =
+  cpu_im_running_action_set_that_does_not_need_being_checked =
     xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
   surf_cpu_model->name = "CPU_IM";
 
     xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
   surf_cpu_model->name = "CPU_IM";
 
-  surf_cpu_model->action_unref = action_unref;
-  surf_cpu_model->action_cancel = action_cancel;
-  surf_cpu_model->action_state_set = cpu_action_state_set;
+  surf_cpu_model->action_unref = cpu_im_action_unref;
+  surf_cpu_model->action_cancel = cpu_im_action_cancel;
+  surf_cpu_model->action_state_set = cpu_im_cpu_action_state_set;
 
 
-  surf_cpu_model->model_private->resource_used = resource_used;
-  surf_cpu_model->model_private->share_resources = share_resources;
-  surf_cpu_model->model_private->update_actions_state = update_actions_state;
+  surf_cpu_model->model_private->resource_used = cpu_im_resource_used;
+  surf_cpu_model->model_private->share_resources = cpu_im_share_resources;
+  surf_cpu_model->model_private->update_actions_state = cpu_im_update_actions_state;
   surf_cpu_model->model_private->update_resource_state =
   surf_cpu_model->model_private->update_resource_state =
-    update_resource_state;
-  surf_cpu_model->model_private->finalize = finalize;
+    cpu_im_update_resource_state;
+  surf_cpu_model->model_private->finalize = cpu_im_finalize;
 
 
-  surf_cpu_model->suspend = action_suspend;
-  surf_cpu_model->resume = action_resume;
-  surf_cpu_model->is_suspended = action_is_suspended;
-  surf_cpu_model->set_max_duration = action_set_max_duration;
-  surf_cpu_model->set_priority = action_set_priority;
-  surf_cpu_model->get_remains = action_get_remains;
+  surf_cpu_model->suspend = cpu_im_action_suspend;
+  surf_cpu_model->resume = cpu_im_action_resume;
+  surf_cpu_model->is_suspended = cpu_im_action_is_suspended;
+  surf_cpu_model->set_max_duration = cpu_im_action_set_max_duration;
+  surf_cpu_model->set_priority = cpu_im_action_set_priority;
+  surf_cpu_model->get_remains = cpu_im_action_get_remains;
 
 
-  surf_cpu_model->extension.cpu.execute = execute;
-  surf_cpu_model->extension.cpu.sleep = action_sleep;
+  surf_cpu_model->extension.cpu.execute = cpu_im_execute;
+  surf_cpu_model->extension.cpu.sleep = cpu_im_action_sleep;
 
 
-  surf_cpu_model->extension.cpu.get_state = get_state;
-  surf_cpu_model->extension.cpu.get_speed = get_speed;
-  surf_cpu_model->extension.cpu.get_available_speed = get_available_speed;
+  surf_cpu_model->extension.cpu.get_state = cpu_im_get_state;
+  surf_cpu_model->extension.cpu.get_speed = cpu_im_get_speed;
+  surf_cpu_model->extension.cpu.get_available_speed = cpu_im_get_available_speed;
 
   if (!cpu_im_maxmin_system) {
     sg_maxmin_selective_update = 1;
     cpu_im_maxmin_system = lmm_system_new();
   }
 
   if (!cpu_im_maxmin_system) {
     sg_maxmin_selective_update = 1;
     cpu_im_maxmin_system = lmm_system_new();
   }
-  action_heap = xbt_heap_new(8, NULL);
-  xbt_heap_set_update_callback(action_heap, action_update_index_heap);
-  modified_cpu = xbt_swag_new(xbt_swag_offset(cpu, modified_cpu_hookup));
+  cpu_im_action_heap = xbt_heap_new(8, NULL);
+  xbt_heap_set_update_callback(cpu_im_action_heap, cpu_im_action_update_index_heap);
+  cpu_im_modified_cpu = xbt_swag_new(xbt_swag_offset(cpu, modified_cpu_hookup));
 }
 
 /*********************************************************************/
 }
 
 /*********************************************************************/
@@ -571,7 +574,7 @@ void surf_cpu_model_init_Cas01_im(const char *filename)
 {
   if (surf_cpu_model)
     return;
 {
   if (surf_cpu_model)
     return;
-  surf_cpu_model_init_internal();
-  define_callbacks(filename);
+  surf_cpu_im_model_init_internal();
+  cpu_im_define_callbacks(filename);
   xbt_dynar_push(model_list, &surf_cpu_model);
 }
   xbt_dynar_push(model_list, &surf_cpu_model);
 }
index 166a91c..7ce67d0 100644 (file)
@@ -21,32 +21,32 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf,
                                 "Logging specific to the SURF CPU TRACE INTEGRATION module");
 
 
                                 "Logging specific to the SURF CPU TRACE INTEGRATION module");
 
 
-static xbt_swag_t running_action_set_that_does_not_need_being_checked = NULL;
-static xbt_swag_t modified_cpu = NULL;
-static xbt_heap_t action_heap;
+static xbt_swag_t cpu_ti_running_action_set_that_does_not_need_being_checked = NULL;
+static xbt_swag_t cpu_ti_modified_cpu = NULL;
+static xbt_heap_t cpu_ti_action_heap;
 
 /* prototypes of new trace functions */
 
 /* prototypes of new trace functions */
-static double surf_cpu_integrate_trace(surf_cpu_ti_tgmr_t trace, double a,
+static double surf_cpu_ti_integrate_trace(surf_cpu_ti_tgmr_t trace, double a,
                                        double b);
 
 
                                        double b);
 
 
-static double surf_cpu_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
+static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
                                    double amount);
                                    double amount);
-static double surf_cpu_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t trace,
+static double surf_cpu_ti_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t trace,
                                                    double a, double amount);
 
                                                    double a, double amount);
 
-static void surf_cpu_free_tmgr(surf_cpu_ti_tgmr_t trace);
+static void surf_cpu_ti_free_tmgr(surf_cpu_ti_tgmr_t trace);
 
 
-static double surf_cpu_integrate_trace_simple(surf_cpu_ti_trace_t trace,
+static double surf_cpu_ti_integrate_trace_simple(surf_cpu_ti_trace_t trace,
                                               double a, double b);
                                               double a, double b);
-static double surf_cpu_integrate_trace_simple_point(surf_cpu_ti_trace_t trace,
+static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t trace,
                                                     double a);
                                                     double a);
-static double surf_cpu_solve_trace_simple(surf_cpu_ti_trace_t trace, double a,
+static double surf_cpu_ti_solve_trace_simple(surf_cpu_ti_trace_t trace, double a,
                                           double amount);
                                           double amount);
-static int surf_cpu_binary_search(double *array, double a, int low, int high);
+static int surf_cpu_ti_binary_search(double *array, double a, int low, int high);
 /* end prototypes */
 
 /* end prototypes */
 
-static void surf_cpu_free_trace(surf_cpu_ti_trace_t trace)
+static void surf_cpu_ti_free_trace(surf_cpu_ti_trace_t trace)
 {
   if (trace->time_points)
     xbt_free(trace->time_points);
 {
   if (trace->time_points)
     xbt_free(trace->time_points);
@@ -55,14 +55,14 @@ static void surf_cpu_free_trace(surf_cpu_ti_trace_t trace)
   xbt_free(trace);
 }
 
   xbt_free(trace);
 }
 
-static void surf_cpu_free_tmgr(surf_cpu_ti_tgmr_t trace)
+static void surf_cpu_ti_free_tmgr(surf_cpu_ti_tgmr_t trace)
 {
   if (trace->trace)
 {
   if (trace->trace)
-    surf_cpu_free_trace(trace->trace);
+    surf_cpu_ti_free_trace(trace->trace);
   xbt_free(trace);
 }
 
   xbt_free(trace);
 }
 
-static surf_cpu_ti_trace_t surf_cpu_trace_new(tmgr_trace_t power_trace)
+static surf_cpu_ti_trace_t surf_cpu_ti_trace_new(tmgr_trace_t power_trace)
 {
   surf_cpu_ti_trace_t trace;
   s_tmgr_event_t val;
 {
   surf_cpu_ti_trace_t trace;
   s_tmgr_event_t val;
@@ -130,9 +130,9 @@ static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace,
   xbt_dynar_foreach(power_trace->event_list, cpt, val) {
     total_time += val.delta;
   }
   xbt_dynar_foreach(power_trace->event_list, cpt, val) {
     total_time += val.delta;
   }
-  trace->trace = surf_cpu_trace_new(power_trace);
+  trace->trace = surf_cpu_ti_trace_new(power_trace);
   trace->last_time = total_time;
   trace->last_time = total_time;
-  trace->total = surf_cpu_integrate_trace_simple(trace->trace, 0, total_time);
+  trace->total = surf_cpu_ti_integrate_trace_simple(trace->trace, 0, total_time);
 
   DEBUG2("Total integral %lf, last_time %lf ",
          trace->total, trace->last_time);
 
   DEBUG2("Total integral %lf, last_time %lf ",
          trace->total, trace->last_time);
@@ -141,7 +141,7 @@ static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace,
 }
 
 
 }
 
 
-static cpu_ti_t cpu_new(char *name, double power_peak,
+static cpu_ti_t cpu_ti_new(char *name, double power_peak,
                         double power_scale,
                         tmgr_trace_t power_trace,
                         e_surf_resource_state_t state_initial,
                         double power_scale,
                         tmgr_trace_t power_trace,
                         e_surf_resource_state_t state_initial,
@@ -184,7 +184,7 @@ static cpu_ti_t cpu_new(char *name, double power_peak,
 }
 
 
 }
 
 
-static void parse_cpu_init(void)
+static void parse_cpu_ti_init(void)
 {
   double power_peak = 0.0;
   double power_scale = 0.0;
 {
   double power_peak = 0.0;
   double power_scale = 0.0;
@@ -206,12 +206,12 @@ static void parse_cpu_init(void)
   state_trace = tmgr_trace_new(A_surfxml_host_state_file);
 
   current_property_set = xbt_dict_new();
   state_trace = tmgr_trace_new(A_surfxml_host_state_file);
 
   current_property_set = xbt_dict_new();
-  cpu_new(xbt_strdup(A_surfxml_host_id), power_peak, power_scale,
+  cpu_ti_new(xbt_strdup(A_surfxml_host_id), power_peak, power_scale,
           power_trace, state_initial, state_trace, current_property_set);
 
 }
 
           power_trace, state_initial, state_trace, current_property_set);
 
 }
 
-static void add_traces_cpu(void)
+static void add_traces_cpu_ti(void)
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
@@ -247,7 +247,7 @@ static void add_traces_cpu(void)
 
     DEBUG2("Add power trace: %s to CPU(%s)", trace_name, elm);
     if (cpu->avail_trace)
 
     DEBUG2("Add power trace: %s to CPU(%s)", trace_name, elm);
     if (cpu->avail_trace)
-      surf_cpu_free_tmgr(cpu->avail_trace);
+      surf_cpu_ti_free_tmgr(cpu->avail_trace);
 
     cpu->avail_trace = cpu_ti_parse_trace(trace, cpu->power_scale);
 
 
     cpu->avail_trace = cpu_ti_parse_trace(trace, cpu->power_scale);
 
@@ -267,20 +267,20 @@ static void add_traces_cpu(void)
   }
 }
 
   }
 }
 
-static void define_callbacks(const char *file)
+static void cpu_ti_define_callbacks(const char *file)
 {
   surf_parse_reset_parser();
 {
   surf_parse_reset_parser();
-  surfxml_add_callback(STag_surfxml_host_cb_list, parse_cpu_init);
-  surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces_cpu);
+  surfxml_add_callback(STag_surfxml_host_cb_list, parse_cpu_ti_init);
+  surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces_cpu_ti);
 }
 
 }
 
-static int resource_used(void *resource_id)
+static int cpu_ti_resource_used(void *resource_id)
 {
   cpu_ti_t cpu = resource_id;
   return xbt_swag_size(cpu->action_set);
 }
 
 {
   cpu_ti_t cpu = resource_id;
   return xbt_swag_size(cpu->action_set);
 }
 
-static int action_unref(surf_action_t action)
+static int cpu_ti_action_unref(surf_action_t action)
 {
   action->refcount--;
   if (!action->refcount) {
 {
   action->refcount--;
   if (!action->refcount) {
@@ -288,27 +288,27 @@ static int action_unref(surf_action_t action)
     /* remove from action_set */
     xbt_swag_remove(action, ACTION_GET_CPU(action)->action_set);
     /* remove from heap */
     /* remove from action_set */
     xbt_swag_remove(action, ACTION_GET_CPU(action)->action_set);
     /* remove from heap */
-    xbt_heap_remove(action_heap, ((surf_action_cpu_ti_t) action)->index_heap);
-    xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+    xbt_heap_remove(cpu_ti_action_heap, ((surf_action_cpu_ti_t) action)->index_heap);
+    xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
     free(action);
     return 1;
   }
   return 0;
 }
 
     free(action);
     return 1;
   }
   return 0;
 }
 
-static void action_cancel(surf_action_t action)
+static void cpu_ti_action_cancel(surf_action_t action)
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
-  xbt_heap_remove(action_heap, ((surf_action_cpu_ti_t) action)->index_heap);
-  xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+  xbt_heap_remove(cpu_ti_action_heap, ((surf_action_cpu_ti_t) action)->index_heap);
+  xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   return;
 }
 
   return;
 }
 
-static void cpu_action_state_set(surf_action_t action,
+static void cpu_ti_action_state_set(surf_action_t action,
                                  e_surf_action_state_t state)
 {
   surf_action_state_set(action, state);
                                  e_surf_action_state_t state)
 {
   surf_action_state_set(action, state);
-  xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+  xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   return;
 }
 
   return;
 }
 
@@ -318,7 +318,7 @@ static void cpu_action_state_set(surf_action_t action,
 * \param       cpu             Cpu on which the actions are running
 * \param       now             Current time
 */
 * \param       cpu             Cpu on which the actions are running
 * \param       now             Current time
 */
-static void cpu_update_remaining_amount(cpu_ti_t cpu, double now)
+static void cpu_ti_update_remaining_amount(cpu_ti_t cpu, double now)
 {
 #define GENERIC_ACTION(action) action->generic_action
   double area_total;
 {
 #define GENERIC_ACTION(action) action->generic_action
   double area_total;
@@ -330,7 +330,7 @@ static void cpu_update_remaining_amount(cpu_ti_t cpu, double now)
 
 /* calcule the surface */
   area_total =
 
 /* calcule the surface */
   area_total =
-    surf_cpu_integrate_trace(cpu->avail_trace, cpu->last_update,
+    surf_cpu_ti_integrate_trace(cpu->avail_trace, cpu->last_update,
                              now) * cpu->power_peak;
   DEBUG2("Flops total: %lf, Last update %lf", area_total, cpu->last_update);
 
                              now) * cpu->power_peak;
   DEBUG2("Flops total: %lf, Last update %lf", area_total, cpu->last_update);
 
@@ -374,14 +374,14 @@ static void cpu_update_remaining_amount(cpu_ti_t cpu, double now)
 * \param       cpu             Cpu on which the actions are running
 * \param       now             Current time
 */
 * \param       cpu             Cpu on which the actions are running
 * \param       now             Current time
 */
-static void cpu_update_action_finish_date(cpu_ti_t cpu, double now)
+static void cpu_ti_update_action_finish_date(cpu_ti_t cpu, double now)
 {
 #define GENERIC_ACTION(action) action->generic_action
   surf_action_cpu_ti_t action;
   double sum_priority = 0.0, total_area, min_finish = -1;
 
 /* update remaning amount of actions */
 {
 #define GENERIC_ACTION(action) action->generic_action
   surf_action_cpu_ti_t action;
   double sum_priority = 0.0, total_area, min_finish = -1;
 
 /* update remaning amount of actions */
-  cpu_update_remaining_amount(cpu, now);
+  cpu_ti_update_remaining_amount(cpu, now);
 
   xbt_swag_foreach(action, cpu->action_set) {
     /* action not running, skip it */
 
   xbt_swag_foreach(action, cpu->action_set) {
     /* action not running, skip it */
@@ -418,7 +418,7 @@ static void cpu_update_action_finish_date(cpu_ti_t cpu, double now)
       total_area /= cpu->power_peak;
 
       GENERIC_ACTION(action).finish =
       total_area /= cpu->power_peak;
 
       GENERIC_ACTION(action).finish =
-        surf_cpu_solve_trace(cpu->avail_trace, now, total_area);
+        surf_cpu_ti_solve_trace(cpu->avail_trace, now, total_area);
       /* verify which event will happen before (max_duration or finish time) */
       if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION) &&
           (GENERIC_ACTION(action).start +
       /* verify which event will happen before (max_duration or finish time) */
       if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION) &&
           (GENERIC_ACTION(action).start +
@@ -439,12 +439,12 @@ static void cpu_update_action_finish_date(cpu_ti_t cpu, double now)
     DEBUG2("action(%p) index %d", action, action->index_heap);
     if (action->index_heap >= 0) {
       surf_action_cpu_ti_t heap_act =
     DEBUG2("action(%p) index %d", action, action->index_heap);
     if (action->index_heap >= 0) {
       surf_action_cpu_ti_t heap_act =
-        xbt_heap_remove(action_heap, action->index_heap);
+        xbt_heap_remove(cpu_ti_action_heap, action->index_heap);
       if (heap_act != action)
         DIE_IMPOSSIBLE;
     }
     if (min_finish != NO_MAX_DURATION)
       if (heap_act != action)
         DIE_IMPOSSIBLE;
     }
     if (min_finish != NO_MAX_DURATION)
-      xbt_heap_push(action_heap, action, min_finish);
+      xbt_heap_push(cpu_ti_action_heap, action, min_finish);
 
     DEBUG5
       ("Update finish time: Cpu(%s) Action: %p, Start Time: %lf Finish Time: %lf Max duration %lf",
 
     DEBUG5
       ("Update finish time: Cpu(%s) Action: %p, Start Time: %lf Finish Time: %lf Max duration %lf",
@@ -452,47 +452,47 @@ static void cpu_update_action_finish_date(cpu_ti_t cpu, double now)
        GENERIC_ACTION(action).finish, GENERIC_ACTION(action).max_duration);
   }
 /* remove from modified cpu */
        GENERIC_ACTION(action).finish, GENERIC_ACTION(action).max_duration);
   }
 /* remove from modified cpu */
-  xbt_swag_remove(cpu, modified_cpu);
+  xbt_swag_remove(cpu, cpu_ti_modified_cpu);
 #undef GENERIC_ACTION
 }
 
 #undef GENERIC_ACTION
 }
 
-static double share_resources(double now)
+static double cpu_ti_share_resources(double now)
 {
   cpu_ti_t cpu, cpu_next;
   double min_action_duration = -1;
 
 /* iterates over modified cpus to update share resources */
 {
   cpu_ti_t cpu, cpu_next;
   double min_action_duration = -1;
 
 /* iterates over modified cpus to update share resources */
-  xbt_swag_foreach_safe(cpu, cpu_next, modified_cpu) {
-    cpu_update_action_finish_date(cpu, now);
+  xbt_swag_foreach_safe(cpu, cpu_next, cpu_ti_modified_cpu) {
+    cpu_ti_update_action_finish_date(cpu, now);
   }
 /* get the min next event if heap not empty */
   }
 /* get the min next event if heap not empty */
-  if (xbt_heap_size(action_heap) > 0)
-    min_action_duration = xbt_heap_maxkey(action_heap) - now;
+  if (xbt_heap_size(cpu_ti_action_heap) > 0)
+    min_action_duration = xbt_heap_maxkey(cpu_ti_action_heap) - now;
 
   DEBUG1("Share resources, min next event date: %lf", min_action_duration);
 
   return min_action_duration;
 }
 
 
   DEBUG1("Share resources, min next event date: %lf", min_action_duration);
 
   return min_action_duration;
 }
 
-static void update_actions_state(double now, double delta)
+static void cpu_ti_update_actions_state(double now, double delta)
 {
 #define GENERIC_ACTION(action) action->generic_action
   surf_action_cpu_ti_t action;
 {
 #define GENERIC_ACTION(action) action->generic_action
   surf_action_cpu_ti_t action;
-  while ((xbt_heap_size(action_heap) > 0)
-         && (xbt_heap_maxkey(action_heap) <= now)) {
-    action = xbt_heap_pop(action_heap);
+  while ((xbt_heap_size(cpu_ti_action_heap) > 0)
+         && (xbt_heap_maxkey(cpu_ti_action_heap) <= now)) {
+    action = xbt_heap_pop(cpu_ti_action_heap);
     DEBUG1("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     GENERIC_ACTION(action).remains = 0;
     DEBUG1("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     GENERIC_ACTION(action).remains = 0;
-    cpu_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
+    cpu_ti_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
     /* update remaining amout of all actions */
     /* update remaining amout of all actions */
-    cpu_update_remaining_amount(action->cpu, surf_get_clock());
+    cpu_ti_update_remaining_amount(action->cpu, surf_get_clock());
   }
 #undef GENERIC_ACTION
 }
 
   }
 #undef GENERIC_ACTION
 }
 
-static void update_resource_state(void *id,
+static void cpu_ti_update_resource_state(void *id,
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
@@ -507,14 +507,14 @@ static void update_resource_state(void *id,
     DEBUG3("Finish trace date: %lf value %lf date %lf", surf_get_clock(),
            value, date);
     /* update remaining of actions and put in modified cpu swag */
     DEBUG3("Finish trace date: %lf value %lf date %lf", surf_get_clock(),
            value, date);
     /* update remaining of actions and put in modified cpu swag */
-    cpu_update_remaining_amount(cpu, date);
-    xbt_swag_insert(cpu, modified_cpu);
+    cpu_ti_update_remaining_amount(cpu, date);
+    xbt_swag_insert(cpu, cpu_ti_modified_cpu);
 
     power_trace = cpu->avail_trace->power_trace;
     xbt_dynar_get_cpy(power_trace->event_list,
                       xbt_dynar_length(power_trace->event_list) - 1, &val);
     /* free old trace */
 
     power_trace = cpu->avail_trace->power_trace;
     xbt_dynar_get_cpy(power_trace->event_list,
                       xbt_dynar_length(power_trace->event_list) - 1, &val);
     /* free old trace */
-    surf_cpu_free_tmgr(cpu->avail_trace);
+    surf_cpu_ti_free_tmgr(cpu->avail_trace);
     cpu->power_scale = val.value;
 
     trace = xbt_new0(s_surf_cpu_ti_tgmr_t, 1);
     cpu->power_scale = val.value;
 
     trace = xbt_new0(s_surf_cpu_ti_tgmr_t, 1);
@@ -542,10 +542,10 @@ static void update_resource_state(void *id,
             || surf_action_state_get((surf_action_t) action) ==
             SURF_ACTION_NOT_IN_THE_SYSTEM) {
           action->generic_action.finish = date;
             || surf_action_state_get((surf_action_t) action) ==
             SURF_ACTION_NOT_IN_THE_SYSTEM) {
           action->generic_action.finish = date;
-          cpu_action_state_set((surf_action_t) action, SURF_ACTION_FAILED);
+          cpu_ti_action_state_set((surf_action_t) action, SURF_ACTION_FAILED);
           if (action->index_heap >= 0) {
             surf_action_cpu_ti_t heap_act =
           if (action->index_heap >= 0) {
             surf_action_cpu_ti_t heap_act =
-              xbt_heap_remove(action_heap, action->index_heap);
+              xbt_heap_remove(cpu_ti_action_heap, action->index_heap);
             if (heap_act != action)
               DIE_IMPOSSIBLE;
           }
             if (heap_act != action)
               DIE_IMPOSSIBLE;
           }
@@ -562,7 +562,7 @@ static void update_resource_state(void *id,
   return;
 }
 
   return;
 }
 
-static surf_action_t execute(void *cpu, double size)
+static surf_action_t cpu_ti_execute(void *cpu, double size)
 {
   surf_action_cpu_ti_t action = NULL;
   cpu_ti_t CPU = cpu;
 {
   surf_action_cpu_ti_t action = NULL;
   cpu_ti_t CPU = cpu;
@@ -574,7 +574,7 @@ static surf_action_t execute(void *cpu, double size)
   action->cpu = cpu;
   action->index_heap = -1;
 
   action->cpu = cpu;
   action->index_heap = -1;
 
-  xbt_swag_insert(CPU, modified_cpu);
+  xbt_swag_insert(CPU, cpu_ti_modified_cpu);
 
   xbt_swag_insert(action, CPU->action_set);
 
 
   xbt_swag_insert(action, CPU->action_set);
 
@@ -585,12 +585,12 @@ static surf_action_t execute(void *cpu, double size)
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-static void action_update_index_heap(void *action, int i)
+static void cpu_ti_action_update_index_heap(void *action, int i)
 {
   ((surf_action_cpu_ti_t) action)->index_heap = i;
 }
 
 {
   ((surf_action_cpu_ti_t) action)->index_heap = i;
 }
 
-static surf_action_t action_sleep(void *cpu, double duration)
+static surf_action_t cpu_ti_action_sleep(void *cpu, double duration)
 {
   surf_action_cpu_ti_t action = NULL;
 
 {
   surf_action_cpu_ti_t action = NULL;
 
@@ -598,7 +598,7 @@ static surf_action_t action_sleep(void *cpu, double duration)
     duration = MAX(duration, MAXMIN_PRECISION);
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
     duration = MAX(duration, MAXMIN_PRECISION);
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
-  action = (surf_action_cpu_ti_t) execute(cpu, 1.0);
+  action = (surf_action_cpu_ti_t) cpu_ti_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   if (duration == NO_MAX_DURATION) {
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   if (duration == NO_MAX_DURATION) {
@@ -606,40 +606,40 @@ static surf_action_t action_sleep(void *cpu, double duration)
        is used to speed up update_resource_state  */
     xbt_swag_remove(action, ((surf_action_t) action)->state_set);
     ((surf_action_t) action)->state_set =
        is used to speed up update_resource_state  */
     xbt_swag_remove(action, ((surf_action_t) action)->state_set);
     ((surf_action_t) action)->state_set =
-      running_action_set_that_does_not_need_being_checked;
+      cpu_ti_running_action_set_that_does_not_need_being_checked;
     xbt_swag_insert(action, ((surf_action_t) action)->state_set);
   }
   XBT_OUT;
   return (surf_action_t) action;
 }
 
     xbt_swag_insert(action, ((surf_action_t) action)->state_set);
   }
   XBT_OUT;
   return (surf_action_t) action;
 }
 
-static void action_suspend(surf_action_t action)
+static void cpu_ti_action_suspend(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 1;
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 1;
-    xbt_heap_remove(action_heap, ((surf_action_cpu_ti_t) action)->index_heap);
-    xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+    xbt_heap_remove(cpu_ti_action_heap, ((surf_action_cpu_ti_t) action)->index_heap);
+    xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   }
   XBT_OUT;
 }
 
   }
   XBT_OUT;
 }
 
-static void action_resume(surf_action_t action)
+static void cpu_ti_action_resume(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 0;
 {
   XBT_IN1("(%p)", action);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 0;
-    xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+    xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   }
   XBT_OUT;
 }
 
   }
   XBT_OUT;
 }
 
-static int action_is_suspended(surf_action_t action)
+static int cpu_ti_action_is_suspended(surf_action_t action)
 {
   return (((surf_action_cpu_ti_t) action)->suspended == 1);
 }
 
 {
   return (((surf_action_cpu_ti_t) action)->suspended == 1);
 }
 
-static void action_set_max_duration(surf_action_t action, double duration)
+static void cpu_ti_action_set_max_duration(surf_action_t action, double duration)
 {
   surf_action_cpu_ti_t ACT = (surf_action_cpu_ti_t) action;
   double min_finish;
 {
   surf_action_cpu_ti_t ACT = (surf_action_cpu_ti_t) action;
   double min_finish;
@@ -659,38 +659,38 @@ static void action_set_max_duration(surf_action_t action, double duration)
 /* add in action heap */
   if (ACT->index_heap >= 0) {
     surf_action_cpu_ti_t heap_act =
 /* add in action heap */
   if (ACT->index_heap >= 0) {
     surf_action_cpu_ti_t heap_act =
-      xbt_heap_remove(action_heap, ACT->index_heap);
+      xbt_heap_remove(cpu_ti_action_heap, ACT->index_heap);
     if (heap_act != ACT)
       DIE_IMPOSSIBLE;
   }
     if (heap_act != ACT)
       DIE_IMPOSSIBLE;
   }
-  xbt_heap_push(action_heap, ACT, min_finish);
+  xbt_heap_push(cpu_ti_action_heap, ACT, min_finish);
 
   XBT_OUT;
 }
 
 
   XBT_OUT;
 }
 
-static void action_set_priority(surf_action_t action, double priority)
+static void cpu_ti_action_set_priority(surf_action_t action, double priority)
 {
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
 {
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
-  xbt_swag_insert(ACTION_GET_CPU(action), modified_cpu);
+  xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static double action_get_remains(surf_action_t action)
+static double cpu_ti_action_get_remains(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
 {
   XBT_IN1("(%p)", action);
-  cpu_update_remaining_amount((cpu_ti_t) ((surf_action_cpu_ti_t) action)->cpu,
+  cpu_ti_update_remaining_amount((cpu_ti_t) ((surf_action_cpu_ti_t) action)->cpu,
                               surf_get_clock());
   return action->remains;
   XBT_OUT;
 }
 
                               surf_get_clock());
   return action->remains;
   XBT_OUT;
 }
 
-static e_surf_resource_state_t get_state(void *cpu)
+static e_surf_resource_state_t cpu_ti_get_state(void *cpu)
 {
   return ((cpu_ti_t) cpu)->state_current;
 }
 
 {
   return ((cpu_ti_t) cpu)->state_current;
 }
 
-static double get_speed(void *cpu, double load)
+static double cpu_ti_get_speed(void *cpu, double load)
 {
   return load * (((cpu_ti_t) cpu)->power_peak);
 }
 {
   return load * (((cpu_ti_t) cpu)->power_peak);
 }
@@ -703,7 +703,7 @@ static double get_speed(void *cpu, double load)
 * \param a                             Time
 * \return CPU power scale
 */
 * \param a                             Time
 * \return CPU power scale
 */
-static double surf_cpu_get_power_scale(surf_cpu_ti_tgmr_t trace, double a)
+static double surf_cpu_ti_get_power_scale(surf_cpu_ti_tgmr_t trace, double a)
 {
   double reduced_a;
   int point;
 {
   double reduced_a;
   int point;
@@ -711,22 +711,22 @@ static double surf_cpu_get_power_scale(surf_cpu_ti_tgmr_t trace, double a)
 
   reduced_a = a - floor(a / trace->last_time) * trace->last_time;
   point =
 
   reduced_a = a - floor(a / trace->last_time) * trace->last_time;
   point =
-    surf_cpu_binary_search(trace->trace->time_points, reduced_a, 0,
+    surf_cpu_ti_binary_search(trace->trace->time_points, reduced_a, 0,
                            trace->trace->nb_points - 1);
   xbt_dynar_get_cpy(trace->power_trace->event_list, 0, &val);
   return val.value;
 }
 
                            trace->trace->nb_points - 1);
   xbt_dynar_get_cpy(trace->power_trace->event_list, 0, &val);
   return val.value;
 }
 
-static double get_available_speed(void *cpu)
+static double cpu_ti_get_available_speed(void *cpu)
 {
   cpu_ti_t CPU = cpu;
   CPU->power_scale =
 {
   cpu_ti_t CPU = cpu;
   CPU->power_scale =
-    surf_cpu_get_power_scale(CPU->avail_trace, surf_get_clock());
+    surf_cpu_ti_get_power_scale(CPU->avail_trace, surf_get_clock());
 /* number between 0 and 1 */
   return CPU->power_scale;
 }
 
 /* number between 0 and 1 */
   return CPU->power_scale;
 }
 
-static void finalize(void)
+static void cpu_ti_finalize(void)
 {
   void *cpu;
   xbt_dict_cursor_t cursor;
 {
   void *cpu;
   xbt_dict_cursor_t cursor;
@@ -734,59 +734,59 @@ static void finalize(void)
   xbt_dict_foreach(surf_model_resource_set(surf_cpu_model), cursor, key, cpu) {
     cpu_ti_t CPU = cpu;
     xbt_swag_free(CPU->action_set);
   xbt_dict_foreach(surf_model_resource_set(surf_cpu_model), cursor, key, cpu) {
     cpu_ti_t CPU = cpu;
     xbt_swag_free(CPU->action_set);
-    surf_cpu_free_tmgr(CPU->avail_trace);
+    surf_cpu_ti_free_tmgr(CPU->avail_trace);
   }
 
   surf_model_exit(surf_cpu_model);
   surf_cpu_model = NULL;
 
   }
 
   surf_model_exit(surf_cpu_model);
   surf_cpu_model = NULL;
 
-  xbt_swag_free(running_action_set_that_does_not_need_being_checked);
-  xbt_swag_free(modified_cpu);
-  running_action_set_that_does_not_need_being_checked = NULL;
-  xbt_heap_free(action_heap);
+  xbt_swag_free(cpu_ti_running_action_set_that_does_not_need_being_checked);
+  xbt_swag_free(cpu_ti_modified_cpu);
+  cpu_ti_running_action_set_that_does_not_need_being_checked = NULL;
+  xbt_heap_free(cpu_ti_action_heap);
 }
 
 }
 
-static void surf_cpu_model_init_internal(void)
+static void surf_cpu_ti_model_init_internal(void)
 {
   s_surf_action_t action;
   s_cpu_ti_t cpu;
 
   surf_cpu_model = surf_model_init();
 
 {
   s_surf_action_t action;
   s_cpu_ti_t cpu;
 
   surf_cpu_model = surf_model_init();
 
-  running_action_set_that_does_not_need_being_checked =
+  cpu_ti_running_action_set_that_does_not_need_being_checked =
     xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
     xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  modified_cpu = xbt_swag_new(xbt_swag_offset(cpu, modified_cpu_hookup));
+  cpu_ti_modified_cpu = xbt_swag_new(xbt_swag_offset(cpu, modified_cpu_hookup));
 
   surf_cpu_model->name = "CPU_TI";
 
 
   surf_cpu_model->name = "CPU_TI";
 
-  surf_cpu_model->action_unref = action_unref;
-  surf_cpu_model->action_cancel = action_cancel;
-  surf_cpu_model->action_state_set = cpu_action_state_set;
+  surf_cpu_model->action_unref = cpu_ti_action_unref;
+  surf_cpu_model->action_cancel = cpu_ti_action_cancel;
+  surf_cpu_model->action_state_set = cpu_ti_action_state_set;
 
 
-  surf_cpu_model->model_private->resource_used = resource_used;
-  surf_cpu_model->model_private->share_resources = share_resources;
-  surf_cpu_model->model_private->update_actions_state = update_actions_state;
+  surf_cpu_model->model_private->resource_used = cpu_ti_resource_used;
+  surf_cpu_model->model_private->share_resources = cpu_ti_share_resources;
+  surf_cpu_model->model_private->update_actions_state = cpu_ti_update_actions_state;
   surf_cpu_model->model_private->update_resource_state =
   surf_cpu_model->model_private->update_resource_state =
-    update_resource_state;
-  surf_cpu_model->model_private->finalize = finalize;
+    cpu_ti_update_resource_state;
+  surf_cpu_model->model_private->finalize = cpu_ti_finalize;
 
 
-  surf_cpu_model->suspend = action_suspend;
-  surf_cpu_model->resume = action_resume;
-  surf_cpu_model->is_suspended = action_is_suspended;
-  surf_cpu_model->set_max_duration = action_set_max_duration;
-  surf_cpu_model->set_priority = action_set_priority;
-  surf_cpu_model->get_remains = action_get_remains;
+  surf_cpu_model->suspend = cpu_ti_action_suspend;
+  surf_cpu_model->resume = cpu_ti_action_resume;
+  surf_cpu_model->is_suspended = cpu_ti_action_is_suspended;
+  surf_cpu_model->set_max_duration = cpu_ti_action_set_max_duration;
+  surf_cpu_model->set_priority = cpu_ti_action_set_priority;
+  surf_cpu_model->get_remains = cpu_ti_action_get_remains;
 
 
-  surf_cpu_model->extension.cpu.execute = execute;
-  surf_cpu_model->extension.cpu.sleep = action_sleep;
+  surf_cpu_model->extension.cpu.execute = cpu_ti_execute;
+  surf_cpu_model->extension.cpu.sleep = cpu_ti_action_sleep;
 
 
-  surf_cpu_model->extension.cpu.get_state = get_state;
-  surf_cpu_model->extension.cpu.get_speed = get_speed;
-  surf_cpu_model->extension.cpu.get_available_speed = get_available_speed;
+  surf_cpu_model->extension.cpu.get_state = cpu_ti_get_state;
+  surf_cpu_model->extension.cpu.get_speed = cpu_ti_get_speed;
+  surf_cpu_model->extension.cpu.get_available_speed = cpu_ti_get_available_speed;
 
 
-  action_heap = xbt_heap_new(8, NULL);
-  xbt_heap_set_update_callback(action_heap, action_update_index_heap);
+  cpu_ti_action_heap = xbt_heap_new(8, NULL);
+  xbt_heap_set_update_callback(cpu_ti_action_heap, cpu_ti_action_update_index_heap);
 
 }
 
 
 }
 
@@ -794,8 +794,8 @@ void surf_cpu_model_init_ti(const char *filename)
 {
   if (surf_cpu_model)
     return;
 {
   if (surf_cpu_model)
     return;
-  surf_cpu_model_init_internal();
-  define_callbacks(filename);
+  surf_cpu_ti_model_init_internal();
+  cpu_ti_define_callbacks(filename);
   xbt_dynar_push(model_list, &surf_cpu_model);
 }
 
   xbt_dynar_push(model_list, &surf_cpu_model);
 }
 
@@ -811,7 +811,7 @@ void surf_cpu_model_init_ti(const char *filename)
 * \param b                     End of interval
 * \return the integrate value. -1 if an error occurs.
 */
 * \param b                     End of interval
 * \return the integrate value. -1 if an error occurs.
 */
-static double surf_cpu_integrate_trace(surf_cpu_ti_tgmr_t trace, double a,
+static double surf_cpu_ti_integrate_trace(surf_cpu_ti_tgmr_t trace, double a,
                                        double b)
 {
   double first_chunk;
                                        double b)
 {
   double first_chunk;
@@ -840,18 +840,18 @@ static double surf_cpu_integrate_trace(surf_cpu_ti_tgmr_t trace, double a,
   b_index = (int) (floor(b / trace->last_time));
 
   if (a_index > b_index) {      /* Same chunk */
   b_index = (int) (floor(b / trace->last_time));
 
   if (a_index > b_index) {      /* Same chunk */
-    return surf_cpu_integrate_trace_simple(trace->trace,
+    return surf_cpu_ti_integrate_trace_simple(trace->trace,
                                            a - (a_index -
                                                 1) * trace->last_time,
                                            b - (b_index) * trace->last_time);
   }
 
                                            a - (a_index -
                                                 1) * trace->last_time,
                                            b - (b_index) * trace->last_time);
   }
 
-  first_chunk = surf_cpu_integrate_trace_simple(trace->trace,
+  first_chunk = surf_cpu_ti_integrate_trace_simple(trace->trace,
                                                 a - (a_index -
                                                      1) * trace->last_time,
                                                 trace->last_time);
   middle_chunk = (b_index - a_index) * trace->total;
                                                 a - (a_index -
                                                      1) * trace->last_time,
                                                 trace->last_time);
   middle_chunk = (b_index - a_index) * trace->total;
-  last_chunk = surf_cpu_integrate_trace_simple(trace->trace,
+  last_chunk = surf_cpu_ti_integrate_trace_simple(trace->trace,
                                                0.0,
                                                b -
                                                (b_index) * trace->last_time);
                                                0.0,
                                                b -
                                                (b_index) * trace->last_time);
@@ -871,12 +871,12 @@ static double surf_cpu_integrate_trace(surf_cpu_ti_tgmr_t trace, double a,
  * \param b    Final point
  * \return     Integral
 */
  * \param b    Final point
  * \return     Integral
 */
-static double surf_cpu_integrate_trace_simple(surf_cpu_ti_trace_t trace,
+static double surf_cpu_ti_integrate_trace_simple(surf_cpu_ti_trace_t trace,
                                               double a, double b)
 {
                                               double a, double b)
 {
-  return surf_cpu_integrate_trace_simple_point(trace,
+  return surf_cpu_ti_integrate_trace_simple_point(trace,
                                                b) -
                                                b) -
-    surf_cpu_integrate_trace_simple_point(trace, a);
+    surf_cpu_ti_integrate_trace_simple_point(trace, a);
 }
 
 /**
 }
 
 /**
@@ -885,14 +885,14 @@ static double surf_cpu_integrate_trace_simple(surf_cpu_ti_trace_t trace,
  * \param a                            point
  * \return     Integral
 */
  * \param a                            point
  * \return     Integral
 */
-static double surf_cpu_integrate_trace_simple_point(surf_cpu_ti_trace_t trace,
+static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t trace,
                                                     double a)
 {
   double integral = 0;
   int ind;
   double a_aux = a;
   ind =
                                                     double a)
 {
   double integral = 0;
   int ind;
   double a_aux = a;
   ind =
-    surf_cpu_binary_search(trace->time_points, a, 0, trace->nb_points - 1);
+    surf_cpu_ti_binary_search(trace->time_points, a, 0, trace->nb_points - 1);
   integral += trace->integral[ind];
   DEBUG7("a %lf ind %d integral %lf ind + 1 %lf ind %lf time +1 %lf time %lf",
          a, ind, integral, trace->integral[ind + 1], trace->integral[ind],
   integral += trace->integral[ind];
   DEBUG7("a %lf ind %d integral %lf ind + 1 %lf ind %lf time +1 %lf time %lf",
          a, ind, integral, trace->integral[ind + 1], trace->integral[ind],
@@ -921,7 +921,7 @@ static double surf_cpu_integrate_trace_simple_point(surf_cpu_ti_trace_t trace,
 * \param amount        Amount to be executed
 * \return      End time
 */
 * \param amount        Amount to be executed
 * \return      End time
 */
-static double surf_cpu_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
+static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
                                    double amount)
 {
   int quotient;
                                    double amount)
 {
   int quotient;
@@ -972,7 +972,7 @@ static double surf_cpu_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
         fprintf(stderr,"reduced_amount = %.2f\n",reduced_amount);
  */
   reduced_b =
         fprintf(stderr,"reduced_amount = %.2f\n",reduced_amount);
  */
   reduced_b =
-    surf_cpu_solve_trace_somewhat_simple(trace, reduced_a, reduced_amount);
+    surf_cpu_ti_solve_trace_somewhat_simple(trace, reduced_a, reduced_amount);
 
 /* Re-map to the original b and amount */
   b = (trace->last_time) * (int) (floor(a / trace->last_time)) +
 
 /* Re-map to the original b and amount */
   b = (trace->last_time) * (int) (floor(a / trace->last_time)) +
@@ -987,23 +987,23 @@ static double surf_cpu_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
 * and a <=trace->last_time
 *
 */
 * and a <=trace->last_time
 *
 */
-static double surf_cpu_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t trace,
+static double surf_cpu_ti_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t trace,
                                                    double a, double amount)
 {
   double amount_till_end;
   double b;
 
   DEBUG2("Solve integral: [%.2f, amount=%.2f]", a, amount);
                                                    double a, double amount)
 {
   double amount_till_end;
   double b;
 
   DEBUG2("Solve integral: [%.2f, amount=%.2f]", a, amount);
-  amount_till_end = surf_cpu_integrate_trace(trace, a, trace->last_time);
+  amount_till_end = surf_cpu_ti_integrate_trace(trace, a, trace->last_time);
 /*
         fprintf(stderr,"amount_till_end=%.2f\n",amount_till_end);
  */
 
   if (amount_till_end > amount) {
 /*
         fprintf(stderr,"amount_till_end=%.2f\n",amount_till_end);
  */
 
   if (amount_till_end > amount) {
-    b = surf_cpu_solve_trace_simple(trace->trace, a, amount);
+    b = surf_cpu_ti_solve_trace_simple(trace->trace, a, amount);
   } else {
     b = trace->last_time +
   } else {
     b = trace->last_time +
-      surf_cpu_solve_trace_simple(trace->trace, 0.0,
+      surf_cpu_ti_solve_trace_simple(trace->trace, 0.0,
                                   amount - amount_till_end);
   }
   return b;
                                   amount - amount_till_end);
   }
   return b;
@@ -1017,15 +1017,15 @@ static double surf_cpu_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t trace,
  * \param amount       Amount of flops 
  * \return The date when amount is available.
 */
  * \param amount       Amount of flops 
  * \return The date when amount is available.
 */
-static double surf_cpu_solve_trace_simple(surf_cpu_ti_trace_t trace, double a,
+static double surf_cpu_ti_solve_trace_simple(surf_cpu_ti_trace_t trace, double a,
                                           double amount)
 {
   double integral_a;
   int ind;
   double time;
                                           double amount)
 {
   double integral_a;
   int ind;
   double time;
-  integral_a = surf_cpu_integrate_trace_simple_point(trace, a);
+  integral_a = surf_cpu_ti_integrate_trace_simple_point(trace, a);
   ind =
   ind =
-    surf_cpu_binary_search(trace->integral, integral_a + amount, 0,
+    surf_cpu_ti_binary_search(trace->integral, integral_a + amount, 0,
                            trace->nb_points - 1);
   time = trace->time_points[ind];
   time +=
                            trace->nb_points - 1);
   time = trace->time_points[ind];
   time +=
@@ -1047,7 +1047,7 @@ static double surf_cpu_solve_trace_simple(surf_cpu_ti_trace_t trace, double a,
  * \param high         Upper bound to search in array
  * \return Index of point
 */
  * \param high         Upper bound to search in array
  * \return Index of point
 */
-static int surf_cpu_binary_search(double *array, double a, int low, int high)
+static int surf_cpu_ti_binary_search(double *array, double a, int low, int high)
 {
   int mid = low + (high - low) / 2;
   DEBUG5("a %lf low %d high %d mid %d value %lf", a, low, high, mid,
 {
   int mid = low + (high - low) / 2;
   DEBUG5("a %lf low %d high %d mid %d value %lf", a, low, high, mid,
@@ -1060,7 +1060,7 @@ static int surf_cpu_binary_search(double *array, double a, int low, int high)
     return mid;
 
   if (array[mid] < a)
     return mid;
 
   if (array[mid] < a)
-    return surf_cpu_binary_search(array, a, mid + 1, high);
+    return surf_cpu_ti_binary_search(array, a, mid + 1, high);
   else
   else
-    return surf_cpu_binary_search(array, a, low, mid - 1);
+    return surf_cpu_ti_binary_search(array, a, low, mid - 1);
 }
 }
index b32a57c..384734d 100644 (file)
@@ -23,7 +23,7 @@ double weight_S_parameter = 0.0;        /* default value */
 double sg_tcp_gamma = 0.0;
 
 
 double sg_tcp_gamma = 0.0;
 
 
-static link_CM02_t link_new(char *name,
+static link_CM02_t net_link_new(char *name,
                             double bw_initial,
                             tmgr_trace_t bw_trace,
                             double lat_initial,
                             double bw_initial,
                             tmgr_trace_t bw_trace,
                             double lat_initial,
@@ -60,7 +60,7 @@ static link_CM02_t link_new(char *name,
   return nw_link;
 }
 
   return nw_link;
 }
 
-static void parse_link_init(void)
+static void net_parse_link_init(void)
 {
   char *name_link;
   double bw_initial;
 {
   char *name_link;
   double bw_initial;
@@ -93,13 +93,13 @@ static void parse_link_init(void)
 
   state_trace = tmgr_trace_new(A_surfxml_link_state_file);
 
 
   state_trace = tmgr_trace_new(A_surfxml_link_state_file);
 
-  link_new(name_link, bw_initial, bw_trace,
+  net_link_new(name_link, bw_initial, bw_trace,
            lat_initial, lat_trace, state_initial_link, state_trace,
            policy_initial_link, xbt_dict_new());
 
 }
 
            lat_initial, lat_trace, state_initial_link, state_trace,
            policy_initial_link, xbt_dict_new());
 
 }
 
-static void add_traces(void)
+static void net_add_traces(void)
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
@@ -152,20 +152,20 @@ static void add_traces(void)
   }
 }
 
   }
 }
 
-static void define_callbacks(const char *file)
+static void net_define_callbacks(const char *file)
 {
   /* Figuring out the network links */
 {
   /* Figuring out the network links */
-  surfxml_add_callback(STag_surfxml_link_cb_list, &parse_link_init);
-  surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);
+  surfxml_add_callback(STag_surfxml_link_cb_list, &net_parse_link_init);
+  surfxml_add_callback(ETag_surfxml_platform_cb_list, &net_add_traces);
 }
 
 }
 
-static int resource_used(void *resource_id)
+static int net_resource_used(void *resource_id)
 {
   return lmm_constraint_used(network_maxmin_system,
                              ((surf_resource_lmm_t) resource_id)->constraint);
 }
 
 {
   return lmm_constraint_used(network_maxmin_system,
                              ((surf_resource_lmm_t) resource_id)->constraint);
 }
 
-static int action_unref(surf_action_t action)
+static int net_action_unref(surf_action_t action)
 {
   action->refcount--;
   if (!action->refcount) {
 {
   action->refcount--;
   if (!action->refcount) {
@@ -179,22 +179,22 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
   return 0;
 }
 
-static void action_cancel(surf_action_t action)
+static void net_action_cancel(surf_action_t action)
 {
   return;
 }
 
 {
   return;
 }
 
-static void action_recycle(surf_action_t action)
+static void net_action_recycle(surf_action_t action)
 {
   return;
 }
 
 {
   return;
 }
 
-static double action_get_remains(surf_action_t action)
+static double net_action_get_remains(surf_action_t action)
 {
   return action->remains;
 }
 
 {
   return action->remains;
 }
 
-static double share_resources(double now)
+static double net_share_resources(double now)
 {
   s_surf_action_network_CM02_t s_action;
   surf_action_network_CM02_t action = NULL;
 {
   s_surf_action_network_CM02_t s_action;
   surf_action_network_CM02_t action = NULL;
@@ -220,7 +220,7 @@ static double share_resources(double now)
   return min;
 }
 
   return min;
 }
 
-static void update_actions_state(double now, double delta)
+static void net_update_actions_state(double now, double delta)
 {
   double deltap = 0.0;
   surf_action_network_CM02_t action = NULL;
 {
   double deltap = 0.0;
   surf_action_network_CM02_t action = NULL;
@@ -266,7 +266,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
   return;
 }
 
-static void update_resource_state(void *id,
+static void net_update_resource_state(void *id,
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
@@ -360,7 +360,7 @@ static void update_resource_state(void *id,
   return;
 }
 
   return;
 }
 
-static surf_action_t communicate(const char *src_name, const char *dst_name,
+static surf_action_t net_communicate(const char *src_name, const char *dst_name,
                                  int src, int dst, double size, double rate)
 {
   surf_action_network_CM02_t action = NULL;
                                  int src, int dst, double size, double rate)
 {
   surf_action_network_CM02_t action = NULL;
@@ -449,23 +449,23 @@ static surf_action_t communicate(const char *src_name, const char *dst_name,
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-static double get_link_bandwidth(const void *link)
+static double net_get_link_bandwidth(const void *link)
 {
   surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
   return lmm->power.peak * lmm->power.scale;
 }
 
 {
   surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
   return lmm->power.peak * lmm->power.scale;
 }
 
-static double get_link_latency(const void *link)
+static double net_get_link_latency(const void *link)
 {
   return ((link_CM02_t) link)->lat_current;
 }
 
 {
   return ((link_CM02_t) link)->lat_current;
 }
 
-static int link_shared(const void *link)
+static int net_link_shared(const void *link)
 {
   return lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
 }
 
 {
   return lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
 }
 
-static void action_suspend(surf_action_t action)
+static void net_action_suspend(surf_action_t action)
 {
   ((surf_action_network_CM02_t) action)->suspended = 1;
   lmm_update_variable_weight(network_maxmin_system,
 {
   ((surf_action_network_CM02_t) action)->suspended = 1;
   lmm_update_variable_weight(network_maxmin_system,
@@ -473,7 +473,7 @@ static void action_suspend(surf_action_t action)
                              0.0);
 }
 
                              0.0);
 }
 
-static void action_resume(surf_action_t action)
+static void net_action_resume(surf_action_t action)
 {
   if (((surf_action_network_CM02_t) action)->suspended) {
     lmm_update_variable_weight(network_maxmin_system,
 {
   if (((surf_action_network_CM02_t) action)->suspended) {
     lmm_update_variable_weight(network_maxmin_system,
@@ -484,17 +484,17 @@ static void action_resume(surf_action_t action)
   }
 }
 
   }
 }
 
-static int action_is_suspended(surf_action_t action)
+static int net_action_is_suspended(surf_action_t action)
 {
   return ((surf_action_network_CM02_t) action)->suspended;
 }
 
 {
   return ((surf_action_network_CM02_t) action)->suspended;
 }
 
-static void action_set_max_duration(surf_action_t action, double duration)
+static void net_action_set_max_duration(surf_action_t action, double duration)
 {
   action->max_duration = duration;
 }
 
 {
   action->max_duration = duration;
 }
 
-static void finalize(void)
+static void net_finalize(void)
 {
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
 {
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
@@ -509,35 +509,35 @@ static void surf_network_model_init_internal(void)
   surf_network_model = surf_model_init();
 
   surf_network_model->name = "network";
   surf_network_model = surf_model_init();
 
   surf_network_model->name = "network";
-  surf_network_model->action_unref = action_unref;
-  surf_network_model->action_cancel = action_cancel;
-  surf_network_model->action_recycle = action_recycle;
-  surf_network_model->get_remains = action_get_remains;
+  surf_network_model->action_unref = net_action_unref;
+  surf_network_model->action_cancel = net_action_cancel;
+  surf_network_model->action_recycle = net_action_recycle;
+  surf_network_model->get_remains = net_action_get_remains;
 
 
-  surf_network_model->model_private->resource_used = resource_used;
-  surf_network_model->model_private->share_resources = share_resources;
+  surf_network_model->model_private->resource_used = net_resource_used;
+  surf_network_model->model_private->share_resources = net_share_resources;
   surf_network_model->model_private->update_actions_state =
   surf_network_model->model_private->update_actions_state =
-    update_actions_state;
+    net_update_actions_state;
   surf_network_model->model_private->update_resource_state =
   surf_network_model->model_private->update_resource_state =
-    update_resource_state;
-  surf_network_model->model_private->finalize = finalize;
+    net_update_resource_state;
+  surf_network_model->model_private->finalize = net_finalize;
 
 
-  surf_network_model->suspend = action_suspend;
-  surf_network_model->resume = action_resume;
-  surf_network_model->is_suspended = action_is_suspended;
-  surf_cpu_model->set_max_duration = action_set_max_duration;
+  surf_network_model->suspend = net_action_suspend;
+  surf_network_model->resume = net_action_resume;
+  surf_network_model->is_suspended = net_action_is_suspended;
+  surf_cpu_model->set_max_duration = net_action_set_max_duration;
 
 
-  surf_network_model->extension.network.communicate = communicate;
+  surf_network_model->extension.network.communicate = net_communicate;
   surf_network_model->extension.network.get_link_bandwidth =
   surf_network_model->extension.network.get_link_bandwidth =
-    get_link_bandwidth;
-  surf_network_model->extension.network.get_link_latency = get_link_latency;
-  surf_network_model->extension.network.link_shared = link_shared;
+    net_get_link_bandwidth;
+  surf_network_model->extension.network.get_link_latency = net_get_link_latency;
+  surf_network_model->extension.network.link_shared = net_link_shared;
 
   if (!network_maxmin_system)
     network_maxmin_system = lmm_system_new();
 
   routing_model_create(sizeof(link_CM02_t),
 
   if (!network_maxmin_system)
     network_maxmin_system = lmm_system_new();
 
   routing_model_create(sizeof(link_CM02_t),
-                       link_new(xbt_strdup("__loopback__"),
+                       net_link_new(xbt_strdup("__loopback__"),
                                 498000000, NULL, 0.000015, NULL,
                                 SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE,
                                 NULL));
                                 498000000, NULL, 0.000015, NULL,
                                 SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE,
                                 NULL));
@@ -552,7 +552,7 @@ void surf_network_model_init_LegrandVelho(const char *filename)
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
-  define_callbacks(filename);
+  net_define_callbacks(filename);
   xbt_dynar_push(model_list, &surf_network_model);
   network_solve = lmm_solve;
 
   xbt_dynar_push(model_list, &surf_network_model);
   network_solve = lmm_solve;
 
@@ -581,7 +581,7 @@ void surf_network_model_init_CM02(const char *filename)
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
-  define_callbacks(filename);
+  net_define_callbacks(filename);
   xbt_dynar_push(model_list, &surf_network_model);
   network_solve = lmm_solve;
 
   xbt_dynar_push(model_list, &surf_network_model);
   network_solve = lmm_solve;
 
@@ -594,7 +594,7 @@ void surf_network_model_init_Reno(const char *filename)
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
-  define_callbacks(filename);
+  net_define_callbacks(filename);
 
   xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
 
   xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
@@ -614,7 +614,7 @@ void surf_network_model_init_Reno2(const char *filename)
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
-  define_callbacks(filename);
+  net_define_callbacks(filename);
 
   xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
 
   xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
@@ -634,7 +634,7 @@ void surf_network_model_init_Vegas(const char *filename)
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
   if (surf_network_model)
     return;
   surf_network_model_init_internal();
-  define_callbacks(filename);
+  net_define_callbacks(filename);
 
   xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
 
   xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
index df8eaf5..572ba02 100644 (file)
@@ -22,23 +22,23 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 static random_data_t random_latency = NULL;
 static int host_number = 0;
 
 static random_data_t random_latency = NULL;
 static int host_number = 0;
 
-static void count_hosts(void)
+static void netcste_count_hosts(void)
 {
   host_number++;
 }
 
 {
   host_number++;
 }
 
-static void define_callbacks(const char *file)
+static void netcste_define_callbacks(const char *file)
 {
   /* Figuring out the network links */
 {
   /* Figuring out the network links */
-  surfxml_add_callback(STag_surfxml_host_cb_list, &count_hosts);
+  surfxml_add_callback(STag_surfxml_host_cb_list, &netcste_count_hosts);
 }
 
 }
 
-static int resource_used(void *resource_id)
+static int netcste_resource_used(void *resource_id)
 {
   return 0;
 }
 
 {
   return 0;
 }
 
-static int action_unref(surf_action_t action)
+static int netcste_action_unref(surf_action_t action)
 {
   action->refcount--;
   if (!action->refcount) {
 {
   action->refcount--;
   if (!action->refcount) {
@@ -49,22 +49,22 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
   return 0;
 }
 
-static void action_cancel(surf_action_t action)
+static void netcste_action_cancel(surf_action_t action)
 {
   return;
 }
 
 {
   return;
 }
 
-static void action_recycle(surf_action_t action)
+static void netcste_action_recycle(surf_action_t action)
 {
   return;
 }
 
 {
   return;
 }
 
-static double action_get_remains(surf_action_t action)
+static double netcste_action_get_remains(surf_action_t action)
 {
   return action->remains;
 }
 
 {
   return action->remains;
 }
 
-static double share_resources(double now)
+static double netcste_share_resources(double now)
 {
   surf_action_network_Constant_t action = NULL;
   xbt_swag_t running_actions = surf_network_model->states.running_action_set;
 {
   surf_action_network_Constant_t action = NULL;
   xbt_swag_t running_actions = surf_network_model->states.running_action_set;
@@ -82,7 +82,7 @@ static double share_resources(double now)
   return min;
 }
 
   return min;
 }
 
-static void update_actions_state(double now, double delta)
+static void netcste_update_actions_state(double now, double delta)
 {
   surf_action_network_Constant_t action = NULL;
   surf_action_network_Constant_t next_action = NULL;
 {
   surf_action_network_Constant_t action = NULL;
   surf_action_network_Constant_t next_action = NULL;
@@ -114,14 +114,14 @@ static void update_actions_state(double now, double delta)
   }
 }
 
   }
 }
 
-static void update_resource_state(void *id,
+static void netcste_update_resource_state(void *id,
                                   tmgr_trace_event_t event_type,
                                   double value, double time)
 {
   DIE_IMPOSSIBLE;
 }
 
                                   tmgr_trace_event_t event_type,
                                   double value, double time)
 {
   DIE_IMPOSSIBLE;
 }
 
-static surf_action_t communicate(const char *src_name, const char *dst_name,
+static surf_action_t netcste_communicate(const char *src_name, const char *dst_name,
                                  int src, int dst, double size, double rate)
 {
   surf_action_network_Constant_t action = NULL;
                                  int src, int dst, double size, double rate)
 {
   surf_action_network_Constant_t action = NULL;
@@ -149,17 +149,17 @@ static surf_action_t communicate(const char *src_name, const char *dst_name,
 }
 
 /* returns an array of link_Constant_t */
 }
 
 /* returns an array of link_Constant_t */
-static xbt_dynar_t get_route(void *src, void *dst)
+static xbt_dynar_t netcste_get_route(void *src, void *dst)
 {
   xbt_die("Calling this function does not make any sense");
 }
 
 {
   xbt_die("Calling this function does not make any sense");
 }
 
-static double get_link_bandwidth(const void *link)
+static double netcste_get_link_bandwidth(const void *link)
 {
   DIE_IMPOSSIBLE;
 }
 
 {
   DIE_IMPOSSIBLE;
 }
 
-static double get_link_latency(const void *link)
+static double netcste_get_link_latency(const void *link)
 {
   DIE_IMPOSSIBLE;
 }
 {
   DIE_IMPOSSIBLE;
 }
@@ -169,28 +169,28 @@ static int link_shared(const void *link)
   DIE_IMPOSSIBLE;
 }
 
   DIE_IMPOSSIBLE;
 }
 
-static void action_suspend(surf_action_t action)
+static void netcste_action_suspend(surf_action_t action)
 {
   ((surf_action_network_Constant_t) action)->suspended = 1;
 }
 
 {
   ((surf_action_network_Constant_t) action)->suspended = 1;
 }
 
-static void action_resume(surf_action_t action)
+static void netcste_action_resume(surf_action_t action)
 {
   if (((surf_action_network_Constant_t) action)->suspended)
     ((surf_action_network_Constant_t) action)->suspended = 0;
 }
 
 {
   if (((surf_action_network_Constant_t) action)->suspended)
     ((surf_action_network_Constant_t) action)->suspended = 0;
 }
 
-static int action_is_suspended(surf_action_t action)
+static int netcste_action_is_suspended(surf_action_t action)
 {
   return ((surf_action_network_Constant_t) action)->suspended;
 }
 
 {
   return ((surf_action_network_Constant_t) action)->suspended;
 }
 
-static void action_set_max_duration(surf_action_t action, double duration)
+static void netcste_action_set_max_duration(surf_action_t action, double duration)
 {
   action->max_duration = duration;
 }
 
 {
   action->max_duration = duration;
 }
 
-static void finalize(void)
+static void netcste_finalize(void)
 {
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
 {
   surf_model_exit(surf_network_model);
   surf_network_model = NULL;
@@ -207,33 +207,33 @@ void surf_network_model_init_Constant(const char *filename)
 
   INFO0("Blah");
   surf_network_model->name = "constant time network";
 
   INFO0("Blah");
   surf_network_model->name = "constant time network";
-  surf_network_model->action_unref = action_unref;
-  surf_network_model->action_cancel = action_cancel;
-  surf_network_model->action_recycle = action_recycle;
-  surf_network_model->get_remains = action_get_remains;
+  surf_network_model->action_unref = netcste_action_unref;
+  surf_network_model->action_cancel = netcste_action_cancel;
+  surf_network_model->action_recycle = netcste_action_recycle;
+  surf_network_model->get_remains = netcste_action_get_remains;
 
 
-  surf_network_model->model_private->resource_used = resource_used;
-  surf_network_model->model_private->share_resources = share_resources;
+  surf_network_model->model_private->resource_used = netcste_resource_used;
+  surf_network_model->model_private->share_resources = netcste_share_resources;
   surf_network_model->model_private->update_actions_state =
   surf_network_model->model_private->update_actions_state =
-    update_actions_state;
+    netcste_update_actions_state;
   surf_network_model->model_private->update_resource_state =
   surf_network_model->model_private->update_resource_state =
-    update_resource_state;
-  surf_network_model->model_private->finalize = finalize;
+    netcste_update_resource_state;
+  surf_network_model->model_private->finalize = netcste_finalize;
 
 
-  surf_network_model->suspend = action_suspend;
-  surf_network_model->resume = action_resume;
-  surf_network_model->is_suspended = action_is_suspended;
-  surf_cpu_model->set_max_duration = action_set_max_duration;
+  surf_network_model->suspend = netcste_action_suspend;
+  surf_network_model->resume = netcste_action_resume;
+  surf_network_model->is_suspended = netcste_action_is_suspended;
+  surf_cpu_model->set_max_duration = netcste_action_set_max_duration;
 
 
-  surf_network_model->extension.network.communicate = communicate;
+  surf_network_model->extension.network.communicate = netcste_communicate;
   surf_network_model->extension.network.get_link_bandwidth =
   surf_network_model->extension.network.get_link_bandwidth =
-    get_link_bandwidth;
-  surf_network_model->extension.network.get_link_latency = get_link_latency;
+    netcste_get_link_bandwidth;
+  surf_network_model->extension.network.get_link_latency = netcste_get_link_latency;
   surf_network_model->extension.network.link_shared = link_shared;
 
   if (!random_latency)
     random_latency = random_new(RAND, 100, 0.0, 1.0, .125, .034);
   surf_network_model->extension.network.link_shared = link_shared;
 
   if (!random_latency)
     random_latency = random_new(RAND, 100, 0.0, 1.0, .125, .034);
-  define_callbacks(filename);
+  netcste_define_callbacks(filename);
   xbt_dynar_push(model_list, &surf_network_model);
 
   update_model_description(surf_network_model_description,
   xbt_dynar_push(model_list, &surf_network_model);
 
   update_model_description(surf_network_model_description,
index 3a44e5c..b859aa3 100644 (file)
@@ -52,42 +52,42 @@ void create_workstations(void)
   }
 }
 
   }
 }
 
-static int resource_used(void *resource_id)
+static int ws_resource_used(void *resource_id)
 {
   THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
 }
 
 {
   THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
 }
 
-static void parallel_action_cancel(surf_action_t action)
+static void ws_parallel_action_cancel(surf_action_t action)
 {
   THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
 }
 
 {
   THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
 }
 
-static int parallel_action_free(surf_action_t action)
+static int ws_parallel_action_free(surf_action_t action)
 {
   THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
 }
 
 {
   THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
 }
 
-static int action_unref(surf_action_t action)
+static int ws_action_unref(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
     return surf_network_model->action_unref(action);
   else if (action->model_type == surf_cpu_model)
     return surf_cpu_model->action_unref(action);
   else if (action->model_type == surf_workstation_model)
 {
   if (action->model_type == surf_network_model)
     return surf_network_model->action_unref(action);
   else if (action->model_type == surf_cpu_model)
     return surf_cpu_model->action_unref(action);
   else if (action->model_type == surf_workstation_model)
-    return parallel_action_free(action);
+    return ws_parallel_action_free(action);
   else
     DIE_IMPOSSIBLE;
   return 0;
 }
 
   else
     DIE_IMPOSSIBLE;
   return 0;
 }
 
-static void action_cancel(surf_action_t action)
+static void ws_action_cancel(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
     surf_network_model->action_cancel(action);
   else if (action->model_type == surf_cpu_model)
     surf_cpu_model->action_cancel(action);
   else if (action->model_type == surf_workstation_model)
 {
   if (action->model_type == surf_network_model)
     surf_network_model->action_cancel(action);
   else if (action->model_type == surf_cpu_model)
     surf_cpu_model->action_cancel(action);
   else if (action->model_type == surf_workstation_model)
-    parallel_action_cancel(action);
+    ws_parallel_action_cancel(action);
   else
     DIE_IMPOSSIBLE;
   return;
   else
     DIE_IMPOSSIBLE;
   return;
@@ -107,36 +107,36 @@ static void ws_action_state_set(surf_action_t action,
   return;
 }
 
   return;
 }
 
-static double share_resources(double now)
+static double ws_share_resources(double now)
 {
   return -1.0;
 }
 
 {
   return -1.0;
 }
 
-static void update_actions_state(double now, double delta)
+static void ws_update_actions_state(double now, double delta)
 {
   return;
 }
 
 {
   return;
 }
 
-static void update_resource_state(void *id,
+static void ws_update_resource_state(void *id,
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
   THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
 }
 
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
   THROW_IMPOSSIBLE;             /* This model does not implement parallel tasks */
 }
 
-static surf_action_t execute(void *workstation, double size)
+static surf_action_t ws_execute(void *workstation, double size)
 {
   return surf_cpu_model->extension.cpu.
     execute(((workstation_CLM03_t) workstation)->cpu, size);
 }
 
 {
   return surf_cpu_model->extension.cpu.
     execute(((workstation_CLM03_t) workstation)->cpu, size);
 }
 
-static surf_action_t action_sleep(void *workstation, double duration)
+static surf_action_t ws_action_sleep(void *workstation, double duration)
 {
   return surf_cpu_model->extension.cpu.
     sleep(((workstation_CLM03_t) workstation)->cpu, duration);
 }
 
 {
   return surf_cpu_model->extension.cpu.
     sleep(((workstation_CLM03_t) workstation)->cpu, duration);
 }
 
-static void action_suspend(surf_action_t action)
+static void ws_action_suspend(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
     surf_network_model->suspend(action);
 {
   if (action->model_type == surf_network_model)
     surf_network_model->suspend(action);
@@ -146,7 +146,7 @@ static void action_suspend(surf_action_t action)
     DIE_IMPOSSIBLE;
 }
 
     DIE_IMPOSSIBLE;
 }
 
-static void action_resume(surf_action_t action)
+static void ws_action_resume(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
     surf_network_model->resume(action);
 {
   if (action->model_type == surf_network_model)
     surf_network_model->resume(action);
@@ -156,7 +156,7 @@ static void action_resume(surf_action_t action)
     DIE_IMPOSSIBLE;
 }
 
     DIE_IMPOSSIBLE;
 }
 
-static int action_is_suspended(surf_action_t action)
+static int ws_action_is_suspended(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
     return surf_network_model->is_suspended(action);
 {
   if (action->model_type == surf_network_model)
     return surf_network_model->is_suspended(action);
@@ -165,7 +165,7 @@ static int action_is_suspended(surf_action_t action)
   DIE_IMPOSSIBLE;
 }
 
   DIE_IMPOSSIBLE;
 }
 
-static void action_set_max_duration(surf_action_t action, double duration)
+static void ws_action_set_max_duration(surf_action_t action, double duration)
 {
   if (action->model_type == surf_network_model)
     surf_network_model->set_max_duration(action, duration);
 {
   if (action->model_type == surf_network_model)
     surf_network_model->set_max_duration(action, duration);
@@ -175,7 +175,7 @@ static void action_set_max_duration(surf_action_t action, double duration)
     DIE_IMPOSSIBLE;
 }
 
     DIE_IMPOSSIBLE;
 }
 
-static void action_set_priority(surf_action_t action, double priority)
+static void ws_action_set_priority(surf_action_t action, double priority)
 {
   if (action->model_type == surf_network_model)
     surf_network_model->set_priority(action, priority);
 {
   if (action->model_type == surf_network_model)
     surf_network_model->set_priority(action, priority);
@@ -185,7 +185,7 @@ static void action_set_priority(surf_action_t action, double priority)
     DIE_IMPOSSIBLE;
 }
 
     DIE_IMPOSSIBLE;
 }
 
-static double action_get_remains(surf_action_t action)
+static double ws_action_get_remains(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
     return surf_network_model->get_remains(action);
 {
   if (action->model_type == surf_network_model)
     return surf_network_model->get_remains(action);
@@ -194,7 +194,7 @@ static double action_get_remains(surf_action_t action)
   DIE_IMPOSSIBLE;
 }
 
   DIE_IMPOSSIBLE;
 }
 
-static surf_action_t communicate(void *workstation_src,
+static surf_action_t ws_communicate(void *workstation_src,
                                  void *workstation_dst, double size,
                                  double rate)
 {
                                  void *workstation_dst, double size,
                                  double rate)
 {
@@ -205,26 +205,26 @@ static surf_action_t communicate(void *workstation_src,
                 src->id, dst->id, size, rate);
 }
 
                 src->id, dst->id, size, rate);
 }
 
-static e_surf_resource_state_t get_state(void *workstation)
+static e_surf_resource_state_t ws_get_state(void *workstation)
 {
   return surf_cpu_model->extension.cpu.
     get_state(((workstation_CLM03_t) workstation)->cpu);
 }
 
 {
   return surf_cpu_model->extension.cpu.
     get_state(((workstation_CLM03_t) workstation)->cpu);
 }
 
-static double get_speed(void *workstation, double load)
+static double ws_get_speed(void *workstation, double load)
 {
   return surf_cpu_model->extension.cpu.
     get_speed(((workstation_CLM03_t) workstation)->cpu, load);
 }
 
 {
   return surf_cpu_model->extension.cpu.
     get_speed(((workstation_CLM03_t) workstation)->cpu, load);
 }
 
-static double get_available_speed(void *workstation)
+static double ws_get_available_speed(void *workstation)
 {
   return surf_cpu_model->extension.cpu.
     get_available_speed(((workstation_CLM03_t)
                          workstation)->cpu);
 }
 
 {
   return surf_cpu_model->extension.cpu.
     get_available_speed(((workstation_CLM03_t)
                          workstation)->cpu);
 }
 
-static surf_action_t execute_parallel_task(int workstation_nb,
+static surf_action_t ws_execute_parallel_task(int workstation_nb,
                                            void **workstation_list,
                                            double *computation_amount,
                                            double *communication_amount,
                                            void **workstation_list,
                                            double *computation_amount,
                                            double *communication_amount,
@@ -235,7 +235,7 @@ static surf_action_t execute_parallel_task(int workstation_nb,
 
 
 /* returns an array of network_link_CM02_t */
 
 
 /* returns an array of network_link_CM02_t */
-static xbt_dynar_t get_route(void *src, void *dst)
+static xbt_dynar_t ws_get_route(void *src, void *dst)
 {
   workstation_CLM03_t workstation_src = (workstation_CLM03_t) src;
   workstation_CLM03_t workstation_dst = (workstation_CLM03_t) dst;
 {
   workstation_CLM03_t workstation_src = (workstation_CLM03_t) src;
   workstation_CLM03_t workstation_dst = (workstation_CLM03_t) dst;
@@ -243,28 +243,28 @@ static xbt_dynar_t get_route(void *src, void *dst)
                                                          workstation_dst->id);
 }
 
                                                          workstation_dst->id);
 }
 
-static double get_link_bandwidth(const void *link)
+static double ws_get_link_bandwidth(const void *link)
 {
   return surf_network_model->extension.network.get_link_bandwidth(link);
 }
 
 {
   return surf_network_model->extension.network.get_link_bandwidth(link);
 }
 
-static double get_link_latency(const void *link)
+static double ws_get_link_latency(const void *link)
 {
   return surf_network_model->extension.network.get_link_latency(link);
 }
 
 {
   return surf_network_model->extension.network.get_link_latency(link);
 }
 
-static int link_shared(const void *link)
+static int ws_link_shared(const void *link)
 {
   return surf_network_model->extension.network.get_link_latency(link);
 }
 
 {
   return surf_network_model->extension.network.get_link_latency(link);
 }
 
-static void finalize(void)
+static void ws_finalize(void)
 {
   surf_model_exit(surf_workstation_model);
   surf_workstation_model = NULL;
 }
 
 {
   surf_model_exit(surf_workstation_model);
   surf_workstation_model = NULL;
 }
 
-static xbt_dict_t get_properties(const void *ws)
+static xbt_dict_t ws_get_properties(const void *ws)
 {
   return surf_resource_properties(((workstation_CLM03_t) ws)->cpu);
 }
 {
   return surf_resource_properties(((workstation_CLM03_t) ws)->cpu);
 }
@@ -274,43 +274,43 @@ static void surf_workstation_model_init_internal(void)
   surf_workstation_model = surf_model_init();
 
   surf_workstation_model->name = "Workstation";
   surf_workstation_model = surf_model_init();
 
   surf_workstation_model->name = "Workstation";
-  surf_workstation_model->action_unref = action_unref;
-  surf_workstation_model->action_cancel = action_cancel;
+  surf_workstation_model->action_unref = ws_action_unref;
+  surf_workstation_model->action_cancel = ws_action_cancel;
   surf_workstation_model->action_state_set = ws_action_state_set;
 
   surf_workstation_model->action_state_set = ws_action_state_set;
 
-  surf_workstation_model->model_private->resource_used = resource_used;
-  surf_workstation_model->model_private->share_resources = share_resources;
+  surf_workstation_model->model_private->resource_used = ws_resource_used;
+  surf_workstation_model->model_private->share_resources = ws_share_resources;
   surf_workstation_model->model_private->update_actions_state =
   surf_workstation_model->model_private->update_actions_state =
-    update_actions_state;
+    ws_update_actions_state;
   surf_workstation_model->model_private->update_resource_state =
   surf_workstation_model->model_private->update_resource_state =
-    update_resource_state;
-  surf_workstation_model->model_private->finalize = finalize;
-
-  surf_workstation_model->suspend = action_suspend;
-  surf_workstation_model->resume = action_resume;
-  surf_workstation_model->is_suspended = action_is_suspended;
-  surf_workstation_model->set_max_duration = action_set_max_duration;
-  surf_workstation_model->set_priority = action_set_priority;
-  surf_workstation_model->get_remains = action_get_remains;
-
-  surf_workstation_model->extension.workstation.execute = execute;
-  surf_workstation_model->extension.workstation.sleep = action_sleep;
-  surf_workstation_model->extension.workstation.get_state = get_state;
-  surf_workstation_model->extension.workstation.get_speed = get_speed;
+    ws_update_resource_state;
+  surf_workstation_model->model_private->finalize = ws_finalize;
+
+  surf_workstation_model->suspend = ws_action_suspend;
+  surf_workstation_model->resume = ws_action_resume;
+  surf_workstation_model->is_suspended = ws_action_is_suspended;
+  surf_workstation_model->set_max_duration = ws_action_set_max_duration;
+  surf_workstation_model->set_priority = ws_action_set_priority;
+  surf_workstation_model->get_remains = ws_action_get_remains;
+
+  surf_workstation_model->extension.workstation.execute = ws_execute;
+  surf_workstation_model->extension.workstation.sleep = ws_action_sleep;
+  surf_workstation_model->extension.workstation.get_state = ws_get_state;
+  surf_workstation_model->extension.workstation.get_speed = ws_get_speed;
   surf_workstation_model->extension.workstation.get_available_speed =
   surf_workstation_model->extension.workstation.get_available_speed =
-    get_available_speed;
+    ws_get_available_speed;
 
 
-  surf_workstation_model->extension.workstation.communicate = communicate;
-  surf_workstation_model->extension.workstation.get_route = get_route;
+  surf_workstation_model->extension.workstation.communicate = ws_communicate;
+  surf_workstation_model->extension.workstation.get_route = ws_get_route;
   surf_workstation_model->extension.workstation.execute_parallel_task =
   surf_workstation_model->extension.workstation.execute_parallel_task =
-    execute_parallel_task;
+    ws_execute_parallel_task;
   surf_workstation_model->extension.workstation.get_link_bandwidth =
   surf_workstation_model->extension.workstation.get_link_bandwidth =
-    get_link_bandwidth;
+    ws_get_link_bandwidth;
   surf_workstation_model->extension.workstation.get_link_latency =
   surf_workstation_model->extension.workstation.get_link_latency =
-    get_link_latency;
-  surf_workstation_model->extension.workstation.link_shared = link_shared;
+    ws_get_link_latency;
+  surf_workstation_model->extension.workstation.link_shared = ws_link_shared;
   surf_workstation_model->extension.workstation.get_properties =
   surf_workstation_model->extension.workstation.get_properties =
-    get_properties;
+    ws_get_properties;
 }
 
 /********************************************************************/
 }
 
 /********************************************************************/
index 8050848..6b7e0aa 100644 (file)
@@ -64,12 +64,12 @@ typedef struct surf_action_workstation_L07 {
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_workstation);
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_workstation);
 
-static int host_count = 0;
-static xbt_dict_t parallel_task_link_set = NULL;
+static int ptask_host_count = 0;
+static xbt_dict_t ptask_parallel_task_link_set = NULL;
 lmm_system_t ptask_maxmin_system = NULL;
 
 
 lmm_system_t ptask_maxmin_system = NULL;
 
 
-static void update_action_bound(surf_action_workstation_L07_t action)
+static void ptask_update_action_bound(surf_action_workstation_L07_t action)
 {
   int workstation_nb = action->workstation_nb;
   double lat_current = 0.0;
 {
   int workstation_nb = action->workstation_nb;
   double lat_current = 0.0;
@@ -111,7 +111,7 @@ static void update_action_bound(surf_action_workstation_L07_t action)
 /******* Resource Public     **********/
 /**************************************/
 
 /******* Resource Public     **********/
 /**************************************/
 
-static int action_unref(surf_action_t action)
+static int ptask_action_unref(surf_action_t action)
 {
   action->refcount--;
 
 {
   action->refcount--;
 
@@ -129,7 +129,7 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
   return 0;
 }
 
-static void action_cancel(surf_action_t action)
+static void ptask_action_cancel(surf_action_t action)
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
   return;
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
   return;
@@ -138,7 +138,7 @@ static void action_cancel(surf_action_t action)
 /* action_change_state is inherited from the surf module */
 /* action_set_data is inherited from the surf module */
 
 /* action_change_state is inherited from the surf module */
 /* action_set_data is inherited from the surf module */
 
-static void action_suspend(surf_action_t action)
+static void ptask_action_suspend(surf_action_t action)
 {
   XBT_IN1("(%p))", action);
   if (((surf_action_workstation_L07_t) action)->suspended != 2) {
 {
   XBT_IN1("(%p))", action);
   if (((surf_action_workstation_L07_t) action)->suspended != 2) {
@@ -150,7 +150,7 @@ static void action_suspend(surf_action_t action)
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static void action_resume(surf_action_t action)
+static void ptask_action_resume(surf_action_t action)
 {
   surf_action_workstation_L07_t act = (surf_action_workstation_L07_t) action;
 
 {
   surf_action_workstation_L07_t act = (surf_action_workstation_L07_t) action;
 
@@ -162,12 +162,12 @@ static void action_resume(surf_action_t action)
   XBT_OUT;
 }
 
   XBT_OUT;
 }
 
-static int action_is_suspended(surf_action_t action)
+static int ptask_action_is_suspended(surf_action_t action)
 {
   return (((surf_action_workstation_L07_t) action)->suspended == 1);
 }
 
 {
   return (((surf_action_workstation_L07_t) action)->suspended == 1);
 }
 
-static void action_set_max_duration(surf_action_t action, double duration)
+static void ptask_action_set_max_duration(surf_action_t action, double duration)
 {                               /* FIXME: should inherit */
   XBT_IN2("(%p,%g)", action, duration);
   action->max_duration = duration;
 {                               /* FIXME: should inherit */
   XBT_IN2("(%p,%g)", action, duration);
   action->max_duration = duration;
@@ -175,14 +175,14 @@ static void action_set_max_duration(surf_action_t action, double duration)
 }
 
 
 }
 
 
-static void action_set_priority(surf_action_t action, double priority)
+static void ptask_action_set_priority(surf_action_t action, double priority)
 {                               /* FIXME: should inherit */
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
   XBT_OUT;
 }
 
 {                               /* FIXME: should inherit */
   XBT_IN2("(%p,%g)", action, priority);
   action->priority = priority;
   XBT_OUT;
 }
 
-static double action_get_remains(surf_action_t action)
+static double ptask_action_get_remains(surf_action_t action)
 {
   XBT_IN1("(%p)", action);
   return action->remains;
 {
   XBT_IN1("(%p)", action);
   return action->remains;
@@ -193,7 +193,7 @@ static double action_get_remains(surf_action_t action)
 /******* Resource Private    **********/
 /**************************************/
 
 /******* Resource Private    **********/
 /**************************************/
 
-static int resource_used(void *resource_id)
+static int ptask_resource_used(void *resource_id)
 {
   /* We can freely cast as a link_L07_t because it has
      the same prefix as cpu_L07_t */
 {
   /* We can freely cast as a link_L07_t because it has
      the same prefix as cpu_L07_t */
@@ -202,7 +202,7 @@ static int resource_used(void *resource_id)
 
 }
 
 
 }
 
-static double share_resources(double now)
+static double ptask_share_resources(double now)
 {
   s_surf_action_workstation_L07_t s_action;
   surf_action_workstation_L07_t action = NULL;
 {
   s_surf_action_workstation_L07_t s_action;
   surf_action_workstation_L07_t action = NULL;
@@ -234,7 +234,7 @@ static double share_resources(double now)
   return min;
 }
 
   return min;
 }
 
-static void update_actions_state(double now, double delta)
+static void ptask_update_actions_state(double now, double delta)
 {
   double deltap = 0.0;
   surf_action_workstation_L07_t action = NULL;
 {
   double deltap = 0.0;
   surf_action_workstation_L07_t action = NULL;
@@ -253,7 +253,7 @@ static void update_actions_state(double now, double delta)
         action->latency = 0.0;
       }
       if ((action->latency == 0.0) && (action->suspended == 0)) {
         action->latency = 0.0;
       }
       if ((action->latency == 0.0) && (action->suspended == 0)) {
-        update_action_bound(action);
+        ptask_update_action_bound(action);
         lmm_update_variable_weight(ptask_maxmin_system, action->variable,
                                    1.0);
       }
         lmm_update_variable_weight(ptask_maxmin_system, action->variable,
                                    1.0);
       }
@@ -321,7 +321,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
   return;
 }
 
-static void update_resource_state(void *id,
+static void ptask_update_resource_state(void *id,
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
                                   tmgr_trace_event_t event_type,
                                   double value, double date)
 {
@@ -347,7 +347,7 @@ static void update_resource_state(void *id,
 
 
         action = lmm_variable_id(var);
 
 
         action = lmm_variable_id(var);
-        update_action_bound(action);
+        ptask_update_action_bound(action);
       }
       if (tmgr_trace_event_free(event_type))
         nw_link->lat_event = NULL;
       }
       if (tmgr_trace_event_free(event_type))
         nw_link->lat_event = NULL;
@@ -391,10 +391,10 @@ static void update_resource_state(void *id,
   return;
 }
 
   return;
 }
 
-static void finalize(void)
+static void ptask_finalize(void)
 {
 {
-  if (parallel_task_link_set != NULL)
-    xbt_dict_free(&parallel_task_link_set);
+  if (ptask_parallel_task_link_set != NULL)
+    xbt_dict_free(&ptask_parallel_task_link_set);
 
   surf_model_exit(surf_workstation_model);
   surf_workstation_model = NULL;
 
   surf_model_exit(surf_workstation_model);
   surf_workstation_model = NULL;
@@ -402,7 +402,7 @@ static void finalize(void)
   surf_network_model = NULL;
   used_routing->finalize();
 
   surf_network_model = NULL;
   used_routing->finalize();
 
-  host_count = 0;
+  ptask_host_count = 0;
 
   if (ptask_maxmin_system) {
     lmm_system_free(ptask_maxmin_system);
 
   if (ptask_maxmin_system) {
     lmm_system_free(ptask_maxmin_system);
@@ -414,22 +414,22 @@ static void finalize(void)
 /******* Resource Private    **********/
 /**************************************/
 
 /******* Resource Private    **********/
 /**************************************/
 
-static e_surf_resource_state_t resource_get_state(void *cpu)
+static e_surf_resource_state_t ptask_resource_get_state(void *cpu)
 {
   return ((cpu_L07_t) cpu)->state_current;
 }
 
 {
   return ((cpu_L07_t) cpu)->state_current;
 }
 
-static double get_speed(void *cpu, double load)
+static double ptask_get_speed(void *cpu, double load)
 {
   return load * (((cpu_L07_t) cpu)->power_scale);
 }
 
 {
   return load * (((cpu_L07_t) cpu)->power_scale);
 }
 
-static double get_available_speed(void *cpu)
+static double ptask_get_available_speed(void *cpu)
 {
   return ((cpu_L07_t) cpu)->power_current;
 }
 
 {
   return ((cpu_L07_t) cpu)->power_current;
 }
 
-static surf_action_t execute_parallel_task(int workstation_nb,
+static surf_action_t ptask_execute_parallel_task(int workstation_nb,
                                            void **workstation_list,
                                            double *computation_amount,
                                            double *communication_amount,
                                            void **workstation_list,
                                            double *computation_amount,
                                            double *communication_amount,
@@ -442,10 +442,10 @@ static surf_action_t execute_parallel_task(int workstation_nb,
   int nb_host = 0;
   double latency = 0.0;
 
   int nb_host = 0;
   double latency = 0.0;
 
-  if (parallel_task_link_set == NULL)
-    parallel_task_link_set = xbt_dict_new();
+  if (ptask_parallel_task_link_set == NULL)
+    ptask_parallel_task_link_set = xbt_dict_new();
 
 
-  xbt_dict_reset(parallel_task_link_set);
+  xbt_dict_reset(ptask_parallel_task_link_set);
 
   /* Compute the number of affected resources... */
   for (i = 0; i < workstation_nb; i++) {
 
   /* Compute the number of affected resources... */
   for (i = 0; i < workstation_nb; i++) {
@@ -459,15 +459,15 @@ static surf_action_t execute_parallel_task(int workstation_nb,
       if (communication_amount[i * workstation_nb + j] > 0)
         xbt_dynar_foreach(route, cpt, link) {
         lat += link->lat_current;
       if (communication_amount[i * workstation_nb + j] > 0)
         xbt_dynar_foreach(route, cpt, link) {
         lat += link->lat_current;
-        xbt_dict_set(parallel_task_link_set, link->generic_resource.name,
+        xbt_dict_set(ptask_parallel_task_link_set, link->generic_resource.name,
                      link, NULL);
         }
       latency = MAX(latency, lat);
     }
   }
 
                      link, NULL);
         }
       latency = MAX(latency, lat);
     }
   }
 
-  nb_link = xbt_dict_length(parallel_task_link_set);
-  xbt_dict_reset(parallel_task_link_set);
+  nb_link = xbt_dict_length(ptask_parallel_task_link_set);
+  xbt_dict_reset(ptask_parallel_task_link_set);
 
   for (i = 0; i < workstation_nb; i++)
     if (computation_amount[i] > 0)
 
   for (i = 0; i < workstation_nb; i++)
     if (computation_amount[i] > 0)
@@ -525,7 +525,7 @@ static surf_action_t execute_parallel_task(int workstation_nb,
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-static surf_action_t execute(void *cpu, double size)
+static surf_action_t ptask_execute(void *cpu, double size)
 {
   void **workstation_list = xbt_new0(void *, 1);
   double *computation_amount = xbt_new0(double, 1);
 {
   void **workstation_list = xbt_new0(void *, 1);
   double *computation_amount = xbt_new0(double, 1);
@@ -535,11 +535,11 @@ static surf_action_t execute(void *cpu, double size)
   communication_amount[0] = 0.0;
   computation_amount[0] = size;
 
   communication_amount[0] = 0.0;
   computation_amount[0] = size;
 
-  return execute_parallel_task(1, workstation_list, computation_amount,
+  return ptask_execute_parallel_task(1, workstation_list, computation_amount,
                                communication_amount, 1, -1);
 }
 
                                communication_amount, 1, -1);
 }
 
-static surf_action_t communicate(void *src, void *dst, double size,
+static surf_action_t ptask_communicate(void *src, void *dst, double size,
                                  double rate)
 {
   void **workstation_list = xbt_new0(void *, 2);
                                  double rate)
 {
   void **workstation_list = xbt_new0(void *, 2);
@@ -551,20 +551,20 @@ static surf_action_t communicate(void *src, void *dst, double size,
   workstation_list[1] = dst;
   communication_amount[1] = size;
 
   workstation_list[1] = dst;
   communication_amount[1] = size;
 
-  res = execute_parallel_task(2, workstation_list,
+  res = ptask_execute_parallel_task(2, workstation_list,
                               computation_amount, communication_amount,
                               1, rate);
 
   return res;
 }
 
                               computation_amount, communication_amount,
                               1, rate);
 
   return res;
 }
 
-static surf_action_t action_sleep(void *cpu, double duration)
+static surf_action_t ptask_action_sleep(void *cpu, double duration)
 {
   surf_action_workstation_L07_t action = NULL;
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
 
 {
   surf_action_workstation_L07_t action = NULL;
 
   XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
 
-  action = (surf_action_workstation_L07_t) execute(cpu, 1.0);
+  action = (surf_action_workstation_L07_t) ptask_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   lmm_update_variable_weight(ptask_maxmin_system, action->variable, 0.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   lmm_update_variable_weight(ptask_maxmin_system, action->variable, 0.0);
@@ -573,7 +573,7 @@ static surf_action_t action_sleep(void *cpu, double duration)
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-static xbt_dynar_t get_route(void *src, void *dst)
+static xbt_dynar_t ptask_get_route(void *src, void *dst)
 {
   cpu_L07_t host_src = src;
   cpu_L07_t host_dst = dst;
 {
   cpu_L07_t host_src = src;
   cpu_L07_t host_dst = dst;
@@ -581,17 +581,17 @@ static xbt_dynar_t get_route(void *src, void *dst)
   return used_routing->get_route(host_src->id, host_dst->id);
 }
 
   return used_routing->get_route(host_src->id, host_dst->id);
 }
 
-static double get_link_bandwidth(const void *link)
+static double ptask_get_link_bandwidth(const void *link)
 {
   return ((link_L07_t) link)->bw_current;
 }
 
 {
   return ((link_L07_t) link)->bw_current;
 }
 
-static double get_link_latency(const void *link)
+static double ptask_get_link_latency(const void *link)
 {
   return ((link_L07_t) link)->lat_current;
 }
 
 {
   return ((link_L07_t) link)->lat_current;
 }
 
-static int link_shared(const void *link)
+static int ptask_link_shared(const void *link)
 {
   return lmm_constraint_is_shared(((link_L07_t) link)->constraint);
 }
 {
   return lmm_constraint_is_shared(((link_L07_t) link)->constraint);
 }
@@ -600,7 +600,7 @@ static int link_shared(const void *link)
 /*** Resource Creation & Destruction **/
 /**************************************/
 
 /*** Resource Creation & Destruction **/
 /**************************************/
 
-static cpu_L07_t cpu_new(const char *name, double power_scale,
+static cpu_L07_t ptask_cpu_new(const char *name, double power_scale,
                          double power_initial,
                          tmgr_trace_t power_trace,
                          e_surf_resource_state_t state_initial,
                          double power_initial,
                          tmgr_trace_t power_trace,
                          e_surf_resource_state_t state_initial,
@@ -614,7 +614,7 @@ static cpu_L07_t cpu_new(const char *name, double power_scale,
   cpu->type = SURF_WORKSTATION_RESOURCE_CPU;
   cpu->generic_resource.name = xbt_strdup(name);
   cpu->generic_resource.properties = current_property_set;
   cpu->type = SURF_WORKSTATION_RESOURCE_CPU;
   cpu->generic_resource.name = xbt_strdup(name);
   cpu->generic_resource.properties = current_property_set;
-  cpu->id = host_count++;
+  cpu->id = ptask_host_count++;
 
   cpu->power_scale = power_scale;
   xbt_assert0(cpu->power_scale > 0, "Power has to be >0");
 
   cpu->power_scale = power_scale;
   xbt_assert0(cpu->power_scale > 0, "Power has to be >0");
@@ -639,7 +639,7 @@ static cpu_L07_t cpu_new(const char *name, double power_scale,
   return cpu;
 }
 
   return cpu;
 }
 
-static void parse_cpu_init(void)
+static void ptask_parse_cpu_init(void)
 {
   double power_scale = 0.0;
   double power_initial = 0.0;
 {
   double power_scale = 0.0;
   double power_initial = 0.0;
@@ -661,11 +661,11 @@ static void parse_cpu_init(void)
   state_trace = tmgr_trace_new(A_surfxml_host_state_file);
 
   current_property_set = xbt_dict_new();
   state_trace = tmgr_trace_new(A_surfxml_host_state_file);
 
   current_property_set = xbt_dict_new();
-  cpu_new(A_surfxml_host_id, power_scale, power_initial, power_trace,
+  ptask_cpu_new(A_surfxml_host_id, power_scale, power_initial, power_trace,
           state_initial, state_trace, current_property_set);
 }
 
           state_initial, state_trace, current_property_set);
 }
 
-static link_L07_t link_new(char *name,
+static link_L07_t ptask_link_new(char *name,
                            double bw_initial,
                            tmgr_trace_t bw_trace,
                            double lat_initial,
                            double bw_initial,
                            tmgr_trace_t bw_trace,
                            double lat_initial,
@@ -710,7 +710,7 @@ static link_L07_t link_new(char *name,
   return nw_link;
 }
 
   return nw_link;
 }
 
-static void parse_link_init(void)
+static void ptask_parse_link_init(void)
 {
   char *name_link;
   double bw_initial;
 {
   char *name_link;
   double bw_initial;
@@ -744,12 +744,12 @@ static void parse_link_init(void)
   state_trace = tmgr_trace_new(A_surfxml_link_state_file);
 
   current_property_set = xbt_dict_new();
   state_trace = tmgr_trace_new(A_surfxml_link_state_file);
 
   current_property_set = xbt_dict_new();
-  link_new(name_link, bw_initial, bw_trace, lat_initial, lat_trace,
+  ptask_link_new(name_link, bw_initial, bw_trace, lat_initial, lat_trace,
            state_initial_link, state_trace, policy_initial_link,
            current_property_set);
 }
 
            state_initial_link, state_trace, policy_initial_link,
            current_property_set);
 }
 
-static void add_traces(void)
+static void ptask_add_traces(void)
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
 {
   xbt_dict_cursor_t cursor = NULL;
   char *trace_name, *elm;
@@ -813,13 +813,13 @@ static void add_traces(void)
   }
 }
 
   }
 }
 
-static void define_callbacks(const char *file)
+static void ptask_define_callbacks(const char *file)
 {
   /* Adding callback functions */
   surf_parse_reset_parser();
 {
   /* Adding callback functions */
   surf_parse_reset_parser();
-  surfxml_add_callback(STag_surfxml_host_cb_list, &parse_cpu_init);
-  surfxml_add_callback(STag_surfxml_link_cb_list, &parse_link_init);
-  surfxml_add_callback(ETag_surfxml_platform_cb_list, &add_traces);
+  surfxml_add_callback(STag_surfxml_host_cb_list, &ptask_parse_cpu_init);
+  surfxml_add_callback(STag_surfxml_link_cb_list, &ptask_parse_link_init);
+  surfxml_add_callback(ETag_surfxml_platform_cb_list, &ptask_add_traces);
 }
 
 
 }
 
 
@@ -827,45 +827,45 @@ static void define_callbacks(const char *file)
 /********* Module  creation ***********/
 /**************************************/
 
 /********* Module  creation ***********/
 /**************************************/
 
-static void model_init_internal(void)
+static void ptask_model_init_internal(void)
 {
   surf_workstation_model = surf_model_init();
 
 {
   surf_workstation_model = surf_model_init();
 
-  surf_workstation_model->action_unref = action_unref;
-  surf_workstation_model->action_cancel = action_cancel;
+  surf_workstation_model->action_unref = ptask_action_unref;
+  surf_workstation_model->action_cancel = ptask_action_cancel;
   surf_workstation_model->action_state_set = surf_action_state_set;
   surf_workstation_model->action_state_set = surf_action_state_set;
-  surf_workstation_model->suspend = action_suspend;
-  surf_workstation_model->resume = action_resume;
-  surf_workstation_model->is_suspended = action_is_suspended;
-  surf_workstation_model->set_max_duration = action_set_max_duration;
-  surf_workstation_model->set_priority = action_set_priority;
-  surf_workstation_model->get_remains = action_get_remains;
+  surf_workstation_model->suspend = ptask_action_suspend;
+  surf_workstation_model->resume = ptask_action_resume;
+  surf_workstation_model->is_suspended = ptask_action_is_suspended;
+  surf_workstation_model->set_max_duration = ptask_action_set_max_duration;
+  surf_workstation_model->set_priority = ptask_action_set_priority;
+  surf_workstation_model->get_remains = ptask_action_get_remains;
   surf_workstation_model->name = "Workstation ptask_L07";
 
   surf_workstation_model->name = "Workstation ptask_L07";
 
-  surf_workstation_model->model_private->resource_used = resource_used;
-  surf_workstation_model->model_private->share_resources = share_resources;
+  surf_workstation_model->model_private->resource_used = ptask_resource_used;
+  surf_workstation_model->model_private->share_resources = ptask_share_resources;
   surf_workstation_model->model_private->update_actions_state =
   surf_workstation_model->model_private->update_actions_state =
-    update_actions_state;
+    ptask_update_actions_state;
   surf_workstation_model->model_private->update_resource_state =
   surf_workstation_model->model_private->update_resource_state =
-    update_resource_state;
-  surf_workstation_model->model_private->finalize = finalize;
+    ptask_update_resource_state;
+  surf_workstation_model->model_private->finalize = ptask_finalize;
 
 
-  surf_workstation_model->extension.workstation.execute = execute;
-  surf_workstation_model->extension.workstation.sleep = action_sleep;
+  surf_workstation_model->extension.workstation.execute = ptask_execute;
+  surf_workstation_model->extension.workstation.sleep = ptask_action_sleep;
   surf_workstation_model->extension.workstation.get_state =
   surf_workstation_model->extension.workstation.get_state =
-    resource_get_state;
-  surf_workstation_model->extension.workstation.get_speed = get_speed;
+    ptask_resource_get_state;
+  surf_workstation_model->extension.workstation.get_speed = ptask_get_speed;
   surf_workstation_model->extension.workstation.get_available_speed =
   surf_workstation_model->extension.workstation.get_available_speed =
-    get_available_speed;
-  surf_workstation_model->extension.workstation.communicate = communicate;
-  surf_workstation_model->extension.workstation.get_route = get_route;
+    ptask_get_available_speed;
+  surf_workstation_model->extension.workstation.communicate = ptask_communicate;
+  surf_workstation_model->extension.workstation.get_route = ptask_get_route;
   surf_workstation_model->extension.workstation.execute_parallel_task =
   surf_workstation_model->extension.workstation.execute_parallel_task =
-    execute_parallel_task;
+    ptask_execute_parallel_task;
   surf_workstation_model->extension.workstation.get_link_bandwidth =
   surf_workstation_model->extension.workstation.get_link_bandwidth =
-    get_link_bandwidth;
+    ptask_get_link_bandwidth;
   surf_workstation_model->extension.workstation.get_link_latency =
   surf_workstation_model->extension.workstation.get_link_latency =
-    get_link_latency;
-  surf_workstation_model->extension.workstation.link_shared = link_shared;
+    ptask_get_link_latency;
+  surf_workstation_model->extension.workstation.link_shared = ptask_link_shared;
   surf_workstation_model->extension.workstation.get_properties =
     surf_resource_properties;
 
   surf_workstation_model->extension.workstation.get_properties =
     surf_resource_properties;
 
@@ -874,7 +874,7 @@ static void model_init_internal(void)
     ptask_maxmin_system = lmm_system_new();
 
   routing_model_create(sizeof(link_L07_t),
     ptask_maxmin_system = lmm_system_new();
 
   routing_model_create(sizeof(link_L07_t),
-                       link_new(xbt_strdup("__loopback__"),
+                       ptask_link_new(xbt_strdup("__loopback__"),
                                 498000000, NULL, 0.000015, NULL,
                                 SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE,
                                 NULL));
                                 498000000, NULL, 0.000015, NULL,
                                 SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE,
                                 NULL));
@@ -889,8 +889,8 @@ void surf_workstation_model_init_ptask_L07(const char *filename)
   xbt_assert0(!surf_cpu_model, "CPU model type already defined");
   xbt_assert0(!surf_network_model, "network model type already defined");
   surf_network_model = surf_model_init();
   xbt_assert0(!surf_cpu_model, "CPU model type already defined");
   xbt_assert0(!surf_network_model, "network model type already defined");
   surf_network_model = surf_model_init();
-  define_callbacks(filename);
-  model_init_internal();
+  ptask_define_callbacks(filename);
+  ptask_model_init_internal();
 
   update_model_description(surf_workstation_model_description,
                            "ptask_L07", surf_workstation_model);
 
   update_model_description(surf_workstation_model_description,
                            "ptask_L07", surf_workstation_model);
index d90bd8f..28c9b56 100644 (file)
@@ -15,7 +15,7 @@
  * The root category's default logging function.
  */
 
  * The root category's default logging function.
  */
 
-extern const char *xbt_log_priority_names[7];
+extern const char *xbt_log_priority_names[8];
 
 
 static void append_file(xbt_log_appender_t this_appender, char *str)
 
 
 static void append_file(xbt_log_appender_t this_appender, char *str)
index 9936400..16c1c21 100644 (file)
@@ -15,9 +15,9 @@
 #include "xbt/synchro.h"        /* xbt_thread_self_name */
 #include <stdio.h>
 
 #include "xbt/synchro.h"        /* xbt_thread_self_name */
 #include <stdio.h>
 
-extern const char *xbt_log_priority_names[7];
+extern const char *xbt_log_priority_names[8];
 
 
-static double begin_of_time = -1;
+static double format_begin_of_time = -1;
 
 #define append1(fmt,fmt2,elm)                                         \
   do {                                                               \
 
 #define append1(fmt,fmt2,elm)                                         \
   do {                                                               \
@@ -147,7 +147,7 @@ static void xbt_log_layout_format_dynamic(xbt_log_layout_t l,
         append1("%f", "%.*f", gras_os_time());
         break;
       case 'r':                /* application age; LOG4J compliant */
         append1("%f", "%.*f", gras_os_time());
         break;
       case 'r':                /* application age; LOG4J compliant */
-        append1("%f", "%.*f", gras_os_time() - begin_of_time);
+        append1("%f", "%.*f", gras_os_time() - format_begin_of_time);
         break;
 
       case 'm':                /* user-provided message; LOG4J compliant */
         break;
 
       case 'm':                /* user-provided message; LOG4J compliant */
@@ -172,6 +172,7 @@ static void xbt_log_layout_format_dynamic(xbt_log_layout_t l,
   xbt_strbuff_free(buff);
 }
 
   xbt_strbuff_free(buff);
 }
 
+#undef check_overflow
 #define check_overflow \
   if (p-ev->buffer > XBT_LOG_BUFF_SIZE) { /* buffer overflow */ \
   xbt_log_layout_format_dynamic(l,ev,msg_fmt,app); \
 #define check_overflow \
   if (p-ev->buffer > XBT_LOG_BUFF_SIZE) { /* buffer overflow */ \
   xbt_log_layout_format_dynamic(l,ev,msg_fmt,app); \
@@ -185,8 +186,8 @@ static void xbt_log_layout_format_doit(xbt_log_layout_t l,
   char *p, *q;
   int precision = -1;
 
   char *p, *q;
   int precision = -1;
 
-  if (begin_of_time < 0)
-    begin_of_time = gras_os_time();
+  if (format_begin_of_time < 0)
+    format_begin_of_time = gras_os_time();
 
   p = ev->buffer;
   q = l->data;
 
   p = ev->buffer;
   q = l->data;
@@ -444,13 +445,13 @@ static void xbt_log_layout_format_doit(xbt_log_layout_t l,
         if (precision == -1) {
           p +=
             snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "%f",
         if (precision == -1) {
           p +=
             snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "%f",
-                     gras_os_time() - begin_of_time);
+                     gras_os_time() - format_begin_of_time);
           check_overflow;
         } else {
           p +=
             sprintf(p, "%.*f",
                     (int) MIN(XBT_LOG_BUFF_SIZE - (p - ev->buffer),
           check_overflow;
         } else {
           p +=
             sprintf(p, "%.*f",
                     (int) MIN(XBT_LOG_BUFF_SIZE - (p - ev->buffer),
-                              precision), gras_os_time() - begin_of_time);
+                              precision), gras_os_time() - format_begin_of_time);
           check_overflow;
           precision = -1;
         }
           check_overflow;
           precision = -1;
         }
index 06d796f..4165fc7 100644 (file)
 #include <stdio.h>
 #include "portable.h"
 
 #include <stdio.h>
 #include "portable.h"
 
-extern const char *xbt_log_priority_names[7];
+extern const char *xbt_log_priority_names[8];
 extern int xbt_log_no_loc;
 
 extern int xbt_log_no_loc;
 
-static double begin_of_time = -1;
+static double simple_begin_of_time = -1;
 
 static void xbt_log_layout_simple_dynamic(xbt_log_layout_t l,
                                           xbt_log_event_t ev,
 
 static void xbt_log_layout_simple_dynamic(xbt_log_layout_t l,
                                           xbt_log_event_t ev,
@@ -39,7 +39,7 @@ static void xbt_log_layout_simple_dynamic(xbt_log_layout_t l,
                   gras_os_myname(), xbt_procname(), (*xbt_getpid) ());
   p +=
     snprintf(p, 256 - (p - loc_buff), "%f] ",
                   gras_os_myname(), xbt_procname(), (*xbt_getpid) ());
   p +=
     snprintf(p, 256 - (p - loc_buff), "%f] ",
-             gras_os_time() - begin_of_time);
+             gras_os_time() - simple_begin_of_time);
   if (ev->priority != xbt_log_priority_info && xbt_log_no_loc==0)
     p +=
       snprintf(p, 256 - (p - loc_buff), "%s:%d: ", ev->fileName,
   if (ev->priority != xbt_log_priority_info && xbt_log_no_loc==0)
     p +=
       snprintf(p, 256 - (p - loc_buff), "%s:%d: ", ev->fileName,
@@ -61,6 +61,7 @@ static void xbt_log_layout_simple_dynamic(xbt_log_layout_t l,
 }
 
 /* only used after the format using: we suppose that the buffer is big enough to display our data */
 }
 
 /* only used after the format using: we suppose that the buffer is big enough to display our data */
+#undef check_overflow
 #define check_overflow \
   if (p-ev->buffer > XBT_LOG_BUFF_SIZE) { /* buffer overflow */ \
   xbt_log_layout_simple_dynamic(l,ev,fmt,app); \
 #define check_overflow \
   if (p-ev->buffer > XBT_LOG_BUFF_SIZE) { /* buffer overflow */ \
   xbt_log_layout_simple_dynamic(l,ev,fmt,app); \
@@ -80,8 +81,8 @@ static void xbt_log_layout_simple_doit(xbt_log_layout_t l,
               "Priority %d is greater than the biggest allowed value",
               ev->priority);
 
               "Priority %d is greater than the biggest allowed value",
               ev->priority);
 
-  if (begin_of_time < 0)
-    begin_of_time = gras_os_time();
+  if (simple_begin_of_time < 0)
+    simple_begin_of_time = gras_os_time();
 
   p = ev->buffer;
   p += snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "[");
 
   p = ev->buffer;
   p += snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "[");
@@ -97,7 +98,7 @@ static void xbt_log_layout_simple_doit(xbt_log_layout_t l,
   /* Display the date */
   p +=
     snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "%f] ",
   /* Display the date */
   p +=
     snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "%f] ",
-             gras_os_time() - begin_of_time);
+             gras_os_time() - simple_begin_of_time);
   check_overflow;
 
   /* Display file position if not INFO */
   check_overflow;
 
   /* Display file position if not INFO */