+xbt_dynar_t SD_dotload_with_sched(const char *filename){
+ FILE *in_file = fopen(filename, "r");
+ xbt_assert1(in_file, "Unable to open \"%s\"\n", filename);
+ SD_dotload_FILE(in_file);
+ fclose(in_file);
+
+ if(schedule == true){
+ 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 = dot_parse_int(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_detection(result))
+ return result;
+ else
+ WARN0("There are a cycle in your task graph");
+ }else{
+ WARN0("No scheduling provided");
+ }
+ return NULL;
+}
+