+ xbt_swag_free(sd_global->done_task_set);
+
+ 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_dump();
+ jedule_sd_cleanup();
+ jedule_sd_init();
+#endif
+}
+
+/**
+ * \brief Creates the environment
+ *
+ * The environment (i.e. the \ref SD_workstation_management "workstations"
+ * and the \ref SD_link_management "links") is created with the data stored
+ * in the given XML platform file.
+ *
+ * \param platform_file name of an XML file describing the environment to create
+ * \see SD_workstation_management, SD_link_management
+ *
+ * The XML file follows this DTD:
+ *
+ * \include simgrid.dtd
+ *
+ * Here is a small example of such a platform:
+ *
+ * \include small_platform.xml
+ */
+void SD_create_environment(const char *platform_file)
+{
+ xbt_lib_cursor_t cursor = NULL;
+ char *name = NULL;
+ void **surf_workstation = NULL;
+ void **surf_storage = NULL;
+
+ parse_platform_file(platform_file);
+
+ /* now let's create the SD wrappers for workstations, storages and links */
+ xbt_lib_foreach(host_lib, cursor, name, surf_workstation){
+ if(surf_workstation[SURF_HOST_LEVEL])
+ __SD_workstation_create(surf_workstation[SURF_HOST_LEVEL], NULL);