Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
aac3e3c5
Commit
aac3e3c5
authored
Nov 09, 2017
by
lhausamm
Browse files
Add subtask for dependency tree
parent
89df1a1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/scheduler.c
View file @
aac3e3c5
...
...
@@ -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\t
compound=true;
\n\t
ratio=0.66;
\n\t
node[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.
*
...
...
src/scheduler.h
View file @
aac3e3c5
...
...
@@ -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 */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment