bool parents_are_marked(SD_task_t task);
/* Parsing helpers */
-static void dax_parse_error(char *msg)
-{
- fprintf(stderr, "Parse error on line %d: %s\n", dax_lineno, msg);
- xbt_abort();
-}
static double dax_parse_double(const char *string)
{
double value;
ret = sscanf(string, "%lg", &value);
- if (ret != 1)
- dax_parse_error(bprintf("%s is not a double", string));
+ xbt_assert (ret == 1, "Parse error on line %d: %s is not a double",
+ dax_lineno, string);
return value;
}
jobs = xbt_dict_new_homogeneous(NULL);
root_task = SD_task_create_comp_seq("root", NULL, 0);
/* by design the root task is always SCHEDULABLE */
- __SD_task_set_state(root_task, SD_SCHEDULABLE);
+ SD_task_set_state(root_task, SD_SCHEDULABLE);
xbt_dynar_push(result, &root_task);
end_task = SD_task_create_comp_seq("end", NULL, 0);
newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount);
SD_task_dependency_add(NULL, NULL, root_task, newfile);
SD_task_dependency_add(NULL, NULL, newfile, depafter->dst);
- if (depafter->src){
- const char *category = depafter->src->category;
- if (category){
- TRACE_category (category);
- TRACE_sd_set_task_category(newfile, category);
- }
- }
xbt_dynar_push(result, &newfile);
}
} else if (xbt_dynar_is_empty(file->tasks_after)) {
newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount);
SD_task_dependency_add(NULL, NULL, depbefore->src, newfile);
SD_task_dependency_add(NULL, NULL, newfile, end_task);
- if (depbefore->src){
- const char *category = depbefore->src->category;
- if (category){
- TRACE_category (category);
- TRACE_sd_set_task_category(newfile, category);
- }
- }
xbt_dynar_push(result, &newfile);
}
} else {
newfile = SD_task_create_comm_e2e(file->name, NULL, file->amount);
SD_task_dependency_add(NULL, NULL, depbefore->src, newfile);
SD_task_dependency_add(NULL, NULL, newfile, depafter->dst);
- if (depbefore->src){
- const char *category = depbefore->src->category;
- if (category){
- TRACE_category (category);
- TRACE_sd_set_task_category(newfile, category);
- }
- }
xbt_dynar_push(result, &newfile);
}
}
runtime *= 4200000000.; /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
// XBT_INFO("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
current_job = SD_task_create_comp_seq(name, NULL, runtime);
- char *category = A_dax__job_name;
- if (category){
- TRACE_category (category);
- TRACE_sd_set_task_category(current_job, category);
- }
xbt_dict_set(jobs, A_dax__job_id, current_job, NULL);
free(name);
xbt_dynar_push(result, ¤t_job);
void STag_dax__child(void)
{
current_child = (SD_task_t)xbt_dict_get_or_null(jobs, A_dax__child_ref);
- if (current_child == NULL)
- dax_parse_error(bprintf
- ("Asked to add dependencies to the non-existent %s task",
- A_dax__child_ref));
+ xbt_assert(current_child != NULL,"Parse error on line %d:"
+ "Asked to add dependencies to the non-existent %s task",
+ dax_lineno, A_dax__child_ref);
}
void ETag_dax__child(void)
void STag_dax__parent(void)
{
SD_task_t parent = (SD_task_t)xbt_dict_get_or_null(jobs, A_dax__parent_ref);
- if (parent == NULL)
- dax_parse_error(bprintf
- ("Asked to add a dependency from %s to %s, but %s does not exist",
- current_child->name, A_dax__parent_ref,
- A_dax__parent_ref));
+ xbt_assert(parent != NULL, "Parse error on line %d: "
+ "Asked to add a dependency from %s to %s, but %s does not exist",
+ dax_lineno, current_child->name, A_dax__parent_ref,
+ A_dax__parent_ref);
SD_task_dependency_add(NULL, NULL, parent, current_child);
XBT_DEBUG("Control-flow dependency from %s to %s", current_child->name,
parent->name);