Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
klee_tutorial
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ruben Asplund
klee_tutorial
Commits
e9ae2680
Commit
e9ae2680
authored
4 years ago
by
Ruben Asplund
Browse files
Options
Downloads
Patches
Plain Diff
Small changes to blocking()
parent
c0eee49c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
srp_analysis/src/main.rs
+7
-9
7 additions, 9 deletions
srp_analysis/src/main.rs
with
7 additions
and
9 deletions
srp_analysis/src/main.rs
+
7
−
9
View file @
e9ae2680
...
@@ -174,9 +174,7 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
...
@@ -174,9 +174,7 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
lower_prio_tasks
.remove
(
&
t
.id
);
lower_prio_tasks
.remove
(
&
t
.id
);
}
}
}
}
// println!("{:?}", lower_prio_tasks);
if
lower_prio_tasks
.len
()
==
0
{
if
lower_prio_tasks
.len
()
==
0
{
// println!("0");
return
0
;
return
0
;
}
}
/* Finding longest blocking */
/* Finding longest blocking */
...
@@ -186,13 +184,11 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
...
@@ -186,13 +184,11 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
let
mut
current_block
=
0
;
let
mut
current_block
=
0
;
// Iterate through current task resources
// Iterate through current task resources
for
r1
in
resources
{
for
r1
in
resources
{
// println!("Resource 1: {}, Resources 1 {:?}", r1, resources);
// Iterate through lower prio tasks
// Iterate through lower prio tasks
for
t_id
in
&
lower_prio_tasks
{
for
t_id
in
&
lower_prio_tasks
{
let
mut
lower_prio_task_resources
=
&
tr
[
t_id
];
let
mut
lower_prio_task_resources
=
&
tr
[
t_id
];
// Iterate through lower prio task resources
// Iterate through lower prio task resources
for
r2
in
lower_prio_task_resources
{
for
r2
in
lower_prio_task_resources
{
// println!("Resource 2: {}, Resources 2 {:?}", r2, lower_prio_task_resources);
// When current task use the same resource as a task
// When current task use the same resource as a task
if
r1
==
r2
{
if
r1
==
r2
{
// Takes forward the blocking task
// Takes forward the blocking task
...
@@ -205,8 +201,6 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
...
@@ -205,8 +201,6 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
if
max_block
<
current_block
{
if
max_block
<
current_block
{
max_block
=
current_block
;
max_block
=
current_block
;
}
}
// println!("1: start:{}, end:{}", inner.start, inner.end);
// println!("For id {} and resource 2 {}", t_id, r2)
}
}
// Iterate through second layer
// Iterate through second layer
for
inner2
in
&
inner
.inner
{
for
inner2
in
&
inner
.inner
{
...
@@ -215,8 +209,13 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
...
@@ -215,8 +209,13 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
if
max_block
<
current_block
{
if
max_block
<
current_block
{
max_block
=
current_block
;
max_block
=
current_block
;
}
}
// println!("2: start:{}, end:{}", inner2.start, inner2.end);
}
// println!("For id {} and resource 2 {}", t_id, r2)
// Iterate through third layer
for
inner3
in
&
inner2
.inner
{
current_block
=
inner2
.end
.wrapping_sub
(
inner2
.start
);
if
max_block
<
current_block
{
max_block
=
current_block
;
}
}
}
}
}
}
}
...
@@ -226,6 +225,5 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
...
@@ -226,6 +225,5 @@ fn blocking(task: &Task, tasks: &Tasks, ip: &IdPrio, tr: &TaskResources) -> u32
}
}
}
}
}
}
// println!("{}", max_block);
return
max_block
;
return
max_block
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Edvin Åkerfeldt
@ironedde
mentioned in issue
#4 (closed)
·
4 years ago
mentioned in issue
#4 (closed)
mentioned in issue #4
Toggle commit list
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