Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
getting rid of MSG_getClock
[simgrid.git] / src / msg / global.c
index 2c19859..b0c7eae 100644 (file)
@@ -5,9 +5,9 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include"private.h"
-#include"xbt/sysdep.h"
-#include "xbt/error.h"
+#include "private.h"
+#include "xbt/sysdep.h"
+#include "xbt/log.h"
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(global, msg,
                                "Logging specific to MSG (global)");
 
@@ -317,7 +317,7 @@ MSG_error_t MSG_main(void)
   m_process_t process = NULL;
   int nbprocess,i;
   double elapsed_time = 0.0;
-  int state_modifications;
+  int state_modifications = 1;
   /* Clean IO before the run */
   fflush(stdout);
   fflush(stderr);
@@ -329,7 +329,7 @@ MSG_error_t MSG_main(void)
     if(xbt_fifo_size(msg_global->process_to_run) && (elapsed_time>0)) {
       DEBUG0("**************************************************");
     }
-    if((__stop_at_time>0) && (MSG_getClock() >= __stop_at_time)) {
+    if((__stop_at_time>0) && (MSG_get_clock() >= __stop_at_time)) {
       DEBUG0("Let's stop here!");
     }
 
@@ -358,7 +358,7 @@ MSG_error_t MSG_main(void)
       }
       
       if(!state_modifications) {
-       DEBUG1("%g : Calling surf_solve",MSG_getClock());
+       DEBUG1("%g : Calling surf_solve",MSG_get_clock());
        elapsed_time = surf_solve();
        DEBUG1("Elapsed_time %g",elapsed_time);
        
@@ -376,7 +376,7 @@ MSG_error_t MSG_main(void)
          process = MSG_process_create_with_arguments(args->name, args->code, 
                                                      args->data, args->host,
                                                      args->argc,args->argv);
-         if(args->kill_time > MSG_getClock()) {
+         if(args->kill_time > MSG_get_clock()) {
            surf_timer_resource->extension_public->set(args->kill_time, 
                                                       (void*) &MSG_process_kill,
                                                       (void*) process);
@@ -464,7 +464,7 @@ MSG_error_t MSG_main(void)
        if(p_simdata->waiting_task) {
          if(p_simdata->waiting_task->simdata->compute) {
            if(p_simdata->put_host) 
-             fprintf(stderr,"Trying to send a task on Host %s, channel %d.\n",
+             fprintf(stderr,"Trying to send a task to Host %s, channel %d.\n",
                      p_simdata->put_host->name, p_simdata->put_channel);
            else 
              fprintf(stderr,"Waiting for %s to finish.\n",p_simdata->waiting_task->name);
@@ -498,7 +498,6 @@ MSG_error_t MSG_main(void)
  */
 int MSG_process_killall(int reset_PIDs)
 {
-  xbt_fifo_item_t i = NULL;
   m_process_t p = NULL;
   m_process_t self = MSG_process_self();
 
@@ -548,20 +547,12 @@ MSG_error_t MSG_clean(void)
     msg_global->paje_output = NULL;
   }
   free(msg_global);
-  surf_finalize();
+  surf_exit();
 
   return MSG_OK;
 }
 
 
-/** \ingroup msg_easier_life
- * \brief A clock (in second).
- * \deprecated Use MSG_get_clock
- */
-double MSG_getClock(void) {
-  return surf_get_clock();
-}
-
 /** \ingroup msg_easier_life
  * \brief A clock (in second).
  */