+ 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;
+}
+
+xbt_dynar_t SD_PTG_dotload(const char * filename) {
+ xbt_dynar_t result = SD_dotload_generic(filename, parallel);
+ if (!acyclic_graph_detail(result)) {
+ XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.",
+ basename((char*)filename));
+ xbt_dynar_free(&result);
+ /* (result == NULL) here */
+ }
+ return result;
+}
+
+#ifdef HAVE_CGRAPH_H
+static int edge_compare(const void *a, const void *b)
+{
+ unsigned va = AGSEQ(*(Agedge_t **)a);
+ unsigned vb = AGSEQ(*(Agedge_t **)b);
+ return va == vb ? 0 : (va < vb ? -1 : 1);
+}
+#endif
+
+xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){
+ xbt_assert(filename, "Unable to use a null file descriptor\n");
+ unsigned int i;
+ result = xbt_dynar_new(sizeof(SD_task_t), dot_task_p_free);
+ jobs = xbt_dict_new_homogeneous(NULL);
+ FILE *in_file = fopen(filename, "r");
+ if (in_file == NULL)
+ xbt_die("Failed to open file: %s", filename);
+ dag_dot = agread(in_file, NIL(Agdisc_t *));
+ SD_task_t root, end, task;
+ /*
+ * Create all the nodes