SD_global_t sd_global = NULL;
-XBT_LOG_EXTERNAL_CATEGORY(sd_kernel);
-XBT_LOG_EXTERNAL_CATEGORY(sd_task);
-XBT_LOG_EXTERNAL_CATEGORY(sd_workstation);
-
/**
* \brief Initialises SD internal data
*
xbt_assert(sd_global == NULL, "SD_init() already called");
- /* Connect our log channels: that must be done manually under windows */
- XBT_LOG_CONNECT(sd_kernel, sd);
- XBT_LOG_CONNECT(sd_task, sd);
- XBT_LOG_CONNECT(sd_workstation, sd);
-
-
sd_global = xbt_new(s_SD_global_t, 1);
sd_global->workstation_list = NULL;
sd_global->link_list = NULL;
sd_global->watch_point_reached = 0;
- while(xbt_swag_extract(sd_global->return_set)) {}
+ xbt_swag_reset(sd_global->return_set);
/* explore the runnable tasks */
xbt_swag_foreach_safe(task, task_safe, sd_global->runnable_task_set) {
xbt_mallocator_free(sd_global->task_mallocator);
- XBT_DEBUG("Destroying workstation and link arrays if necessary...");
- if (sd_global->workstation_list != NULL)
- xbt_free(sd_global->workstation_list);
-
- if (sd_global->link_list != NULL)
- xbt_free(sd_global->link_list);
-
- if (sd_global->recyclable_route != NULL)
- xbt_free(sd_global->recyclable_route);
+ XBT_DEBUG("Destroying workstation and link arrays...");
+ xbt_free(sd_global->workstation_list);
+ xbt_free(sd_global->link_list);
+ xbt_free(sd_global->recyclable_route);
XBT_DEBUG("Destroying the swags...");
xbt_swag_free(sd_global->not_scheduled_task_set);
xbt_swag_free(sd_global->failed_task_set);
xbt_swag_free(sd_global->return_set);
+#ifdef HAVE_TRACING
+ TRACE_end();
+#endif
+
XBT_DEBUG("Exiting Surf...");
surf_exit();
xbt_free(sd_global);
sd_global = NULL;
-#ifdef HAVE_TRACING
- TRACE_end();
-#endif
#ifdef HAVE_JEDULE
jedule_sd_dump();
jedule_sd_cleanup();