Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix doc
[simgrid.git] / src / simdag / sd_global.c
index dd7fd6a7d4752bbad7d84980264ead07f4c18edc..1e5f521235e974dd5d891c07dae6efd5593124be 100644 (file)
@@ -84,9 +84,12 @@ void SD_init(int *argc, char **argv)
   sd_global->task_number = 0;
 
   surf_init(argc, argv);
-#ifndef HAVE_TRACING
+
   xbt_cfg_setdefault_string(_surf_cfg_set, "workstation/model",
                             "ptask_L07");
+
+#ifdef HAVE_TRACING
+  TRACE_start ();
 #endif
 }
 
@@ -198,8 +201,11 @@ void SD_create_environment(const char *platform_file)
  * \brief Launches the simulation.
  *
  * The function will execute the \ref SD_RUNNABLE runnable tasks.
- * The simulation will be stopped when its time reaches \a how_long,
- * when a watch point is reached, or when no more task can be executed.
+ * If \a how_long is positive, then the simulation will be stopped either
+ * when time reaches \a how_long or when a watch point is reached.
+ * A nonpositive value for \a how_long means no time limit, in which case
+ * the simulation will be stopped either when a watch point is reached or
+ * when no more task can be executed.
  * Then you can call SD_simulate() again.
  *
  * \param how_long maximum duration of the simulation (a negative value means no time limit)
@@ -405,6 +411,9 @@ void SD_exit(void)
     WARN0("SD_exit() called, but SimDag is not running");
     /* we cannot use exceptions here because xbt is not running! */
   }
+#ifdef HAVE_TRACING
+  TRACE_end();
+#endif
 }
 
 /**