- xbt_dict_set(jobs, name, current_job, NULL);
- xbt_dynar_push(result, ¤t_job);
- }
- Agedge_t *e;
- int count = 0;
-
-#ifdef HAVE_CGRAPH_H
- for (e = agfstin(dag_dot, dag_node); e; e = agnxtin(dag_dot, e))
-#elif HAVE_AGRAPH_H
- for (e = agfstin(dag_node); e; e = agnxtin(e))
-#endif
- {
- dot_add_input_dependencies(current_job, e);
- count++;
- }
- if (count == 0 && current_job != root_task) {
- SD_task_dependency_add(NULL, NULL, root_task, current_job);
- }
- count = 0;
-#ifdef HAVE_CGRAPH_H
- for (e = agfstout(dag_dot, dag_node); e; e = agnxtout(dag_dot, e))
-#elif HAVE_AGRAPH_H
- for (e = agfstout(dag_node); e; e = agnxtout(e))
-#endif
- {
-
- dot_add_output_dependencies(current_job, e);
- count++;
- }
- if (count == 0 && current_job != end_task) {
- SD_task_dependency_add(NULL, NULL, current_job, end_task);
- }
-
- if(schedule || XBT_LOG_ISENABLED(sd_dotparse, xbt_log_priority_verbose)){
- /* try to take the information to schedule the task only if all is
- * right*/
- // performer is the computer which execute the task
- unsigned long performer = -1;
- char * char_performer = agget(dag_node, (char *) "performer");
- if (char_performer != NULL)
- performer = (long) dot_parse_int(char_performer);
-
- // order is giving the task order on one computer
- unsigned long order = -1;
- char * char_order = agget(dag_node, (char *) "order");
- if (char_order != NULL)
- order = (long) dot_parse_int(char_order);
- xbt_dynar_t computer = NULL;
- //XBT_INFO("performer = %d, order=%d",performer,order);
- if(performer != -1 && order != -1){
- //necessary parameters are given
- computer = xbt_dict_get_or_null(computers, char_performer);
- if(computer == NULL){
- computer = xbt_dynar_new(sizeof(SD_task_t), NULL);
- xbt_dict_set(computers, char_performer, computer, NULL);
+ xbt_dict_set(jobs, name, task, NULL);
+ if (!strcmp(name, "root")){
+ /* by design the root task is always SCHEDULABLE */
+ __SD_task_set_state(task, SD_SCHEDULABLE);
+ /* Put it at the beginning of the dynar */
+ xbt_dynar_insert_at(result, 0, &task);
+ } else {
+ if (!strcmp(name, "end")){
+ XBT_DEBUG("Declaration of the 'end' node, don't store it yet.");
+ end = task;
+ /* Should be inserted later in the dynar */
+ } else {
+ xbt_dynar_push(result, &task);
+ }