Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I don't think it does what it should now but at least it looks better and
[simgrid.git] / src / surf / surf.c
index 334fc64..30bdc88 100644 (file)
@@ -8,9 +8,9 @@
 #include "surf_private.h"
 #include "xbt/module.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_global, surf,
-                               "Logging specific to the SURF global module");
-
+typedef struct surf_resource_object {
+  surf_resource_t resource;
+} s_surf_resource_object_t, *surf_resource_object_t;
 
 static double NOW = 0;
 
@@ -47,7 +47,7 @@ double generic_maxmin_share_resources2(xbt_swag_t running_actions,
     return -1.0;
 
   if (value > 0) {
-    min = value = action->remains / value;
+    min = action->remains / value;
     if ((action->max_duration >= 0) && (action->max_duration < min))
       min = action->max_duration;
   } else
@@ -122,19 +122,12 @@ void surf_action_set_data(surf_action_t action,
   action->data=data;
 }
 
-/* HACKHACK: msg_global must be set to a sensible value (like NULL) to use the logging mecanisme
- * since log_default_appender use xbt_procname which, in SG, is defined in src/msg/m_process.c
- * (in RL, xbt_procname is defined in src/gras/Virtu/rl_process.c)
- */
-extern void *msg_global;
-
 void surf_init(int *argc, char **argv)
 {
   int i,j;
   char *opt;
 
   xbt_init(argc, argv);
-  msg_global=NULL; /* see HACKHACK note above */
   if (!surf_path) {
     const char *initial_path = "./";
     surf_path = xbt_dynar_new(sizeof(char*), NULL);
@@ -198,7 +191,7 @@ FILE *surf_fopen(const char *name, const char *mode)
   return file;
 }
 
-void surf_finalize(void)
+void surf_exit(void)
 {
   int i;
   surf_resource_t resource = NULL;
@@ -227,6 +220,7 @@ void surf_finalize(void)
     free(path_name);
     path_name = NULL;
   }
+  xbt_exit();
 }
 
 double surf_solve(void)