Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
simso
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bc7921dd
authored
Mar 03, 2016
by
PE Hladik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug LLF and MLLF schdulers
parent
0a8e2202
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
15 deletions
+9
-15
simso/schedulers/LLF.py
+5
-8
simso/schedulers/MLLF.py
+4
-7
No files found.
simso/schedulers/LLF.py
View file @
bc7921dd
...
...
@@ -6,25 +6,22 @@ class LLF(Scheduler):
"""Least Laxity First"""
def
init
(
self
):
self
.
ready_list
=
[]
self
.
timer
=
Timer
(
self
.
sim
,
LLF
.
compute_laxity
,
self
.
timer
=
Timer
(
self
.
sim
,
LLF
.
update
,
(
self
,
self
.
processors
[
0
]),
1
,
one_shot
=
False
,
cpu
=
self
.
processors
[
0
],
overhead
=.
01
)
cpu
=
self
.
processors
[
0
],
overhead
=.
0
0
1
)
self
.
timer
.
start
()
def
compute_laxity
(
self
,
cpu
):
def
update
(
self
,
cpu
):
if
self
.
ready_list
:
for
job
in
self
.
ready_list
:
job
.
laxity
=
job
.
absolute_deadline
-
\
(
job
.
ret
+
self
.
sim
.
now_ms
())
cpu
.
resched
()
def
on_activate
(
self
,
job
):
self
.
ready_list
.
append
(
job
)
self
.
compute_laxity
(
job
.
cpu
)
job
.
cpu
.
resched
(
)
def
on_terminated
(
self
,
job
):
self
.
ready_list
.
remove
(
job
)
self
.
compute_laxity
(
job
.
cpu
)
self
.
update
(
job
.
cpu
)
def
schedule
(
self
,
cpu
):
decisions
=
[]
...
...
simso/schedulers/MLLF.py
View file @
bc7921dd
...
...
@@ -8,20 +8,17 @@ class MLLF(Scheduler):
self
.
ready_list
=
[]
self
.
timer
=
None
def
compute_laxity
(
self
,
cpu
):
def
update
(
self
,
cpu
):
if
self
.
ready_list
:
for
job
in
self
.
ready_list
:
job
.
laxity
=
(
job
.
absolute_deadline
-
job
.
ret
)
*
\
self
.
sim
.
cycles_per_ms
-
self
.
sim
.
now
()
cpu
.
resched
()
def
on_activate
(
self
,
job
):
self
.
ready_list
.
append
(
job
)
self
.
compute_laxity
(
job
.
cpu
)
job
.
cpu
.
resched
(
)
def
on_terminated
(
self
,
job
):
self
.
ready_list
.
remove
(
job
)
self
.
compute_laxity
(
job
.
cpu
)
self
.
update
(
job
.
cpu
)
def
schedule
(
self
,
cpu
):
decisions
=
[]
...
...
@@ -45,7 +42,7 @@ class MLLF(Scheduler):
if
self
.
timer
:
self
.
timer
.
stop
()
self
.
timer
=
Timer
(
self
.
sim
,
MLLF
.
compute_laxity
,
self
.
sim
,
MLLF
.
update
,
(
self
,
self
.
processors
[
0
]),
dmin
-
ta
.
laxity
,
one_shot
=
True
,
cpu
=
self
.
processors
[
0
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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