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
8eb61c4d
Commit
8eb61c4d
authored
9 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in scheduler_done by removing dead code that was causing it.
parent
b88b284a
No related branches found
No related tags found
1 merge request
!50
Parallel sorting
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scheduler.c
+14
-25
14 additions, 25 deletions
src/scheduler.c
with
14 additions
and
25 deletions
src/scheduler.c
+
14
−
25
View file @
8eb61c4d
...
@@ -128,7 +128,7 @@ void scheduler_splittasks(struct scheduler *s) {
...
@@ -128,7 +128,7 @@ void scheduler_splittasks(struct scheduler *s) {
else
else
break
;
break
;
}
}
/* Skip sorting tasks. */
/* Skip sorting tasks. */
if
(
t
->
type
==
task_type_psort
)
continue
;
if
(
t
->
type
==
task_type_psort
)
continue
;
...
@@ -1029,45 +1029,34 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
...
@@ -1029,45 +1029,34 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
struct
task
*
scheduler_done
(
struct
scheduler
*
s
,
struct
task
*
t
)
{
struct
task
*
scheduler_done
(
struct
scheduler
*
s
,
struct
task
*
t
)
{
int
k
,
res
;
struct
task
*
t2
,
*
next
=
NULL
;
struct
cell
*
super
=
t
->
ci
->
super
;
/* Release whatever locks this task held. */
/* Release whatever locks this task held. */
if
(
!
t
->
implicit
)
task_unlock
(
t
);
if
(
!
t
->
implicit
)
task_unlock
(
t
);
/* Loop through the dependencies and add them to a queue if
/* Loop through the dependencies and add them to a queue if
they are ready. */
they are ready. */
for
(
k
=
0
;
k
<
t
->
nr_unlock_tasks
;
k
++
)
{
for
(
int
k
=
0
;
k
<
t
->
nr_unlock_tasks
;
k
++
)
{
t2
=
t
->
unlock_tasks
[
k
];
struct
task
*
t2
=
t
->
unlock_tasks
[
k
];
if
((
res
=
atomic_dec
(
&
t2
->
wait
))
<
1
)
error
(
"Negative wait!"
);
int
res
=
atomic_dec
(
&
t2
->
wait
);
if
(
res
==
1
&&
!
t2
->
skip
)
{
if
(
res
<
1
)
{
if
(
0
&&
!
t2
->
implicit
&&
t2
->
ci
->
super
==
super
&&
error
(
"Negative wait!"
);
(
next
==
NULL
||
t2
->
weight
>
next
->
weight
)
&&
task_lock
(
t2
))
{
}
else
if
(
res
==
1
&&
!
t2
->
skip
)
{
if
(
next
!=
NULL
)
{
scheduler_enqueue
(
s
,
t2
);
task_unlock
(
next
);
scheduler_enqueue
(
s
,
next
);
}
next
=
t2
;
}
else
scheduler_enqueue
(
s
,
t2
);
}
}
}
}
/* Task definitely done. */
/* Task definitely done
, signal any sleeping runners
. */
if
(
!
t
->
implicit
)
{
if
(
!
t
->
implicit
)
{
t
->
toc
=
getticks
();
t
->
toc
=
getticks
();
pthread_mutex_lock
(
&
s
->
sleep_mutex
);
pthread_mutex_lock
(
&
s
->
sleep_mutex
);
if
(
next
==
NULL
)
atomic_dec
(
&
s
->
waiting
);
atomic_dec
(
&
s
->
waiting
);
pthread_cond_broadcast
(
&
s
->
sleep_cond
);
pthread_cond_broadcast
(
&
s
->
sleep_cond
);
pthread_mutex_unlock
(
&
s
->
sleep_mutex
);
pthread_mutex_unlock
(
&
s
->
sleep_mutex
);
}
}
/* Start the clock on the follow-up task. */
/* Return the next best task. Note that we currently do not
if
(
next
!=
NULL
)
next
->
tic
=
getticks
();
implement anything that does this, as getting it to respect
priorities is too tricky and currently unnecessary. */
/* Return the next best task. */
return
NULL
;
return
next
;
}
}
/**
/**
...
...
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