Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
3ce7876b
Commit
3ce7876b
authored
9 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
holy crap, this actually seems to work... cleaning up the formatting and puting it out there.
parent
a4ecb68d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!60
Parallel scheduler
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/runner.c
+2
-1
2 additions, 1 deletion
src/runner.c
src/scheduler.c
+7
-5
7 additions, 5 deletions
src/scheduler.c
with
9 additions
and
6 deletions
src/runner.c
+
2
−
1
View file @
3ce7876b
...
...
@@ -1291,7 +1291,8 @@ void *runner_main(void *data) {
runner_dograv_down
(
r
,
t
->
ci
);
break
;
case
task_type_rewait
:
for
(
struct
task
*
t2
=
(
struct
task
*
)
t
->
ci
;
t2
!=
(
struct
task
*
)
t
->
cj
;
t2
++
)
{
for
(
struct
task
*
t2
=
(
struct
task
*
)
t
->
ci
;
t2
!=
(
struct
task
*
)
t
->
cj
;
t2
++
)
{
for
(
k
=
0
;
k
<
t2
->
nr_unlock_tasks
;
k
++
)
atomic_inc
(
&
t2
->
unlock_tasks
[
k
]
->
wait
);
}
...
...
This diff is collapsed.
Click to expand it.
src/scheduler.c
+
7
−
5
View file @
3ce7876b
...
...
@@ -888,21 +888,23 @@ void scheduler_start(struct scheduler *s, unsigned int mask) {
/* Store the mask */
s
->
mask
=
mask
;
/* Clear all the waits and rids. */
// tic = getticks();
for
(
int
k
=
0
;
k
<
s
->
nr_tasks
;
k
++
)
{
s
->
tasks
[
k
].
wait
=
0
;
s
->
tasks
[
k
].
rid
=
-
1
;
}
/* Enqueue a set of extraenous tasks to set the task waits. */
struct
task
rewait_tasks
[
s
->
nr_queues
];
const
int
waiting_old
=
s
->
waiting
;
// Remember that engine_launch may fiddle with this value.
const
int
waiting_old
=
s
->
waiting
;
// Remember that engine_launch may fiddle with this value.
for
(
int
k
=
0
;
k
<
s
->
nr_queues
;
k
++
)
{
rewait_tasks
[
k
].
type
=
task_type_rewait
;
rewait_tasks
[
k
].
ci
=
(
struct
cell
*
)
&
s
->
tasks
[
k
*
nr_tasks
/
s
->
nr_queues
];
rewait_tasks
[
k
].
cj
=
(
struct
cell
*
)
&
s
->
tasks
[(
k
+
1
)
*
nr_tasks
/
s
->
nr_queues
];
rewait_tasks
[
k
].
cj
=
(
struct
cell
*
)
&
s
->
tasks
[(
k
+
1
)
*
nr_tasks
/
s
->
nr_queues
];
rewait_tasks
[
k
].
skip
=
0
;
rewait_tasks
[
k
].
wait
=
0
;
rewait_tasks
[
k
].
weight
=
1
;
...
...
@@ -911,7 +913,7 @@ void scheduler_start(struct scheduler *s, unsigned int mask) {
scheduler_enqueue
(
s
,
&
rewait_tasks
[
k
]);
pthread_cond_broadcast
(
&
s
->
sleep_cond
);
}
/* Wait for the rewait tasks to have executed. */
pthread_mutex_lock
(
&
s
->
sleep_mutex
);
while
(
s
->
waiting
>
waiting_old
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment