Commit aac3e3c5 authored by lhausamm's avatar lhausamm
Browse files

Add subtask for dependency tree

parent 89df1a1d
......@@ -109,7 +109,11 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta,
s->unlocks[ind] = tb;
s->unlock_ind[ind] = ta - s->tasks;
atomic_inc(&s->completed_unlock_writes);
scheduler_write_dependency(ta,tb);
}
void scheduler_write_dependency(struct task *ta, struct task *tb) {
int test = ta->ci->ti_end_min == 0 && tb->ci->ti_end_min == 0;
test = test && ta->ci->parent == NULL && tb->ci->parent == NULL;
if (test)
......@@ -120,7 +124,12 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta,
ssize_t read;
FILE *f;
sprintf(tmp, "%s->%s;\n", taskID_names[ta->type], taskID_names[tb->type]);
sprintf(tmp, "\t%s_%s->%s_%s;\n",
taskID_names[ta->type],
subtaskID_names[ta->subtype],
taskID_names[tb->type],
subtaskID_names[tb->subtype]
);
f = fopen("test_graph.viz", "r");
......@@ -138,6 +147,12 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta,
fclose(f);
}
else
{
f = fopen("test_graph.viz", "w");
fprintf(f,"digraph task_dep {\n\tcompound=true;\n\tratio=0.66;\n\tnode[nodesep=0.15];\n");
fclose(f);
}
if (test)
{
......@@ -147,8 +162,10 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta,
}
}
}
/**
* @brief Split a hydrodynamic task if too large.
*
......
......@@ -168,5 +168,6 @@ void scheduler_dump_queue(struct scheduler *s);
void scheduler_print_tasks(const struct scheduler *s, const char *fileName);
void scheduler_clean(struct scheduler *s);
void scheduler_free_tasks(struct scheduler *s);
void scheduler_write_dependency(struct task *ta, struct task *tb);
#endif /* SWIFT_SCHEDULER_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment