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
4388aeb5
Commit
4388aeb5
authored
Nov 12, 2018
by
Ahmad Siavashi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into gpu_remoting
parents
59a0ddda
a58c4742
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
39 deletions
+38
-39
GpuHost.java
...dsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuHost.java
+12
-12
PerformanceGpuHost.java
...cloudbus/cloudsim/gpu/performance/PerformanceGpuHost.java
+26
-27
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuHost.java
View file @
4388aeb5
...
...
@@ -176,23 +176,23 @@ public class GpuHost extends Host {
@Override
public
double
updateVmsProcessing
(
double
currentTime
)
{
double
smallerTime
=
Double
.
MAX_VALUE
;
// Update resident VMs
for
(
Vm
vm
:
getVmList
())
{
GpuVm
gpuVm
=
(
GpuVm
)
vm
;
double
time
=
gpuVm
.
updateVmProcessing
(
currentTime
,
getVmScheduler
().
getAllocatedMipsForVm
(
gpuVm
));
Vgpu
vgpu
=
gpuVm
.
getVgpu
();
double
deviceTime
=
vgpu
.
updateTaskProcessing
(
currentTime
,
getVideoCardAllocationPolicy
()
.
getVgpuVideoCardMap
().
get
(
vgpu
).
getVgpuScheduler
().
getAllocatedMipsForVgpu
(
vgpu
));
if
(
vgpu
.
getGpuTaskScheduler
().
runningTasks
()
>
0
)
{
if
(
time
==
0
)
{
time
=
deviceTime
;
}
else
{
time
=
((
deviceTime
<
time
)
?
deviceTime
:
time
);
}
}
double
time
=
vm
.
updateVmProcessing
(
currentTime
,
getVmScheduler
().
getAllocatedMipsForVm
(
vm
));
if
(
time
>
0.0
&&
time
<
smallerTime
)
{
smallerTime
=
time
;
}
}
if
(
getVideoCardAllocationPolicy
()
!=
null
)
{
// Update resident vGPUs
for
(
Vgpu
vgpu
:
getVideoCardAllocationPolicy
().
getVgpuVideoCardMap
().
keySet
())
{
double
time
=
vgpu
.
updateTaskProcessing
(
currentTime
,
getVideoCardAllocationPolicy
()
.
getVgpuVideoCardMap
().
get
(
vgpu
).
getVgpuScheduler
().
getAllocatedMipsForVgpu
(
vgpu
));
if
(
time
>
0.0
&&
time
<
smallerTime
)
{
smallerTime
=
time
;
}
}
}
return
smallerTime
;
}
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/performance/PerformanceGpuHost.java
View file @
4388aeb5
...
...
@@ -18,7 +18,8 @@ import org.cloudbus.cloudsim.provisioners.RamProvisioner;
/**
* {@link PerformanceGpuHost} extends {@link GpuHost} to add support for
* schedulers that implement {@link PerformanceScheduler PerformanceScheduler} interface.
* schedulers that implement {@link PerformanceScheduler PerformanceScheduler}
* interface.
*
* @author Ahmad Siavashi
*
...
...
@@ -33,7 +34,7 @@ public class PerformanceGpuHost extends GpuHost {
VideoCardAllocationPolicy
videoCardAllocationPolicy
)
{
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
,
videoCardAllocationPolicy
);
}
/**
* @see org.cloudbus.cloudsim.gpu.GpuHost#GpuHost GpuHost
*/
...
...
@@ -44,39 +45,37 @@ public class PerformanceGpuHost extends GpuHost {
@Override
public
double
updateVmsProcessing
(
double
currentTime
)
{
// To collect Vm that are probably sharing a resource
List
<
Vgpu
>
runningVgpus
=
new
ArrayList
<
Vgpu
>();
// Collect running gpu vms
// Update resident VMs
double
smallerTime
=
Double
.
MAX_VALUE
;
for
(
Vm
vm
:
getVmList
())
{
GpuVm
gpuVm
=
(
GpuVm
)
vm
;
Vgpu
vgpu
=
gpuVm
.
getVgpu
();
if
(
vgpu
!=
null
&&
vgpu
.
getGpuTaskScheduler
().
runningTasks
()
>
0
)
{
runningVgpus
.
add
(
vgpu
);
double
time
=
vm
.
updateVmProcessing
(
currentTime
,
getVmScheduler
().
getAllocatedMipsForVm
(
vm
));
if
(
time
>
0.0
&&
time
<
smallerTime
)
{
smallerTime
=
time
;
}
}
double
smallerTime
=
Double
.
MAX_VALUE
;
for
(
Vm
vm
:
getVmList
())
{
GpuVm
gpuVm
=
(
GpuVm
)
vm
;
double
time
=
gpuVm
.
updateVmProcessing
(
currentTime
,
getVmScheduler
().
getAllocatedMipsForVm
(
gpuVm
));
if
(
gpuVm
.
getVgpu
()
!=
null
)
{
if
(
getVideoCardAllocationPolicy
()
!=
null
)
{
// To collect VMs that are probably sharing a resource
List
<
Vgpu
>
runningVgpus
=
new
ArrayList
<
Vgpu
>();
// Collect running gpu vms
for
(
Vgpu
vgpu
:
getVideoCardAllocationPolicy
().
getVgpuVideoCardMap
().
keySet
())
{
if
(
vgpu
.
getGpuTaskScheduler
().
runningTasks
()
>
0
)
{
runningVgpus
.
add
(
vgpu
);
}
}
// Update resident vGPUs
for
(
Vgpu
vgpu
:
getVideoCardAllocationPolicy
().
getVgpuVideoCardMap
().
keySet
())
{
@SuppressWarnings
(
"unchecked"
)
PerformanceScheduler
<
Vgpu
>
vgpuScheduler
=
(
PerformanceScheduler
<
Vgpu
>)
getVideoCardAllocationPolicy
()
.
getVgpuVideoCardMap
().
get
(
gpuVm
.
getVgpu
()).
getVgpuScheduler
();
double
deviceTime
=
gpuVm
.
getVgpu
().
updateTaskProcessing
(
currentTime
,
vgpuScheduler
.
getAvailableMips
(
gpuVm
.
getVgpu
(),
runningVgpus
));
if
(
gpuVm
.
getVgpu
().
getGpuTaskScheduler
().
runningTasks
()
>
0
)
{
if
(
time
==
0
)
{
time
=
deviceTime
;
}
else
{
time
=
((
deviceTime
<
time
)
?
deviceTime
:
time
);
}
.
getVgpuVideoCardMap
().
get
(
vgpu
).
getVgpuScheduler
();
double
time
=
vgpu
.
updateTaskProcessing
(
currentTime
,
vgpuScheduler
.
getAvailableMips
(
vgpu
,
runningVgpus
));
if
(
time
>
0.0
&&
time
<
smallerTime
)
{
smallerTime
=
time
;
}
}
if
(
time
>
0.0
&&
time
<
smallerTime
)
{
smallerTime
=
time
;
}
}
return
smallerTime
;
}
...
...
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