Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
include the right files
[simgrid.git] / src / msg / global.c
index 7694c1e..6bf0f87 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)");
 
@@ -29,19 +29,15 @@ MSG_Global_t msg_global = NULL;
 /** \ingroup msg_simulation
  * \brief Initialize some MSG internal data.
  */
-void MSG_global_init(void)
+void MSG_global_init_args(int *argc, char **argv)
 {
-  int argc=0;
-  char **argv=NULL;
-
-  CRITICAL0("Function MSG_global_init() is deprecated by MSG_global_init_args().");
-  MSG_global_init_args(&argc,argv);
+  MSG_global_init(argc,argv);
 }
 
 /** \ingroup msg_simulation
  * \brief Initialize some MSG internal data.
  */
-void MSG_global_init_args(int *argc, char **argv)
+void MSG_global_init(int *argc, char **argv)
 {
   if (!msg_global) {
     surf_init(argc, argv);     /* Initialize some common structures. Warning, it sets msg_global=NULL */
@@ -237,14 +233,6 @@ void MSG_paje_output(const char *filename)
   }
 }
 
-/** @deprecated Defines the verbosity of the simulation.
- *  @ingroup msg_simulation
- */
-void MSG_set_verbosity(MSG_outputmode_t mode)
-{
-  CRITICAL0("MSG_set_verbosity : Deprecated function. Use the XBT logging interface.");
-}
-
 /** \defgroup m_channel_management    Understanding channels
  *  \brief This section briefly describes the channel notion of MSG
  *  (#m_channel_t).
@@ -275,26 +263,6 @@ MSG_error_t MSG_set_channel_number(int number)
   return MSG_OK;
 }
 
-/** \ingroup m_simulation
- * \brief Set the sharing policy used for the links
- *
- * This function can be called to change the sharing policy used for the links 
-   (see \ref paper_tcp). By default the store and forward mechanism is used
-   with a parameter equal to 0.1. This function has to be called before creating 
-   any link. 
- * \param mode the sharing policy used for the links: can be either 
-   MSG_STORE_AND_FORWARD or MSG_TCP.
- * \param param a parameter for the sharing policy. It has to be >0. It is 
-   currently used only for the MSG_STORE_AND_FORWARD flavor and represents the
-   granularity of the communications (i.e. the packet size).
- */
-MSG_error_t MSG_set_sharing_policy(MSG_sharing_t mode, double param)
-{
-  CRITICAL0("MSG_set_sharing_policy: this function is now deprecated and useless. Store and forward does not exist anymore. Please stop using it.");
-  
-  return MSG_OK;
-}
-
 /** \ingroup m_channel_management
  * \brief Return the number of channel in the simulation.
  *
@@ -329,7 +297,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 +326,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 +344,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);
@@ -498,7 +466,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 +515,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).
  */