-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_kernel, sd,
- "Logging specific to SimDag (kernel)");
-
-SD_global_t sd_global = NULL;
-
-/**
- * \brief Initializes SD internal data
- *
- * This function must be called before any other SD function. Then you
- * should call SD_create_environment().
- *
- * \param argc argument number
- * \param argv argument list
- * \see SD_create_environment(), SD_exit()
- */
-void SD_init(int *argc, char **argv)
-{
- TRACE_global_init(argc, argv);
-
- xbt_assert(sd_global == NULL, "SD_init() already called");
-
- sd_global = xbt_new(s_SD_global_t, 1);
- sd_global->workstation_list = NULL;
- sd_global->link_list = NULL;
- sd_global->recyclable_route = NULL;
- sd_global->watch_point_reached = 0;
-
- sd_global->task_mallocator=xbt_mallocator_new(65536, SD_task_new_f,
- SD_task_free_f,
- SD_task_recycle_f);
-
- sd_global->initial_task_set = xbt_dynar_new(sizeof(SD_task_t), NULL);
- sd_global->executable_task_set = xbt_dynar_new(sizeof(SD_task_t), NULL);
- sd_global->completed_task_set = xbt_dynar_new(sizeof(SD_task_t), NULL);
- sd_global->return_set = xbt_dynar_new(sizeof(SD_task_t), NULL);
-
- sd_global->task_number = 0;
-
- surf_init(argc, argv);
-
- xbt_cfg_setdefault_string(_sg_cfg_set, "host/model",
- "ptask_L07");
-
-#ifdef HAVE_JEDULE
- jedule_sd_init();
-#endif
-
- XBT_DEBUG("ADD SD LEVELS");
- SD_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,__SD_storage_destroy);
-
- if (_sg_cfg_exit_asap) {
- SD_exit();
- exit(0);
- }
-}
-
-/** \brief set a configuration variable
- *
- * Do --help on any simgrid binary to see the list of currently existing
- * configuration variables, and see Section @ref options.
- *
- * Example:
- * SD_config("host/model","default");
- */
-void SD_config(const char *key, const char *value){
- xbt_assert(sd_global,"ERROR: Please call SD_init() before using SD_config()");
- xbt_cfg_set_as_string(_sg_cfg_set, key, value);
-}
-
-
-/**
- * \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;
-
-// SD_task_t done_task, next_done_task;
- xbt_die("This function is not working since the C++ links and others. Please report the problem if you really need that function.");
-
- XBT_DEBUG("Recreating the swags...");
-
-// xbt_swag_foreach_safe(done_task, next_done_task, sd_global->done_task_set){
-// if (xbt_dynar_is_empty(done_task->tasks_before)){
-// __SD_task_set_state(done_task, SD_SCHEDULABLE);
-// } else{
-// __SD_task_set_state(done_task, SD_NOT_SCHEDULED);
-// done_task->unsatisfied_dependencies =
-// xbt_dynar_length(done_task->tasks_before);
-// done_task->is_not_ready = done_task->unsatisfied_dependencies;
-// }
-// free(done_task->workstation_list);
-// done_task->workstation_list = NULL;
-// done_task->workstation_nb = 0;
-// }
-
- sd_global->task_number = 0;
-
-
-#ifdef HAVE_JEDULE
- jedule_sd_dump();
- jedule_sd_cleanup();
- jedule_sd_init();
-#endif