Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gpucloudsim
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LPDS
gpucloudsim
Commits
c60cb4d2
Commit
c60cb4d2
authored
Aug 22, 2022
by
Ahmad Siavashi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GpuTaskSchedulerLeftover
parent
5ed1fc12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
GpuTaskSchedulerLeftover.java
...a/org/cloudbus/cloudsim/gpu/GpuTaskSchedulerLeftover.java
+27
-1
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuTaskSchedulerLeftover.java
View file @
c60cb4d2
...
...
@@ -30,6 +30,25 @@ public class GpuTaskSchedulerLeftover extends GpuTaskScheduler {
setUsedPes
(
new
ArrayList
<
Integer
>());
}
protected
boolean
redistributeGpuTaskMips
(
ResGpuTask
rgt
)
{
int
numberOfCurrentAvailablePEs
=
getCurrentMipsShare
().
size
()
-
getUsedPes
().
size
();
int
numberOfAllocatedPes
=
rgt
.
getPeIdList
().
size
();
if
(
numberOfAllocatedPes
<
rgt
.
getGpuTask
().
getPesLimit
()
&&
numberOfCurrentAvailablePEs
>
numberOfAllocatedPes
)
{
for
(
int
i
=
0
;
i
<
getCurrentMipsShare
().
size
();
i
++)
{
if
(!
getUsedPes
().
contains
(
i
))
{
rgt
.
setPeId
(
i
);
getUsedPes
().
add
(
i
);
numberOfAllocatedPes
++;
if
(
numberOfAllocatedPes
==
rgt
.
getGpuTask
().
getPesLimit
())
{
break
;
}
}
}
return
true
;
}
return
false
;
}
@Override
public
double
updateGpuTaskProcessing
(
double
currentTime
,
List
<
Double
>
mipsShare
)
{
setCurrentMipsShare
(
mipsShare
);
...
...
@@ -57,6 +76,13 @@ public class GpuTaskSchedulerLeftover extends GpuTaskScheduler {
}
}
getTaskExecList
().
removeAll
(
toRemove
);
// Redistribute freed resources
if
(!
toRemove
.
isEmpty
())
{
for
(
ResGpuTask
rcl
:
getTaskExecList
())
{
redistributeGpuTaskMips
(
rcl
);
}
}
// for each finished task, add a new one from the waiting list
if
(!
getTaskWaitingList
().
isEmpty
())
{
...
...
@@ -203,7 +229,7 @@ public class GpuTaskSchedulerLeftover extends GpuTaskScheduler {
rcl
.
setTaskStatus
(
GpuTask
.
SUCCESS
);
rcl
.
finalizeTask
();
List
<
Integer
>
pesToRemove
=
new
ArrayList
<>();
for
(
Integer
peId
:
getUsedPes
())
{
for
(
Integer
peId
:
rcl
.
getPeIdList
())
{
pesToRemove
.
add
(
peId
);
}
getUsedPes
().
removeAll
(
pesToRemove
);
...
...
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