Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added all TCP VEGAS/RENO related functions. TODO: the diff functions in
[simgrid.git] / src / msg / global.c
index 26faad1..db26236 100644 (file)
@@ -1,3 +1,4 @@
+
 /*     $Id$     */
 
 /* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved.        */
@@ -23,7 +24,10 @@ MSG_Global_t msg_global = NULL;
  *  \brief This section describes the functions you need to know to
  *  set up a simulation. You should have a look at \ref MSG_examples 
  *  to have an overview of their usage.
- *    \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Simulation functions" --> \endhtmlonly
+ */ 
+
+/** \addtogroup msg_simulation
+ *  \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Simulation functions" --> \endhtmlonly
  */
 
 /********************************* MSG **************************************/
@@ -46,7 +50,6 @@ void MSG_global_init(int *argc, char **argv)
      
     msg_global = xbt_new0(s_MSG_Global_t,1);
 
-    xbt_context_init();
     msg_global->host = xbt_fifo_new();
     msg_global->process_to_run = xbt_fifo_new();
     msg_global->process_list = xbt_fifo_new();
@@ -67,30 +70,17 @@ void MSG_global_init(int *argc, char **argv)
 void MSG_paje_output(const char *filename)
 {
   int i;
-  const char *paje_preembule="%EventDef        SetLimits       0\n"
-    "% StartTime       date\n"
-    "% EndTime date\n"
-    "%EndEventDef\n"
+  const char *paje_preembule=
     "%EventDef PajeDefineContainerType 1\n"
     "% NewType string\n"
     "% ContainerType   string\n"
     "% NewName string\n"
     "%EndEventDef\n"
-    "%EventDef PajeDefineEventType     2\n"
-    "% NewType string\n"
-    "% ContainerType   string\n"
-    "% NewName string\n"
-    "%EndEventDef\n"
     "%EventDef PajeDefineStateType     3\n"
     "% NewType string\n"
     "% ContainerType   string\n"
     "% NewName string\n"
     "%EndEventDef\n"
-    "%EventDef PajeDefineVariableType  4\n"
-    "% NewType string\n"
-    "% ContainerType   string\n"
-    "% NewName string\n"
-    "%EndEventDef\n"
     "%EventDef PajeDefineLinkType      5\n"
     "% NewType string\n"
     "% ContainerType   string\n"
@@ -115,34 +105,12 @@ void MSG_paje_output(const char *filename)
     "% Name    string\n"
     "% Type    string\n"
     "%EndEventDef\n"
-    "%EventDef PajeNewEvent    9\n"
-    "% Time    date\n"
-    "% EntityType      string\n"
-    "% Container       string\n"
-    "% Value   string\n"
-    "%EndEventDef\n"
     "%EventDef PajeSetState    10\n"
     "% Time    date\n"
     "% EntityType      string\n"
     "% Container       string\n"
     "% Value   string\n"
     "%EndEventDef\n"
-    "%EventDef PajeSetState    101\n"
-    "% Time    date\n"
-    "% EntityType      string\n"
-    "% Container       string\n"
-    "% Value   string\n"
-    "% FileName        string\n"
-    "% LineNumber      int\n"
-    "%EndEventDef\n"
-    "%EventDef PajePushState   111\n"
-    "% Time    date\n"
-    "% EntityType      string\n"
-    "% Container       string\n"
-    "% Value   string\n"
-    "% FileName        string\n"
-    "% LineNumber      int\n"
-    "%EndEventDef\n"
     "%EventDef PajePushState   11\n"
     "% Time    date\n"
     "% EntityType      string\n"
@@ -155,24 +123,6 @@ void MSG_paje_output(const char *filename)
     "% EntityType      string\n"
     "% Container       string\n"
     "%EndEventDef\n"
-    "%EventDef PajeSetVariable 13\n"
-    "% Time    date\n"
-    "% EntityType      string\n"
-    "% Container       string\n"
-    "% Value   double\n"
-    "%EndEventDef\n"
-    "%EventDef PajeAddVariable 14\n"
-    "% Time    date\n"
-    "% EntityType      string\n"
-    "% Container       string\n"
-    "% Value   double\n"
-    "%EndEventDef\n"
-    "%EventDef PajeSubVariable 15\n"
-    "% Time    date\n"
-    "% EntityType      string\n"
-    "% Container       string\n"
-    "% Value   double\n"
-    "%EndEventDef\n"
     "%EventDef PajeStartLink   16\n"
     "% Time    date\n"
     "% EntityType      string\n"
@@ -243,8 +193,10 @@ void MSG_paje_output(const char *filename)
 /** \defgroup m_channel_management    Understanding channels
  *  \brief This section briefly describes the channel notion of MSG
  *  (#m_channel_t).
- *    \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Channels" --> \endhtmlonly
- * 
+ */
+
+/** \addtogroup m_channel_management
+ *  \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Channels" --> \endhtmlonly
  *
  *  For convenience, the simulator provides the notion of channel
  *  that is close to the tag notion in MPI. A channel is not a
@@ -344,7 +296,7 @@ void __MSG_display_process_status(void)
 /* FIXME: Yeah, I'll do it in a portable maner one day [Mt] */
 #include <signal.h>
 
-static void inthandler(int ignored)
+static void _XBT_CALL inthandler(int ignored)
 {
    INFO0("CTRL-C pressed. Displaying status and bailing out");
    __MSG_display_process_status();
@@ -476,7 +428,7 @@ MSG_error_t MSG_main(void)
   }
 
   if (xbt_fifo_size(msg_global->process_list) == 0) {
-    INFO0("Congratulations ! Simulation terminated : all processes are over");
+/*     INFO0("Congratulations ! Simulation terminated : all processes are over"); */
     return MSG_OK;
   } else {
     INFO0("Oops ! Deadlock or code not perfectly clean.");
@@ -535,7 +487,6 @@ MSG_error_t MSG_clean(void)
   while((p=xbt_fifo_pop(msg_global->process_list))) {
     MSG_process_kill(p);
   }
-  xbt_context_exit();
 
   xbt_fifo_foreach(msg_global->host,i,h,m_host_t) {
     __MSG_host_destroy(h);
@@ -552,6 +503,7 @@ MSG_error_t MSG_clean(void)
   }
   msg_config_finalize();
   free(msg_global);
+  msg_global = NULL;
   surf_exit();
 
   return MSG_OK;