-/**
- * \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
-}
-
-/**
- * \brief Creates the environment
- *
- * The environment (i.e. the \ref sg_host_management "hosts"
- * 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 sg_host_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_storage = NULL;
-
- parse_platform_file(platform_file);
-
- /* now let's create the SD wrappers for storage elements */
- xbt_lib_foreach(storage_lib, cursor, name, surf_storage) {
- if(surf_storage[SURF_STORAGE_LEVEL])
- __SD_storage_create(surf_storage[SURF_STORAGE_LEVEL], NULL);
- }
-
- XBT_DEBUG("Workstation number: %zu, link number: %d",
- sg_host_count(), sg_link_count());
-#ifdef HAVE_JEDULE
- jedule_setup_platform();
-#endif
-}
-
-/**
- * \brief Launches the simulation.
- *
- * The function will execute the \ref SD_RUNNABLE runnable tasks.
- * 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 non-positive 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)
- * \return a dynar of \ref SD_task_t whose state has changed.
- * \see SD_task_schedule(), SD_task_watch()
- */
-
-xbt_dynar_t SD_simulate(double how_long) {
- /* we stop the simulation when total_time >= how_long */
- double total_time = 0.0;
- double elapsed_time = 0.0;
- SD_task_t task, dst;
- SD_dependency_t dependency;
- surf_action_t action;
- unsigned int iter, depcnt;
- static int first_time = 1;
-
- if (first_time) {
- XBT_VERB("Starting simulation...");
-
- surf_presolve(); /* Takes traces into account */
- first_time = 0;
- }
-