Skip to content
Snippets Groups Projects
Commit 53df6326 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Applied code formatting tool.

parent 1f0fda81
Branches
Tags
No related merge requests found
...@@ -119,8 +119,8 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta, ...@@ -119,8 +119,8 @@ void scheduler_addunlock(struct scheduler *s, struct task *ta,
* @param ta The #task * @param ta The #task
* @param ta_name The formatted string * @param ta_name The formatted string
*/ */
void scheduler_task_dependency_name( void scheduler_task_dependency_name(int ta_type, int ta_subtype,
int ta_type, int ta_subtype, char *ta_name) { char *ta_name) {
/* Check input */ /* Check input */
if (ta_type < 0 || ta_type >= task_type_count) if (ta_type < 0 || ta_type >= task_type_count)
...@@ -128,14 +128,14 @@ void scheduler_task_dependency_name( ...@@ -128,14 +128,14 @@ void scheduler_task_dependency_name(
if (ta_subtype < 0 || ta_subtype >= task_subtype_count) if (ta_subtype < 0 || ta_subtype >= task_subtype_count)
error("Unknown task subtype %i with type %s", ta_subtype, error("Unknown task subtype %i with type %s", ta_subtype,
taskID_names[ta_type]); taskID_names[ta_type]);
/* construct line */ /* construct line */
if (ta_subtype == task_subtype_none) if (ta_subtype == task_subtype_none)
sprintf(ta_name, "%s", taskID_names[ta_type]); sprintf(ta_name, "%s", taskID_names[ta_type]);
else else
sprintf(ta_name, "\"%s %s\"", taskID_names[ta_type], sprintf(ta_name, "\"%s %s\"", taskID_names[ta_type],
subtaskID_names[ta_subtype]); subtaskID_names[ta_subtype]);
} }
/** /**
...@@ -227,7 +227,7 @@ void scheduler_write_dependencies(struct scheduler *s, int verbose) { ...@@ -227,7 +227,7 @@ void scheduler_write_dependencies(struct scheduler *s, int verbose) {
error("Not enough memory, please increase max_nber_dep"); error("Not enough memory, please increase max_nber_dep");
/* Increase counter of relation */ /* Increase counter of relation */
count_rel[ind/2 + k] += 1; count_rel[ind / 2 + k] += 1;
/* Not written yet => write it */ /* Not written yet => write it */
if (!written) { if (!written) {
...@@ -237,8 +237,8 @@ void scheduler_write_dependencies(struct scheduler *s, int verbose) { ...@@ -237,8 +237,8 @@ void scheduler_write_dependencies(struct scheduler *s, int verbose) {
char tb_name[200]; char tb_name[200];
/* construct line */ /* construct line */
scheduler_task_dependency_name(ta->type, ta->subtype, ta_name); scheduler_task_dependency_name(ta->type, ta->subtype, ta_name);
scheduler_task_dependency_name(tb->type, tb->subtype, tb_name); scheduler_task_dependency_name(tb->type, tb->subtype, tb_name);
/* Change colour of implicit tasks */ /* Change colour of implicit tasks */
if (ta->implicit) if (ta->implicit)
...@@ -339,29 +339,29 @@ void scheduler_write_dependencies(struct scheduler *s, int verbose) { ...@@ -339,29 +339,29 @@ void scheduler_write_dependencies(struct scheduler *s, int verbose) {
for (int ta_subtype = 0; ta_subtype < task_subtype_count; ta_subtype++) { for (int ta_subtype = 0; ta_subtype < task_subtype_count; ta_subtype++) {
/* Get task indice */ /* Get task indice */
const int ind = (ta_type * task_subtype_count + ta_subtype) * max_nber_dep; const int ind =
(ta_type * task_subtype_count + ta_subtype) * max_nber_dep;
/* Loop over dependencies */ /* Loop over dependencies */
for (int k = 0; k < max_nber_dep; k++) { for (int k = 0; k < max_nber_dep; k++) {
if (count_rel[ind + k] == 0)
continue;
/* Get task type */
const int i = 2 * (ind + k);
int tb_type = table[i];
int tb_subtype = table[i+1];
/* Get names */
char ta_name[200];
char tb_name[200];
scheduler_task_dependency_name(ta_type, ta_subtype, ta_name);
scheduler_task_dependency_name(tb_type, tb_subtype, tb_name);
/* Write to the fle */
fprintf(f, "\t %s->%s[label=%i];\n", ta_name, tb_name, count_rel[ind + k]);
if (count_rel[ind + k] == 0) continue;
/* Get task type */
const int i = 2 * (ind + k);
int tb_type = table[i];
int tb_subtype = table[i + 1];
/* Get names */
char ta_name[200];
char tb_name[200];
scheduler_task_dependency_name(ta_type, ta_subtype, ta_name);
scheduler_task_dependency_name(tb_type, tb_subtype, tb_name);
/* Write to the fle */
fprintf(f, "\t %s->%s[label=%i];\n", ta_name, tb_name,
count_rel[ind + k]);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment