Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
[simgrid.git] / src / simix / smx_global.c
index 51e8050..4c933f7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id$     */
+/*     $Id: smx_global.c 5483 2008-05-21 09:53:01Z alegrand $   */
 
 /* Copyright (c) 2007 Arnaud Legrand, Bruno Donassolo.
    All rights reserved.                                          */
@@ -113,7 +113,7 @@ void SIMIX_global_init(int *argc, char **argv)
 
     simix_global = xbt_new0(s_SIMIX_Global_t, 1);
 
-    simix_global->host = xbt_fifo_new();
+    simix_global->host = xbt_dict_new();
     simix_global->process_to_run =
        xbt_swag_new(xbt_swag_offset(proc, synchro_hookup));
     simix_global->process_list =
@@ -153,18 +153,18 @@ void SIMIX_display_process_status(void)
             : ((process->simdata->suspended) ? "[SUSPENDED] " : ""));
 
     if (p_simdata->mutex) {
-      who2 = bprintf("%s Blocked on mutex %p", who, (XBT_LOG_ISENABLED(simix_kernel,xbt_log_priority_verbose))?p_simdata->mutex:NULL);
+      who2 = bprintf("%s Blocked on mutex %p", who, (XBT_LOG_ISENABLED(simix_kernel,xbt_log_priority_verbose))?p_simdata->mutex:(void*)0xdead);
       free(who);
       who = who2;
     } else if (p_simdata->cond) {
       who2 =
          bprintf
          ("%s Blocked on condition %p; Waiting for the following actions:",
-          who, (XBT_LOG_ISENABLED(simix_kernel,xbt_log_priority_verbose))?p_simdata->cond:NULL);
+          who, (XBT_LOG_ISENABLED(simix_kernel,xbt_log_priority_verbose))?p_simdata->cond:(void*)0xdead);
       free(who);
       who = who2;
       xbt_fifo_foreach(p_simdata->cond->actions, item, act, smx_action_t) {
-       who2 = bprintf("%s '%s'(%p)", who, act->name,(XBT_LOG_ISENABLED(simix_kernel,xbt_log_priority_verbose))?act:NULL);
+       who2 = bprintf("%s '%s'(%p)", who, act->name,(XBT_LOG_ISENABLED(simix_kernel,xbt_log_priority_verbose))?act:(void*)0xdead);
        free(who);
        who = who2;
       }
@@ -278,18 +278,13 @@ void SIMIX_process_killall()
  */
 void SIMIX_clean(void)
 {
-  xbt_fifo_item_t i = NULL;
-  smx_host_t h = NULL;
   smx_process_t p = NULL;
 
   while ((p = xbt_swag_extract(simix_global->process_list))) {
     SIMIX_process_kill(p);
   }
 
-  xbt_fifo_foreach(simix_global->host, i, h, smx_host_t) {
-    __SIMIX_host_destroy(h);
-  }
-  xbt_fifo_free(simix_global->host);
+  xbt_dict_free(&(simix_global->host));
   xbt_swag_free(simix_global->process_to_run);
   xbt_swag_free(simix_global->process_list);
   xbt_dict_free(&(simix_global->registered_functions));