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
a873dea4
Commit
a873dea4
authored
Nov 12, 2018
by
Ahmad Siavashi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revision
parent
4388aeb5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
48 deletions
+10
-48
RemoteGpuHost.java
.../java/org/cloudbus/cloudsim/gpu/remote/RemoteGpuHost.java
+0
-41
RemoteVgpuSchedulerFairShare.java
...bus/cloudsim/gpu/remote/RemoteVgpuSchedulerFairShare.java
+10
-7
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/remote/RemoteGpuHost.java
View file @
a873dea4
...
...
@@ -3,7 +3,6 @@
*/
package
org
.
cloudbus
.
cloudsim
.
gpu
.
remote
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.cloudbus.cloudsim.Log
;
...
...
@@ -13,7 +12,6 @@ import org.cloudbus.cloudsim.VmScheduler;
import
org.cloudbus.cloudsim.gpu.GpuVm
;
import
org.cloudbus.cloudsim.gpu.Vgpu
;
import
org.cloudbus.cloudsim.gpu.allocation.VideoCardAllocationPolicy
;
import
org.cloudbus.cloudsim.gpu.performance.PerformanceScheduler
;
import
org.cloudbus.cloudsim.gpu.power.PowerGpuHost
;
import
org.cloudbus.cloudsim.power.models.PowerModel
;
import
org.cloudbus.cloudsim.provisioners.BwProvisioner
;
...
...
@@ -44,45 +42,6 @@ public class RemoteGpuHost extends PowerGpuHost {
public
RemoteGpuHost
(
int
id
,
int
type
,
RamProvisioner
ramProvisioner
,
BwProvisioner
bwProvisioner
,
long
storage
,
List
<?
extends
Pe
>
peList
,
VmScheduler
vmScheduler
,
PowerModel
powerModel
)
{
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
,
powerModel
);
// TODO Auto-generated constructor stub
}
@Override
public
double
updateVmsProcessing
(
double
currentTime
)
{
// Update VMs progress
double
smallerTime
=
Double
.
MAX_VALUE
;
for
(
Vm
vm
:
getVmList
())
{
double
time
=
vm
.
updateVmProcessing
(
currentTime
,
getVmScheduler
().
getAllocatedMipsForVm
(
vm
));
if
(
time
>
0.0
&&
time
<
smallerTime
)
{
smallerTime
=
time
;
}
}
// Update resident vgpus progress, if any
if
(
getVideoCardAllocationPolicy
()
==
null
)
{
return
smallerTime
;
}
// else
// To collect Vm 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
);
}
}
for
(
Vgpu
vgpu
:
getVideoCardAllocationPolicy
().
getVgpuVideoCardMap
().
keySet
())
{
@SuppressWarnings
(
"unchecked"
)
PerformanceScheduler
<
Vgpu
>
vgpuScheduler
=
(
PerformanceScheduler
<
Vgpu
>)
getVideoCardAllocationPolicy
()
.
getVgpuVideoCardMap
().
get
(
vgpu
).
getVgpuScheduler
();
double
time
=
vgpu
.
updateTaskProcessing
(
currentTime
,
vgpuScheduler
.
getAvailableMips
(
vgpu
,
runningVgpus
));
if
(
time
>
0.0
&&
time
<
smallerTime
)
{
smallerTime
=
time
;
}
}
return
smallerTime
;
}
@Override
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/remote/RemoteVgpuSchedulerFairShare.java
View file @
a873dea4
...
...
@@ -42,11 +42,13 @@ public class RemoteVgpuSchedulerFairShare extends PerformanceVgpuSchedulerFairSh
@Override
public
boolean
isSuitable
(
final
Vgpu
vgpu
)
{
final
int
gddramShare
=
vgpu
.
getCurrentRequestedGddram
();
final
long
bwShare
=
vgpu
.
getCurrentRequestedBw
();
List
<
Pgpu
>
candidates
=
(
List
<
Pgpu
>)
CollectionUtils
.
select
(
getPgpuList
(),
new
Predicate
()
{
@Override
public
boolean
evaluate
(
Object
arg
)
{
Pgpu
pgpu
=
(
Pgpu
)
arg
;
if
(!
pgpu
.
getGddramProvisioner
().
isSuitableForVgpu
(
vgpu
,
gddramShare
))
{
if
(!
pgpu
.
getGddramProvisioner
().
isSuitableForVgpu
(
vgpu
,
gddramShare
)
||
!
pgpu
.
getBwProvisioner
().
isSuitableForVgpu
(
vgpu
,
bwShare
))
{
return
false
;
}
...
...
@@ -71,7 +73,8 @@ public class RemoteVgpuSchedulerFairShare extends PerformanceVgpuSchedulerFairSh
@Override
public
boolean
evaluate
(
Object
arg
)
{
Pgpu
pgpu
=
(
Pgpu
)
arg
;
if
(!
pgpu
.
getGddramProvisioner
().
isSuitableForVgpu
(
vgpu
,
gddramShare
))
{
if
(!
pgpu
.
getGddramProvisioner
().
isSuitableForVgpu
(
vgpu
,
gddramShare
)
||
!
pgpu
.
getBwProvisioner
().
isSuitableForVgpu
(
vgpu
,
bwShare
))
{
return
false
;
}
...
...
@@ -89,19 +92,19 @@ public class RemoteVgpuSchedulerFairShare extends PerformanceVgpuSchedulerFairSh
// set processing power according to the allocated pgpu
vgpu
.
setNumberOfPes
(
selectedPgpu
.
getPeList
().
size
());
vgpu
.
setPeMips
(
selectedPgpu
.
getPeList
().
get
(
0
).
getMips
());
final
List
<
Double
>
V
gpuMipsShare
=
vgpu
.
getCurrentRequestedMips
();
final
long
vgpuBwShare
=
selectedPgpu
.
getBwProvisioner
().
getBw
();
final
List
<
Double
>
v
gpuMipsShare
=
vgpu
.
getCurrentRequestedMips
();
final
long
vgpuBwShare
=
selectedPgpu
.
getBwProvisioner
().
getBw
();
selectedPgpu
.
getGddramProvisioner
().
allocateGddramForVgpu
(
vgpu
,
gddramShare
);
// memory BW is assumed/supposed to be ignored
selectedPgpu
.
getBwProvisioner
().
allocateBwForVgpu
(
vgpu
,
vgpuBwShare
);
getPgpuVgpuMap
().
get
(
selectedPgpu
).
add
(
vgpu
);
getRequestedMipsMap
().
put
(
vgpu
,
V
gpuMipsShare
);
getRequestedMipsMap
().
put
(
vgpu
,
v
gpuMipsShare
);
getVgpuPeMap
().
put
(
vgpu
,
new
ArrayList
<
Pe
>());
double
mipsChange
=
MathUtil
.
sum
(
V
gpuMipsShare
);
double
mipsChange
=
MathUtil
.
sum
(
v
gpuMipsShare
);
redistributeMipsDueToOverSubscription
(
selectedPgpu
,
mipsChange
);
return
true
;
}
...
...
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