-xbt_dynar_t SD_dotload_with_sched(const char *filename) {
- computers = xbt_dict_new_homogeneous(NULL);
- SD_dotload_generic(filename, sequential);
-
- if(schedule){
- xbt_dynar_t computer = NULL;
- xbt_dict_cursor_t dict_cursor;
- char *computer_name;
- const SD_workstation_t *workstations = SD_workstation_get_list ();
- xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
- int count_computer = atoi(computer_name);
- unsigned int count=0;
- SD_task_t task;
- SD_task_t task_previous = NULL;
- xbt_dynar_foreach(computer,count,task){
- /* add dependency between the previous and the task to avoid
- * parallel execution */
- if(task != NULL ){
- if(task_previous != NULL &&
- !SD_task_dependency_exists(task_previous, task))
- SD_task_dependency_add(NULL, NULL, task_previous, task);
- SD_task_schedulel(task, 1, workstations[count_computer]);
- task_previous = task;
- }
- }
- xbt_dynar_free(&computer);
- }
- xbt_dict_free(&computers);
- if(acyclic_graph_detail(result))
- return result;
- else
- XBT_WARN("There is at least one cycle in the provided task graph");
- }else{
- XBT_WARN("The scheduling is ignored");
- }
- xbt_dynar_t computer = NULL;
- xbt_dict_cursor_t dict_cursor;
- char *computer_name;
- xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
- xbt_dynar_free(&computer);
- }
- xbt_dict_free(&computers);
- xbt_dynar_free(&result);
- return NULL;