Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Adding traces for easier debuging
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 27 Mar 2006 11:18:09 +0000 (11:18 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 27 Mar 2006 11:18:09 +0000 (11:18 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1986 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/cpu.c
src/surf/surf.c

index ecac805..c24f936 100644 (file)
@@ -127,6 +127,7 @@ static void action_cancel(surf_action_t action)
 
 static void action_recycle(surf_action_t action)
 {
 
 static void action_recycle(surf_action_t action)
 {
+  DIE_IMPOSSIBLE;
   return;
 }
 
   return;
 }
 
@@ -224,6 +225,7 @@ static surf_action_t 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;
 
+  XBT_IN2("(%s,%g)",CPU->name,size);
   action = xbt_new0(s_surf_action_cpu_Cas01_t, 1);
 
   action->generic_action.using = 1;
   action = xbt_new0(s_surf_action_cpu_Cas01_t, 1);
 
   action->generic_action.using = 1;
@@ -248,7 +250,7 @@ static surf_action_t execute(void *cpu, double size)
                                      action->generic_action.priority, -1.0, 1);
   lmm_expand(maxmin_system, CPU->constraint, action->variable,
             1.0);
                                      action->generic_action.priority, -1.0, 1);
   lmm_expand(maxmin_system, CPU->constraint, action->variable,
             1.0);
-
+  XBT_OUT;
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
@@ -256,24 +258,29 @@ static surf_action_t action_sleep(void *cpu, double duration)
 {
   surf_action_cpu_Cas01_t action = NULL;
 
 {
   surf_action_cpu_Cas01_t action = NULL;
 
+  XBT_IN2("(%s,%g)",((cpu_Cas01_t)cpu)->name,duration);
   action = (surf_action_cpu_Cas01_t) execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   lmm_update_variable_weight(maxmin_system, action->variable, 0.0);
   action = (surf_action_cpu_Cas01_t) execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   lmm_update_variable_weight(maxmin_system, action->variable, 0.0);
-
+  XBT_OUT;
   return (surf_action_t) action;
 }
 
 static void action_suspend(surf_action_t action)
 {
   return (surf_action_t) action;
 }
 
 static void action_suspend(surf_action_t action)
 {
+  XBT_IN1("(%p)",action);
   lmm_update_variable_weight(maxmin_system,
                             ((surf_action_cpu_Cas01_t) action)->variable, 0.0);
   lmm_update_variable_weight(maxmin_system,
                             ((surf_action_cpu_Cas01_t) action)->variable, 0.0);
+  XBT_OUT;
 }
 
 static void action_resume(surf_action_t action)
 {
 }
 
 static void action_resume(surf_action_t action)
 {
+  XBT_IN1("(%p)",action);
   lmm_update_variable_weight(maxmin_system,
                             ((surf_action_cpu_Cas01_t) action)->variable, 
                             action->priority);
   lmm_update_variable_weight(maxmin_system,
                             ((surf_action_cpu_Cas01_t) action)->variable, 
                             action->priority);
+  XBT_OUT;
 }
 
 static int action_is_suspended(surf_action_t action)
 }
 
 static int action_is_suspended(surf_action_t action)
@@ -283,12 +290,16 @@ static int action_is_suspended(surf_action_t action)
 
 static void action_set_max_duration(surf_action_t action, double duration)
 {
 
 static void action_set_max_duration(surf_action_t action, double duration)
 {
+  XBT_IN2("(%p,%g)",action,duration);
   action->max_duration = duration;
   action->max_duration = duration;
+  XBT_OUT;
 }
 
 static void action_set_priority(surf_action_t action, double priority)
 {
 }
 
 static void action_set_priority(surf_action_t action, double priority)
 {
+  XBT_IN2("(%p,%g)",action,priority);
   action->priority = priority;
   action->priority = priority;
+  XBT_OUT;
 }
 
 static e_surf_cpu_state_t get_state(void *cpu)
 }
 
 static e_surf_cpu_state_t get_state(void *cpu)
index 30bdc88..7e7e15b 100644 (file)
@@ -8,6 +8,9 @@
 #include "surf_private.h"
 #include "xbt/module.h"
 
 #include "surf_private.h"
 #include "xbt/module.h"
 
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_main, surf,
+                               "Logging specific to the SURF maxmin module");
+
 typedef struct surf_resource_object {
   surf_resource_t resource;
 } s_surf_resource_object_t, *surf_resource_object_t;
 typedef struct surf_resource_object {
   surf_resource_t resource;
 } s_surf_resource_object_t, *surf_resource_object_t;
@@ -98,7 +101,14 @@ void surf_action_change_state(surf_action_t action,
 {
   surf_action_state_t action_state =
       &(action->resource_type->common_public->states);
 {
   surf_action_state_t action_state =
       &(action->resource_type->common_public->states);
-
+  XBT_IN2("(%p,%s)", action, 
+         (((state==SURF_ACTION_READY)?("SURF_ACTION_READY"):
+           ((state==SURF_ACTION_RUNNING)?("SURF_ACTION_RUNNING"):
+            ((state==SURF_ACTION_FAILED)?("SURF_ACTION_FAILED"):
+             ((state==SURF_ACTION_DONE)?("SURF_ACTION_DONE"):
+              ((state==SURF_ACTION_TO_FREE)?("SURF_ACTION_TO_FREE"):
+               ((state==SURF_ACTION_NOT_IN_THE_SYSTEM)?("SURF_ACTION_NOT_IN_THE_SYSTEM"):
+                ""))))))));
   xbt_swag_remove(action, action->state_set);
 
   if (state == SURF_ACTION_READY)
   xbt_swag_remove(action, action->state_set);
 
   if (state == SURF_ACTION_READY)
@@ -114,6 +124,7 @@ void surf_action_change_state(surf_action_t action,
 
   if (action->state_set)
     xbt_swag_insert(action, action->state_set);
 
   if (action->state_set)
     xbt_swag_insert(action, action->state_set);
+  XBT_OUT;
 }
 
 void surf_action_set_data(surf_action_t action,
 }
 
 void surf_action_set_data(surf_action_t action,