+
+ xbt_cfg_setdefault_string(_surf_cfg_set, "workstation/model",
+ "ptask_L07");
+
+#ifdef HAVE_TRACING
+ TRACE_start ();
+#endif
+
+#ifdef HAVE_JEDULE
+ jedule_sd_init();
+#endif
+
+ XBT_DEBUG("ADD SD LEVELS");
+ SD_HOST_LEVEL = xbt_lib_add_level(host_lib,__SD_workstation_destroy);
+ SD_LINK_LEVEL = xbt_lib_add_level(link_lib,__SD_link_destroy);
+}
+
+/**
+ * \brief Reinits the application part of the simulation (experimental feature)
+ *
+ * This function allows you to run several simulations on the same platform
+ * by resetting the part describing the application.
+ *
+ * @warning: this function is still experimental and not perfect. For example,
+ * the simulation clock (and traces usage) is not reset. So, do not use it if
+ * you use traces in your simulation, and do not use absolute timing after using it.
+ * That being said, this function is still precious if you want to compare a bunch of
+ * heuristics on the same platforms.
+ */
+void SD_application_reinit(void)
+{
+
+ s_SD_task_t task;
+
+ XBT_DEBUG("Recreating the swags...");
+ xbt_swag_free(sd_global->not_scheduled_task_set);
+ xbt_swag_free(sd_global->schedulable_task_set);
+ xbt_swag_free(sd_global->scheduled_task_set);
+ xbt_swag_free(sd_global->runnable_task_set);
+ xbt_swag_free(sd_global->in_fifo_task_set);
+ xbt_swag_free(sd_global->running_task_set);
+ xbt_swag_free(sd_global->done_task_set);
+ xbt_swag_free(sd_global->failed_task_set);
+
+ sd_global->not_scheduled_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->schedulable_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->scheduled_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->runnable_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->in_fifo_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->running_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->done_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->failed_task_set =
+ xbt_swag_new(xbt_swag_offset(task, state_hookup));
+ sd_global->task_number = 0;
+
+#ifdef HAVE_JEDULE
+ jedule_sd_cleanup();
+ jedule_sd_init();
+#endif