- char *name = agnameof(node);
- double amount = atof(agget(node, (char *) "size"));
-
- if (!(task = (SD_task_t)xbt_dict_get_or_null(jobs, name))) {
- if (seq_or_par == sequential){
- XBT_DEBUG("See <job id=%s amount =%.0f>", name, amount);
- task = SD_task_create_comp_seq(name, NULL , amount);
- } else {
- double alpha = atof(agget(node, (char *) "alpha"));
- XBT_DEBUG("See <job id=%s amount =%.0f alpha = %.3f>", name, amount, alpha);
- task = SD_task_create_comp_par_amdahl(name, NULL , amount, alpha);
- }
-
- xbt_dict_set(jobs, name, task, NULL);
-
- if (strcmp(name,"root") && strcmp(name,"end"))
- xbt_dynar_push(result, &task);
-
- if((seq_or_par == sequential) &&
- ((schedule && schedule_success) || XBT_LOG_ISENABLED(sd_dotparse, xbt_log_priority_verbose))){
- /* try to take the information to schedule the task only if all is right*/
- char *char_performer = agget(node, (char *) "performer");
- char *char_order = agget(node, (char *) "order");
- /* Tasks will execute on in a given "order" on a given set of "performer" hosts */
- int performer = ((!char_performer || !strcmp(char_performer,"")) ? -1:atoi(char_performer));
- int order = ((!char_order || !strcmp(char_order, ""))? -1:atoi(char_order));
-
- if((performer != -1 && order != -1) && performer < (int) sg_host_count()){
- /* required parameters are given and less performers than hosts are required */
- XBT_DEBUG ("Task '%s' is scheduled on workstation '%d' in position '%d'", task->name, performer, order);
- if(!(computer = (xbt_dynar_t) xbt_dict_get_or_null(computers, char_performer))){
- computer = xbt_dynar_new(sizeof(SD_task_t), NULL);
- xbt_dict_set(computers, char_performer, computer, NULL);
- }
-
- if((unsigned int)order < xbt_dynar_length(computer)){
- SD_task_t *task_test = (SD_task_t *)xbt_dynar_get_ptr(computer,order);
- if(*task_test && *task_test != task){
- /* the user gave the same order to several tasks */
- schedule_success = false;
- XBT_VERB("Task '%s' wants to start on performer '%s' at the same position '%s' as task '%s'",
- (*task_test)->name, char_performer, char_order, task->name);
- continue;
- }
- }
- /* the parameter seems to be ok */
- xbt_dynar_set_as(computer, order, SD_task_t, task);
- } else {
- /* one of required parameters is not given */
- schedule_success = false;
- XBT_VERB("The schedule is ignored, task '%s' can not be scheduled on %d hosts", task->name, performer);
- }
- }