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
b0f5a68b
Commit
b0f5a68b
authored
Nov 26, 2018
by
Ahmad Siavashi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remote GPU partial commit.
parent
e1e89aec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
804 additions
and
4 deletions
+804
-4
Lpds.java
...in/java/org/cloudbus/cloudsim/examples/gpu/lpds/Lpds.java
+425
-0
LpdsWorkload.java
...org/cloudbus/cloudsim/examples/gpu/lpds/LpdsWorkload.java
+99
-0
lpds_workload_manifest.json
...us/cloudsim/examples/gpu/lpds/lpds_workload_manifest.json
+72
-0
GpuHost.java
...dsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuHost.java
+1
-0
UtilizationModelGaussian.java
...a/org/cloudbus/cloudsim/gpu/UtilizationModelGaussian.java
+62
-0
PerformanceGpuHost.java
...cloudbus/cloudsim/gpu/performance/PerformanceGpuHost.java
+0
-4
PowerGpuHost.java
...in/java/org/cloudbus/cloudsim/gpu/power/PowerGpuHost.java
+26
-0
GpuHostPowerModelNull.java
...dbus/cloudsim/gpu/power/models/GpuHostPowerModelNull.java
+24
-0
VideoCardPowerModelNull.java
...us/cloudsim/gpu/power/models/VideoCardPowerModelNull.java
+29
-0
RemoteGpuHost.java
.../java/org/cloudbus/cloudsim/gpu/remote/RemoteGpuHost.java
+10
-0
RemoteGpuVmSchedulerSpaceShared.java
.../cloudsim/gpu/remote/RemoteGpuVmSchedulerSpaceShared.java
+56
-0
No files found.
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/gpu/lpds/Lpds.java
0 → 100644
View file @
b0f5a68b
This diff is collapsed.
Click to expand it.
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/gpu/lpds/LpdsWorkload.java
0 → 100644
View file @
b0f5a68b
package
org
.
cloudbus
.
cloudsim
.
examples
.
gpu
.
lpds
;
import
java.util.List
;
import
java.util.Map
;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
public
class
LpdsWorkload
{
@JsonSerialize
@JsonDeserialize
public
List
<
LpdsDatacenter
>
datacenters
;
@JsonSerialize
@JsonDeserialize
public
Map
<
Integer
,
Integer
>
gpu_cloudlet_vm_map
;
@JsonSerialize
@JsonDeserialize
public
List
<
LpdsGpuCloudlet
>
gpu_cloudlets
;
@JsonSerialize
@JsonDeserialize
public
List
<
LpdsVm
>
vms
;
@JsonSerialize
@JsonDeserialize
public
LpdsBroker
broker
;
}
class
LpdsVgpu
{
public
int
type
;
public
int
memory
;
}
class
LpdsVm
{
public
int
id
;
public
int
num_vcpus
;
public
String
type
;
public
double
ram
;
@JsonSerialize
@JsonDeserialize
public
LpdsVgpu
vgpu
;
}
class
LpdsGpuTask
{
public
int
block_length
;
public
int
num_blocks
;;
public
int
gddram
;
public
String
gddram_utilization_model
;
public
String
gpu_utilization_model
;
}
class
LpdsGpuCloudlet
{
public
int
id
;
public
int
length
;
public
int
num_pes
;
public
String
tag
;
public
String
cpu_utilization_model
;
@JsonSerialize
@JsonDeserialize
public
LpdsGpuTask
gpu_task
;
}
class
LpdsBroker
{
public
String
name
;
}
class
LpdsDatacenter
{
public
String
name
;
public
double
scheduling_interval
;
@JsonSerialize
@JsonDeserialize
public
List
<
LpdsHost
>
hosts
;
public
String
vm_allocation_policy
;
}
class
LpdsHost
{
public
String
type
;
public
int
num_pes
;
public
int
pe_mips
;
public
int
ram
;
public
String
video_card_allocation_policy
;
@JsonSerialize
@JsonDeserialize
public
List
<
LpdsVideoCard
>
video_cards
;
}
class
LpdsVideoCard
{
@JsonSerialize
@JsonDeserialize
public
LpdsGpu
gpu
;
public
int
num_gpus
;
public
String
type
;
public
String
gpu_selection_policy
;
}
class
LpdsGpu
{
public
int
num_pes
;
public
int
gddram
;
public
int
pe_mips
;
}
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/gpu/lpds/lpds_workload_manifest.json
0 → 100644
View file @
b0f5a68b
{
"broker"
:
{
"name"
:
"portal"
},
"datacenters"
:
[
{
"hosts"
:
[
{
"num_pes"
:
40
,
"pe_mips"
:
46400
,
"ram"
:
60
,
"type"
:
"DUAL_INTEL_XEON_E5_2666_V3"
,
"video_card_allocation_policy"
:
"simple"
,
"video_cards"
:
[]
},
{
"num_pes"
:
40
,
"pe_mips"
:
46400
,
"ram"
:
60
,
"type"
:
"DUAL_INTEL_XEON_E5_2666_V3_DUAL_NVIDIA_M60"
,
"video_card_allocation_policy"
:
"simple"
,
"video_cards"
:
[
{
"gpu"
:
{
"gddram"
:
8192
,
"num_pes"
:
16
,
"pe_mips"
:
142592
},
"gpu_selection_policy"
:
"simple"
,
"num_gpus"
:
2
,
"type"
:
"Tesla M60"
}
]
}
],
"name"
:
"DC"
,
"scheduling_interval"
:
1.0
,
"vm_allocation_policy"
:
"simple"
}
],
"gpu_cloudlet_vm_map"
:
{
"0"
:
0
},
"gpu_cloudlets"
:
[
{
"cpu_utilization_model"
:
"high"
,
"gpu_task"
:
{
"block_length"
:
132813
,
"gddram"
:
512
,
"gddram_utilization_model"
:
"medium"
,
"gpu_utilization_model"
:
"low"
,
"num_blocks"
:
128
},
"id"
:
0
,
"length"
:
652977327
,
"num_pes"
:
1
,
"tag"
:
"BFS"
}
],
"vms"
:
[
{
"id"
:
0
,
"num_vcpus"
:
2
,
"ram"
:
3.75
,
"type"
:
1
,
"vgpu"
:
{
"memory"
:
1024
,
"type"
:
null
}
}
]
}
\ No newline at end of file
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/GpuHost.java
View file @
b0f5a68b
...
...
@@ -61,6 +61,7 @@ public class GpuHost extends Host {
List
<?
extends
Pe
>
peList
,
VmScheduler
vmScheduler
)
{
super
(
id
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
);
setType
(
type
);
setVideoCardAllocationPolicy
(
null
);
}
@Override
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/UtilizationModelGaussian.java
0 → 100644
View file @
b0f5a68b
package
org
.
cloudbus
.
cloudsim
.
gpu
;
import
java.util.Random
;
import
org.cloudbus.cloudsim.UtilizationModel
;
public
class
UtilizationModelGaussian
implements
UtilizationModel
{
private
Random
random
;
private
double
mean
;
private
double
std
;
public
UtilizationModelGaussian
(
double
mean
,
double
std
)
{
setMean
(
mean
);
setStd
(
std
);
setRandom
(
new
Random
());
}
public
UtilizationModelGaussian
(
double
mean
,
double
std
,
long
seed
)
{
setMean
(
mean
);
setStd
(
std
);
setRandom
(
new
Random
(
seed
));
}
public
UtilizationModelGaussian
(
long
seed
)
{
this
(
0
,
1
,
seed
);
}
public
UtilizationModelGaussian
()
{
this
(
0
,
1
);
}
@Override
public
double
getUtilization
(
double
time
)
{
return
getRandom
().
nextGaussian
()
*
getStd
()
+
getMean
();
}
public
Random
getRandom
()
{
return
random
;
}
protected
void
setRandom
(
Random
random
)
{
this
.
random
=
random
;
}
public
double
getMean
()
{
return
mean
;
}
protected
void
setMean
(
double
mean
)
{
this
.
mean
=
mean
;
}
public
double
getStd
()
{
return
std
;
}
protected
void
setStd
(
double
std
)
{
this
.
std
=
std
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/performance/PerformanceGpuHost.java
View file @
b0f5a68b
/**
*
*/
package
org
.
cloudbus
.
cloudsim
.
gpu
.
performance
;
import
java.util.ArrayList
;
...
...
@@ -10,7 +7,6 @@ import org.cloudbus.cloudsim.Pe;
import
org.cloudbus.cloudsim.Vm
;
import
org.cloudbus.cloudsim.VmScheduler
;
import
org.cloudbus.cloudsim.gpu.GpuHost
;
import
org.cloudbus.cloudsim.gpu.GpuVm
;
import
org.cloudbus.cloudsim.gpu.Vgpu
;
import
org.cloudbus.cloudsim.gpu.allocation.VideoCardAllocationPolicy
;
import
org.cloudbus.cloudsim.provisioners.BwProvisioner
;
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/power/PowerGpuHost.java
View file @
b0f5a68b
...
...
@@ -10,6 +10,7 @@ import org.cloudbus.cloudsim.gpu.GpuVm;
import
org.cloudbus.cloudsim.gpu.VideoCard
;
import
org.cloudbus.cloudsim.gpu.allocation.VideoCardAllocationPolicy
;
import
org.cloudbus.cloudsim.gpu.performance.PerformanceGpuHost
;
import
org.cloudbus.cloudsim.gpu.power.models.GpuHostPowerModelNull
;
import
org.cloudbus.cloudsim.power.models.PowerModel
;
import
org.cloudbus.cloudsim.provisioners.BwProvisioner
;
import
org.cloudbus.cloudsim.provisioners.RamProvisioner
;
...
...
@@ -42,6 +43,19 @@ public class PowerGpuHost extends PerformanceGpuHost {
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
,
videoCardAllocationPolicy
);
setPowerModel
(
powerModel
);
}
/**
*
* @see PerformanceGpuHost#PerformanceGpuHost(int, int, RamProvisioner,
* BwProvisioner, long, List, VmScheduler, VideoCardAllocationPolicy)
* erformanceGpuHost(int, int, RamProvisioner, BwProvisioner, long, List,
* VmScheduler, VideoCardAllocationPolicy)
*/
public
PowerGpuHost
(
int
id
,
int
type
,
RamProvisioner
ramProvisioner
,
BwProvisioner
bwProvisioner
,
long
storage
,
List
<?
extends
Pe
>
peList
,
VmScheduler
vmScheduler
,
VideoCardAllocationPolicy
videoCardAllocationPolicy
)
{
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
,
videoCardAllocationPolicy
);
setPowerModel
(
new
GpuHostPowerModelNull
());
}
/**
*
...
...
@@ -54,6 +68,18 @@ public class PowerGpuHost extends PerformanceGpuHost {
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
);
setPowerModel
(
powerModel
);
}
/**
*
* @see PerformanceGpuHost#PerformanceGpuHost(int, int, RamProvisioner,
* BwProvisioner, long, List, VmScheduler) erformanceGpuHost(int, int,
* RamProvisioner, BwProvisioner, long, List, VmScheduler)
*/
public
PowerGpuHost
(
int
id
,
int
type
,
RamProvisioner
ramProvisioner
,
BwProvisioner
bwProvisioner
,
long
storage
,
List
<?
extends
Pe
>
peList
,
VmScheduler
vmScheduler
)
{
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
);
setPowerModel
(
new
GpuHostPowerModelNull
());
}
/**
* Returns the current total utilization of host's CPUs.
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/power/models/GpuHostPowerModelNull.java
0 → 100644
View file @
b0f5a68b
package
org
.
cloudbus
.
cloudsim
.
gpu
.
power
.
models
;
import
org.cloudbus.cloudsim.power.models.PowerModel
;
/**
* Implements a power model where the power consumption is zeroed out.
*
* @author Ahmad Siavashi
*
*/
public
class
GpuHostPowerModelNull
implements
PowerModel
{
/**
* The host will be zeroed out.
*/
public
GpuHostPowerModelNull
()
{
}
@Override
public
double
getPower
(
double
utilization
)
throws
IllegalArgumentException
{
return
0
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/power/models/VideoCardPowerModelNull.java
0 → 100644
View file @
b0f5a68b
package
org
.
cloudbus
.
cloudsim
.
gpu
.
power
.
models
;
import
java.util.Map
;
import
org.cloudbus.cloudsim.gpu.Pgpu
;
/**
* Implements a power model for which zeroes out the video card power
* consumption.
*
* @author Ahmad Siavashi
*
*/
public
class
VideoCardPowerModelNull
implements
VideoCardPowerModel
{
/**
* Implements a power model for which zeroes out the video card power
* consumption. *
*/
public
VideoCardPowerModelNull
()
{
}
@Override
public
double
getPower
(
Map
<
Pgpu
,
Double
>
pgpuUtilization
,
Map
<
Pgpu
,
Double
>
gddramUtilization
,
double
bwUtilization
)
{
return
0
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/remote/RemoteGpuHost.java
View file @
b0f5a68b
...
...
@@ -26,6 +26,16 @@ import org.cloudbus.cloudsim.provisioners.RamProvisioner;
*/
public
class
RemoteGpuHost
extends
PowerGpuHost
{
public
RemoteGpuHost
(
int
id
,
int
type
,
RamProvisioner
ramProvisioner
,
BwProvisioner
bwProvisioner
,
long
storage
,
List
<?
extends
Pe
>
peList
,
VmScheduler
vmScheduler
,
VideoCardAllocationPolicy
videoCardAllocationPolicy
)
{
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
,
videoCardAllocationPolicy
);
}
public
RemoteGpuHost
(
int
id
,
int
type
,
RamProvisioner
ramProvisioner
,
BwProvisioner
bwProvisioner
,
long
storage
,
List
<?
extends
Pe
>
peList
,
VmScheduler
vmScheduler
)
{
super
(
id
,
type
,
ramProvisioner
,
bwProvisioner
,
storage
,
peList
,
vmScheduler
);
}
/**
* A {@link PowerGpuHost} which supports GPU remoting.
*/
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/remote/RemoteGpuVmSchedulerSpaceShared.java
0 → 100644
View file @
b0f5a68b
package
org
.
cloudbus
.
cloudsim
.
gpu
.
remote
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
import
org.cloudbus.cloudsim.Pe
;
import
org.cloudbus.cloudsim.Vm
;
import
org.cloudbus.cloudsim.VmSchedulerSpaceShared
;
public
class
RemoteGpuVmSchedulerSpaceShared
extends
VmSchedulerSpaceShared
{
public
RemoteGpuVmSchedulerSpaceShared
(
List
<?
extends
Pe
>
pelist
)
{
super
(
pelist
);
}
@Override
public
boolean
allocatePesForVm
(
Vm
vm
,
List
<
Double
>
mipsShare
)
{
// if there is no enough free PEs, fails
if
(
getFreePes
().
size
()
<
vm
.
getNumberOfPes
())
{
return
false
;
}
List
<
Pe
>
selectedPes
=
new
ArrayList
<
Pe
>();
Iterator
<
Pe
>
peIterator
=
getFreePes
().
iterator
();
Pe
pe
=
peIterator
.
next
();
double
totalMips
=
0
;
for
(
int
i
=
0
;
i
<
vm
.
getNumberOfPes
();
i
++)
{
selectedPes
.
add
(
pe
);
if
(!
peIterator
.
hasNext
())
{
break
;
}
pe
=
peIterator
.
next
();
totalMips
+=
pe
.
getPeProvisioner
().
getMips
();
}
if
(
vm
.
getNumberOfPes
()
>
selectedPes
.
size
())
{
return
false
;
}
List
<
Double
>
allocatedMips
=
new
ArrayList
<>();
for
(
Pe
selectedPe
:
selectedPes
)
{
allocatedMips
.
add
(
selectedPe
.
getPeProvisioner
().
getMips
());
}
vm
.
setCurrentAllocatedMips
(
allocatedMips
);
getFreePes
().
removeAll
(
selectedPes
);
getPeAllocationMap
().
put
(
vm
.
getUid
(),
selectedPes
);
getMipsMap
().
put
(
vm
.
getUid
(),
allocatedMips
);
setAvailableMips
(
getAvailableMips
()
-
totalMips
);
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