Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Insane amount of debugs
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 4 Aug 2007 17:24:11 +0000 (17:24 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 4 Aug 2007 17:24:11 +0000 (17:24 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3945 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simix/smx_action.c
src/simix/smx_synchro.c

index 8e7124a..b136398 100644 (file)
@@ -50,6 +50,7 @@ smx_action_t SIMIX_action_communicate(smx_host_t sender,smx_host_t receiver,char
                                receiver->simdata->host, size, rate);
        surf_workstation_resource->common_public->action_set_data(simdata->surf_action,act);
 
                                receiver->simdata->host, size, rate);
        surf_workstation_resource->common_public->action_set_data(simdata->surf_action,act);
 
+  DEBUG1("Create communicate action %p",act);
        return act;
 }
 
        return act;
 }
 
@@ -84,6 +85,7 @@ smx_action_t SIMIX_action_execute(smx_host_t host, char * name, double amount)
 
        surf_workstation_resource->common_public->action_set_data(simdata->surf_action,act);
 
 
        surf_workstation_resource->common_public->action_set_data(simdata->surf_action,act);
 
+  DEBUG1("Create execute action %p",act);
        return act;
 }
 
        return act;
 }
 
@@ -118,6 +120,7 @@ smx_action_t SIMIX_action_sleep(smx_host_t host,  double duration)
 
        surf_workstation_resource->common_public->action_set_data(simdata->surf_action,act);
 
 
        surf_workstation_resource->common_public->action_set_data(simdata->surf_action,act);
 
+  DEBUG1("Create sleep action %p",act);
        return act;
 }
 
        return act;
 }
 
@@ -131,6 +134,7 @@ void SIMIX_action_cancel(smx_action_t action)
 {
   xbt_assert0((action != NULL), "Invalid parameter");
 
 {
   xbt_assert0((action != NULL), "Invalid parameter");
 
+  DEBUG1("Cancel action %p",action);
   if(action->simdata->surf_action) {
     surf_workstation_resource->common_public->action_cancel(action->simdata->surf_action);
   }
   if(action->simdata->surf_action) {
     surf_workstation_resource->common_public->action_cancel(action->simdata->surf_action);
   }
@@ -167,6 +171,7 @@ void SIMIX_action_destroy(smx_action_t action)
        xbt_assert1((xbt_fifo_size(action->cond_list)==0), 
                        "Conditional list not empty %d. There is a problem. Cannot destroy it now!", xbt_fifo_size(action->cond_list));
 
        xbt_assert1((xbt_fifo_size(action->cond_list)==0), 
                        "Conditional list not empty %d. There is a problem. Cannot destroy it now!", xbt_fifo_size(action->cond_list));
 
+  DEBUG1("Destroy action %p",action);
        if(action->name) xbt_free(action->name);
 
        xbt_fifo_free(action->cond_list);
        if(action->name) xbt_free(action->name);
 
        xbt_fifo_free(action->cond_list);
@@ -190,6 +195,7 @@ void SIMIX_register_action_to_condition(smx_action_t action, smx_cond_t cond)
 {
        xbt_assert0( (action != NULL) && (cond != NULL), "Invalid parameters");
 
 {
        xbt_assert0( (action != NULL) && (cond != NULL), "Invalid parameters");
 
+  DEBUG2("Register action %p to condtion %p",action,cond);
        xbt_fifo_push(cond->actions,action);
 }
 
        xbt_fifo_push(cond->actions,action);
 }
 
index 730e2cd..aec653b 100644 (file)
@@ -155,6 +155,7 @@ smx_cond_t SIMIX_cond_init()
  */
 void SIMIX_cond_signal(smx_cond_t cond)
 {
  */
 void SIMIX_cond_signal(smx_cond_t cond)
 {
+   DEBUG1("Signal condition %p",cond);
        xbt_assert0((cond != NULL), "Invalid parameters");
        smx_process_t proc = NULL;
 
        xbt_assert0((cond != NULL), "Invalid parameters");
        smx_process_t proc = NULL;
 
@@ -178,6 +179,7 @@ void SIMIX_cond_wait(smx_cond_t cond,smx_mutex_t mutex)
        smx_action_t act_sleep;
        xbt_assert0((mutex != NULL), "Invalid parameters");
        
        smx_action_t act_sleep;
        xbt_assert0((mutex != NULL), "Invalid parameters");
        
+   DEBUG1("Wait condition %p",cond);
        cond->mutex = mutex;
 
        SIMIX_mutex_unlock(mutex);
        cond->mutex = mutex;
 
        SIMIX_mutex_unlock(mutex);
@@ -236,6 +238,7 @@ void SIMIX_cond_wait_timeout(smx_cond_t cond,smx_mutex_t mutex, double max_durat
        xbt_assert0((mutex != NULL), "Invalid parameters");
        smx_action_t act_sleep;
 
        xbt_assert0((mutex != NULL), "Invalid parameters");
        smx_action_t act_sleep;
 
+   DEBUG1("Timed wait condition %p",cond);
        cond->mutex = mutex;
 
        SIMIX_mutex_unlock(mutex);
        cond->mutex = mutex;
 
        SIMIX_mutex_unlock(mutex);
@@ -275,6 +278,7 @@ void SIMIX_cond_broadcast(smx_cond_t cond)
        smx_process_t proc = NULL;
        smx_process_t proc_next = NULL;
 
        smx_process_t proc = NULL;
        smx_process_t proc_next = NULL;
 
+   DEBUG1("Broadcast condition %p",cond);
        xbt_swag_foreach_safe(proc,proc_next,cond->sleeping) {
                xbt_swag_remove(proc,cond->sleeping);
                xbt_swag_insert(proc, simix_global->process_to_run);
        xbt_swag_foreach_safe(proc,proc_next,cond->sleeping) {
                xbt_swag_remove(proc,cond->sleeping);
                xbt_swag_insert(proc, simix_global->process_to_run);
@@ -291,10 +295,12 @@ void SIMIX_cond_broadcast(smx_cond_t cond)
  */
 void SIMIX_cond_destroy(smx_cond_t cond)
 {
  */
 void SIMIX_cond_destroy(smx_cond_t cond)
 {
+   DEBUG1("Destroy condition %p",cond);
+   xbt_backtrace_display_current();
        if ( cond == NULL )
                return ;
        else {
        if ( cond == NULL )
                return ;
        else {
-               xbt_assert0( xbt_swag_size(cond->sleeping) == 0 , "Cannot destroy conditional");
+               xbt_assert0( xbt_swag_size(cond->sleeping) == 0 , "Cannot destroy conditional since someone is still using it");
                xbt_swag_free(cond->sleeping);
                xbt_fifo_free(cond->actions);
                xbt_free(cond);
                xbt_swag_free(cond->sleeping);
                xbt_fifo_free(cond->actions);
                xbt_free(cond);
@@ -313,6 +319,7 @@ void SIMIX_register_condition_to_action(smx_action_t action, smx_cond_t cond)
 {
        xbt_assert0( (action != NULL) && (cond != NULL), "Invalid parameters");
 
 {
        xbt_assert0( (action != NULL) && (cond != NULL), "Invalid parameters");
 
+   DEBUG2("Register condition %p to action %p",cond,action);
        xbt_fifo_push(action->cond_list,cond);
 }
 
        xbt_fifo_push(action->cond_list,cond);
 }