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
ad64ecd5
Commit
ad64ecd5
authored
Dec 03, 2018
by
Ahmad Siavashi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
power model added
parent
dc418c00
Pipeline
#14
canceled with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
603 deletions
+82
-603
Lpds.java
...in/java/org/cloudbus/cloudsim/examples/gpu/lpds/Lpds.java
+0
-429
LpdsWorkload.java
...org/cloudbus/cloudsim/examples/gpu/lpds/LpdsWorkload.java
+0
-99
lpds_workload_manifest.json
...us/cloudsim/examples/gpu/lpds/lpds_workload_manifest.json
+0
-72
VideoCardPowerModelLinear.java
.../cloudsim/gpu/power/models/VideoCardPowerModelLinear.java
+78
-0
VideoCardPowerModelNvidiaGridK1.java
...sim/gpu/power/models/VideoCardPowerModelNvidiaGridK1.java
+1
-1
VideoCardPowerModelNvidiaGridK2.java
...sim/gpu/power/models/VideoCardPowerModelNvidiaGridK2.java
+1
-1
RemoteVgpuSchedulerFairShare.java
...bus/cloudsim/gpu/remote/RemoteVgpuSchedulerFairShare.java
+2
-1
No files found.
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/gpu/lpds/Lpds.java
deleted
100644 → 0
View file @
dc418c00
package
org
.
cloudbus
.
cloudsim
.
examples
.
gpu
.
lpds
;
import
java.io.File
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
org.cloudbus.cloudsim.Cloudlet
;
import
org.cloudbus.cloudsim.CloudletSchedulerTimeShared
;
import
org.cloudbus.cloudsim.DatacenterCharacteristics
;
import
org.cloudbus.cloudsim.Log
;
import
org.cloudbus.cloudsim.Pe
;
import
org.cloudbus.cloudsim.Storage
;
import
org.cloudbus.cloudsim.UtilizationModel
;
import
org.cloudbus.cloudsim.UtilizationModelFull
;
import
org.cloudbus.cloudsim.VmAllocationPolicy
;
import
org.cloudbus.cloudsim.VmScheduler
;
import
org.cloudbus.cloudsim.core.CloudSim
;
import
org.cloudbus.cloudsim.gpu.GpuCloudlet
;
import
org.cloudbus.cloudsim.gpu.GpuDatacenter
;
import
org.cloudbus.cloudsim.gpu.GpuDatacenterBroker
;
import
org.cloudbus.cloudsim.gpu.GpuHost
;
import
org.cloudbus.cloudsim.gpu.GpuTask
;
import
org.cloudbus.cloudsim.gpu.GpuTaskScheduler
;
import
org.cloudbus.cloudsim.gpu.GpuTaskSchedulerLeftover
;
import
org.cloudbus.cloudsim.gpu.GpuVm
;
import
org.cloudbus.cloudsim.gpu.GridVgpuTags
;
import
org.cloudbus.cloudsim.gpu.Pgpu
;
import
org.cloudbus.cloudsim.gpu.UtilizationModelGaussian
;
import
org.cloudbus.cloudsim.gpu.Vgpu
;
import
org.cloudbus.cloudsim.gpu.VgpuScheduler
;
import
org.cloudbus.cloudsim.gpu.VideoCard
;
import
org.cloudbus.cloudsim.gpu.VideoCardTags
;
import
org.cloudbus.cloudsim.gpu.allocation.VideoCardAllocationPolicy
;
import
org.cloudbus.cloudsim.gpu.allocation.VideoCardAllocationPolicyLeastLoad
;
import
org.cloudbus.cloudsim.gpu.allocation.VideoCardAllocationPolicySimple
;
import
org.cloudbus.cloudsim.gpu.performance.models.PerformanceModelGpuNull
;
import
org.cloudbus.cloudsim.gpu.provisioners.GpuBwProvisionerSimple
;
import
org.cloudbus.cloudsim.gpu.provisioners.GpuGddramProvisionerSimple
;
import
org.cloudbus.cloudsim.gpu.provisioners.VideoCardBwProvisioner
;
import
org.cloudbus.cloudsim.gpu.provisioners.VideoCardBwProvisionerShared
;
import
org.cloudbus.cloudsim.gpu.remote.RemoteGpuHost
;
import
org.cloudbus.cloudsim.gpu.remote.RemoteGpuVmAllocationPolicyFirstFit
;
import
org.cloudbus.cloudsim.gpu.remote.RemoteGpuVmAllocationPolicyLeastLoad
;
import
org.cloudbus.cloudsim.gpu.remote.RemoteGpuVmSchedulerSpaceShared
;
import
org.cloudbus.cloudsim.gpu.remote.RemoteVgpuSchedulerFairShare
;
import
org.cloudbus.cloudsim.gpu.selection.PgpuSelectionPolicy
;
import
org.cloudbus.cloudsim.gpu.selection.PgpuSelectionPolicyLeastLoad
;
import
org.cloudbus.cloudsim.gpu.selection.PgpuSelectionPolicySimple
;
import
org.cloudbus.cloudsim.lists.VmList
;
import
org.cloudbus.cloudsim.provisioners.BwProvisioner
;
import
org.cloudbus.cloudsim.provisioners.BwProvisionerSimple
;
import
org.cloudbus.cloudsim.provisioners.PeProvisioner
;
import
org.cloudbus.cloudsim.provisioners.PeProvisionerSimple
;
import
org.cloudbus.cloudsim.provisioners.RamProvisioner
;
import
org.cloudbus.cloudsim.provisioners.RamProvisionerSimple
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
de.vandermeer.asciitable.AsciiTable
;
public
class
Lpds
{
public
static
final
int
TYPE_CUSTOM
=
-
1
;
public
static
final
long
SEED
=
1
;
public
static
void
main
(
String
[]
args
)
{
try
{
// Loading workload description from file...
ObjectMapper
mapper
=
new
ObjectMapper
();
LpdsWorkload
workloadManifest
=
mapper
.
readValue
(
new
File
(
"//home//gpu//Desktop//gitlab//gpucloudsim//modules//cloudsim-examples//src//main//java//org//cloudbus//cloudsim//examples//gpu//lpds//lpds_workload_manifest.json"
),
LpdsWorkload
.
class
);
// number of cloud users
int
num_user
=
1
;
Calendar
calendar
=
Calendar
.
getInstance
();
// trace events
boolean
trace_flag
=
true
;
// CloudSim initialization
CloudSim
.
init
(
num_user
,
calendar
,
trace_flag
);
// Creation of Datacenters
List
<
GpuDatacenter
>
datacenters
=
createDatacenters
(
workloadManifest
);
// Creation of Datacenter Broker
GpuDatacenterBroker
broker
=
createBroker
(
workloadManifest
.
broker
.
name
);
// Creation of VMs
List
<
GpuVm
>
vms
=
createVms
(
broker
.
getId
(),
workloadManifest
.
vms
);
broker
.
submitVmList
(
vms
);
// Creation of GpuCloudlets
List
<
GpuCloudlet
>
gpuCloudlets
=
createGpuCloudlets
(
broker
.
getId
(),
workloadManifest
.
gpu_cloudlets
,
workloadManifest
.
gpu_cloudlet_vm_map
);
broker
.
submitCloudletList
(
gpuCloudlets
);
Log
.
enable
();
CloudSim
.
startSimulation
();
CloudSim
.
stopSimulation
();
// Final step: Print results when simulation is over
List
<
Cloudlet
>
newList
=
broker
.
getCloudletReceivedList
();
printCloudletList
(
newList
,
vms
);
Log
.
printLine
(
"The End."
);
}
catch
(
Exception
ex
)
{
Log
.
printLine
(
ex
.
getMessage
());
ex
.
printStackTrace
();
}
}
private
static
Vgpu
createVgpu
(
LpdsVgpu
vgpuManifest
)
{
final
int
DONT_CARE
=
0
;
final
int
type
=
vgpuManifest
.
type
;
// GPU Clock: 850 MHz
final
double
mips
=
DONT_CARE
;
// SMX count: 1
final
int
numberOfPes
=
DONT_CARE
;
// GDDRAM: 256 MB
final
int
gddram
=
vgpuManifest
.
memory
;
// Bandwidth: 28 GB/s
final
long
bw
=
DONT_CARE
;
GpuTaskScheduler
gpuTaskScheduler
=
new
GpuTaskSchedulerLeftover
();
Vgpu
vgpu
=
new
Vgpu
(
0
,
mips
,
numberOfPes
,
gddram
,
bw
,
type
,
gpuTaskScheduler
,
VideoCardTags
.
PCI_E_3_X16_BW
);
return
vgpu
;
}
private
static
List
<
GpuVm
>
createVms
(
int
brokerId
,
List
<
LpdsVm
>
vmsManifest
)
{
List
<
GpuVm
>
vms
=
new
ArrayList
<>();
int
vm_id
=
0
;
for
(
LpdsVm
vmManifest
:
vmsManifest
)
{
// vGPU
LpdsVgpu
vgpuManifest
=
vmManifest
.
vgpu
;
// VM description
double
mips
=
0
;
// image size (MB)
long
size
=
0
;
// vm memory (MB)
int
ram
=
(
int
)
(
vmManifest
.
ram
*
1024
);
long
bw
=
Long
.
MAX_VALUE
;
// number of cpus
int
pesNumber
=
vmManifest
.
num_vcpus
;
// VMM name
String
vmm
=
"Xen"
;
// create VM
GpuVm
vm
=
new
GpuVm
(
vm_id
,
brokerId
,
mips
,
pesNumber
,
ram
,
bw
,
size
,
vmm
,
TYPE_CUSTOM
,
new
CloudletSchedulerTimeShared
());
vm_id
+=
1
;
if
(
vgpuManifest
!=
null
)
{
Vgpu
vgpu
=
createVgpu
(
vgpuManifest
);
vm
.
setVgpu
(
vgpu
);
}
vms
.
add
(
vm
);
}
return
vms
;
}
private
static
GpuTask
createGpuTask
(
LpdsGpuTask
gpuTaskManifest
)
{
// GpuTask properties
long
blockLength
=
gpuTaskManifest
.
block_length
;
long
inputSize
=
512
;
long
outputSize
=
512
;
long
requestedGddramSize
=
inputSize
+
outputSize
;
int
numberOfBlocks
=
gpuTaskManifest
.
num_blocks
;
UtilizationModel
gpuUtilizationModel
=
null
;
UtilizationModel
gddramUtilizationModel
=
null
;
UtilizationModel
bwUtilizationModel
=
new
UtilizationModelFull
();
switch
(
gpuTaskManifest
.
gpu_utilization_model
)
{
case
"full"
:
gpuUtilizationModel
=
new
UtilizationModelFull
();
break
;
case
"low"
:
gpuUtilizationModel
=
new
UtilizationModelGaussian
(
0.2
,
0.05
,
SEED
);
break
;
case
"medium"
:
gpuUtilizationModel
=
new
UtilizationModelGaussian
(
0.5
,
0.05
,
SEED
);
break
;
case
"high"
:
gpuUtilizationModel
=
new
UtilizationModelGaussian
(
0.8
,
0.05
,
SEED
);
break
;
default
:
throw
new
IllegalArgumentException
(
"[-] Unknown GPU Utilization Model for GpuTask."
);
}
switch
(
gpuTaskManifest
.
gddram_utilization_model
)
{
case
"full"
:
gddramUtilizationModel
=
new
UtilizationModelFull
();
break
;
case
"low"
:
gddramUtilizationModel
=
new
UtilizationModelGaussian
(
0.2
,
0.05
,
SEED
);
break
;
case
"medium"
:
gddramUtilizationModel
=
new
UtilizationModelGaussian
(
0.5
,
0.05
,
SEED
);
break
;
case
"high"
:
gddramUtilizationModel
=
new
UtilizationModelGaussian
(
0.8
,
0.05
,
SEED
);
break
;
default
:
throw
new
IllegalArgumentException
(
"[-] Unknown GDDRAM Utilization Model for GpuTask."
);
}
GpuTask
gpuTask
=
new
GpuTask
(
0
,
blockLength
,
numberOfBlocks
,
inputSize
,
outputSize
,
requestedGddramSize
,
gpuUtilizationModel
,
gddramUtilizationModel
,
bwUtilizationModel
);
return
gpuTask
;
}
private
static
List
<
GpuCloudlet
>
createGpuCloudlets
(
int
brokerId
,
List
<
LpdsGpuCloudlet
>
gpuCloudletsManifest
,
Map
<
Integer
,
Integer
>
gpuCloudletVmMap
)
{
List
<
GpuCloudlet
>
gpuCloudlets
=
new
ArrayList
<>();
for
(
LpdsGpuCloudlet
gpuCloudletManifest
:
gpuCloudletsManifest
)
{
// Cloudlet properties
long
length
=
gpuCloudletManifest
.
length
;
long
inputSize
=
0
;
long
outputSize
=
0
;
int
pesNumber
=
gpuCloudletManifest
.
num_pes
;
UtilizationModel
cpuUtilizationModel
=
null
;
UtilizationModel
ramUtilizationModel
=
new
UtilizationModelFull
();
UtilizationModel
bwUtilizationModel
=
new
UtilizationModelFull
();
switch
(
gpuCloudletManifest
.
cpu_utilization_model
)
{
case
"full"
:
cpuUtilizationModel
=
new
UtilizationModelFull
();
break
;
case
"low"
:
cpuUtilizationModel
=
new
UtilizationModelGaussian
(
0.2
,
0.05
,
SEED
);
break
;
case
"medium"
:
cpuUtilizationModel
=
new
UtilizationModelGaussian
(
0.5
,
0.05
,
SEED
);
break
;
case
"high"
:
cpuUtilizationModel
=
new
UtilizationModelGaussian
(
0.8
,
0.05
,
SEED
);
break
;
default
:
throw
new
IllegalArgumentException
(
"[-] Unknown CPU Utilization Model for Cloudlet."
);
}
LpdsGpuTask
gpuTaskManifest
=
gpuCloudletManifest
.
gpu_task
;
GpuTask
gpuTask
=
null
;
if
(
gpuTaskManifest
!=
null
)
{
gpuTask
=
createGpuTask
(
gpuTaskManifest
);
}
GpuCloudlet
gpuCloudlet
=
new
GpuCloudlet
(
gpuCloudletManifest
.
id
,
length
,
pesNumber
,
inputSize
,
outputSize
,
cpuUtilizationModel
,
ramUtilizationModel
,
bwUtilizationModel
,
gpuTask
);
gpuCloudlet
.
setUserId
(
brokerId
);
gpuCloudlet
.
setVmId
(
gpuCloudletVmMap
.
get
(
gpuCloudlet
.
getCloudletId
()));
gpuCloudlets
.
add
(
gpuCloudlet
);
}
return
gpuCloudlets
;
}
private
static
GpuDatacenterBroker
createBroker
(
String
name
)
{
GpuDatacenterBroker
broker
=
null
;
try
{
broker
=
new
GpuDatacenterBroker
(
name
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
return
broker
;
}
private
static
List
<
GpuDatacenter
>
createDatacenters
(
LpdsWorkload
workloadManifest
)
{
List
<
GpuDatacenter
>
datacenters
=
new
ArrayList
<>();
for
(
LpdsDatacenter
datacenterManifest
:
workloadManifest
.
datacenters
)
{
// We need to create a list to store our machine
List
<
GpuHost
>
hostList
=
new
ArrayList
<>();
int
hostId
=
0
;
for
(
LpdsHost
hostManifest
:
datacenterManifest
.
hosts
)
{
// A Machine contains one or more PEs or CPUs/Cores.
List
<
Pe
>
hostPes
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
hostManifest
.
num_pes
;
i
++)
{
hostPes
.
add
(
new
Pe
(
i
,
new
PeProvisionerSimple
(
hostManifest
.
pe_mips
)));
}
VmScheduler
vmScheduler
=
new
RemoteGpuVmSchedulerSpaceShared
(
hostPes
);
RamProvisioner
ramProvisioner
=
new
RamProvisionerSimple
(
hostManifest
.
ram
*
1024
);
BwProvisioner
bwProvisioner
=
new
BwProvisionerSimple
(
Long
.
MAX_VALUE
);
// Adding video cards with pgpus
List
<
VideoCard
>
videoCards
=
new
ArrayList
<>();
int
videoCardId
=
0
;
for
(
LpdsVideoCard
videoCardManifest
:
hostManifest
.
video_cards
)
{
List
<
Pgpu
>
pgpus
=
new
ArrayList
<>();
LpdsGpu
gpu
=
videoCardManifest
.
gpu
;
for
(
int
j
=
0
;
j
<
videoCardManifest
.
num_gpus
;
j
++)
{
List
<
Pe
>
pgpuPes
=
new
ArrayList
<
Pe
>();
for
(
int
k
=
0
;
k
<
videoCardManifest
.
gpu
.
num_pes
;
k
++)
{
PeProvisioner
peProvisioner
=
new
PeProvisionerSimple
(
gpu
.
pe_mips
);
pgpuPes
.
add
(
new
Pe
(
k
,
peProvisioner
));
}
pgpus
.
add
(
new
Pgpu
(
j
,
pgpuPes
,
new
GpuGddramProvisionerSimple
(
gpu
.
gddram
),
new
GpuBwProvisionerSimple
(
Long
.
MAX_VALUE
)));
}
VideoCardBwProvisioner
videoCardBwProvisioner
=
new
VideoCardBwProvisionerShared
(
Long
.
MAX_VALUE
);
PgpuSelectionPolicy
pgpuSelectionPolicy
=
null
;
switch
(
videoCardManifest
.
gpu_selection_policy
)
{
case
"simple"
:
pgpuSelectionPolicy
=
new
PgpuSelectionPolicySimple
();
break
;
case
"least_load"
:
pgpuSelectionPolicy
=
new
PgpuSelectionPolicyLeastLoad
();
break
;
default
:
throw
new
IllegalArgumentException
(
"[!] Unknown GpuSelection Policy: "
+
videoCardManifest
.
gpu_selection_policy
);
}
VgpuScheduler
vgpuScheduler
=
new
RemoteVgpuSchedulerFairShare
(
TYPE_CUSTOM
,
pgpus
,
pgpuSelectionPolicy
,
new
PerformanceModelGpuNull
());
VideoCard
videoCard
=
new
VideoCard
(
videoCardId
,
TYPE_CUSTOM
,
vgpuScheduler
,
videoCardBwProvisioner
);
videoCards
.
add
(
videoCard
);
videoCardId
+=
1
;
}
VideoCardAllocationPolicy
videoCardAllocationPolicy
=
null
;
switch
(
hostManifest
.
video_card_allocation_policy
)
{
case
"simple"
:
videoCardAllocationPolicy
=
new
VideoCardAllocationPolicySimple
(
videoCards
);
break
;
case
"least_load"
:
videoCardAllocationPolicy
=
new
VideoCardAllocationPolicyLeastLoad
(
videoCards
);
break
;
}
GpuHost
host
=
new
RemoteGpuHost
(
hostId
,
TYPE_CUSTOM
,
ramProvisioner
,
bwProvisioner
,
Long
.
MAX_VALUE
,
hostPes
,
vmScheduler
,
videoCardAllocationPolicy
);
hostList
.
add
(
host
);
hostId
+=
1
;
}
String
datacenterName
=
datacenterManifest
.
name
;
VmAllocationPolicy
vmAllocationPolicy
=
null
;
switch
(
datacenterManifest
.
vm_allocation_policy
)
{
case
"simple"
:
vmAllocationPolicy
=
new
RemoteGpuVmAllocationPolicyFirstFit
(
hostList
);
break
;
case
"least_load"
:
vmAllocationPolicy
=
new
RemoteGpuVmAllocationPolicyLeastLoad
(
hostList
);
break
;
default
:
throw
new
IllegalArgumentException
(
"[-] Vm Allocation Policy for Datacenter "
+
datacenterName
+
" is unknown."
);
}
// Create a DatacenterCharacteristics object that stores the
// properties of a data center: architecture, OS, list of
// Machines, allocation policy: time- or space-shared, time zone
// and its price (G$/Pe time unit).
// system architecture
String
arch
=
"x86"
;
// operating system
String
os
=
"Linux"
;
// VM Manager
String
vmm
=
"Xen"
;
// time zone this resource located
double
time_zone
=
3.5
;
// the cost of using processing in this resource
double
cost
=
0.0
;
// the cost of using memory in this resource
double
costPerMem
=
0.0
;
// the cost of using storage in this resource
double
costPerStorage
=
0.0
;
// the cost of using bw in this resource
double
costPerBw
=
0.0
;
// we are not adding SAN devices by now
LinkedList
<
Storage
>
storageList
=
new
LinkedList
<
Storage
>();
DatacenterCharacteristics
characteristics
=
new
DatacenterCharacteristics
(
arch
,
os
,
vmm
,
hostList
,
time_zone
,
cost
,
costPerMem
,
costPerStorage
,
costPerBw
);
// 6. Finally, we need to create a Datacenter object.
GpuDatacenter
datacenter
=
null
;
final
double
schedulingInterval
=
datacenterManifest
.
scheduling_interval
;
try
{
datacenter
=
new
GpuDatacenter
(
datacenterManifest
.
name
,
characteristics
,
vmAllocationPolicy
,
storageList
,
schedulingInterval
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
datacenters
.
add
(
datacenter
);
}
return
datacenters
;
}
private
static
void
printCloudletList
(
List
<
Cloudlet
>
cloudlets
,
List
<
GpuVm
>
vmlist
)
{
DecimalFormat
dft
=
new
DecimalFormat
(
"###.##"
);
for
(
Cloudlet
cloudlet
:
cloudlets
)
{
AsciiTable
at
=
new
AsciiTable
();
at
.
addRule
();
at
.
addRow
(
"Cloudlet ID"
,
"Status"
,
"Datacenter ID"
,
"VM ID"
,
"Time"
,
"Start Time"
,
"Finish Time"
);
at
.
addRule
();
if
(
cloudlet
.
getCloudletStatus
()
==
Cloudlet
.
SUCCESS
)
{
at
.
addRow
(
cloudlet
.
getCloudletId
(),
"SUCCESS"
,
cloudlet
.
getResourceId
(),
cloudlet
.
getVmId
(),
dft
.
format
(
cloudlet
.
getActualCPUTime
()).
toString
(),
dft
.
format
(
cloudlet
.
getExecStartTime
()).
toString
(),
dft
.
format
(
cloudlet
.
getFinishTime
()).
toString
());
at
.
addRule
();
}
GpuTask
gpuTask
=
((
GpuCloudlet
)
cloudlet
).
getGpuTask
();
if
(
gpuTask
!=
null
&&
gpuTask
.
getTaskStatus
()
==
GpuTask
.
SUCCESS
)
{
at
.
addRow
(
"Task ID"
,
"Cloudlet ID"
,
"Status"
,
"vGPU Profile"
,
"Time"
,
"Start Time"
,
"Finish Time"
);
at
.
addRule
();
at
.
addRow
(
gpuTask
.
getTaskId
(),
gpuTask
.
getCloudlet
().
getCloudletId
(),
"SUCCESS"
,
GridVgpuTags
.
getVgpuTypeString
(
((
GpuVm
)
VmList
.
getById
(
vmlist
,
gpuTask
.
getCloudlet
().
getVmId
())).
getVgpu
().
getType
()),
dft
.
format
(
gpuTask
.
getActualGPUTime
()).
toString
(),
dft
.
format
(
gpuTask
.
getExecStartTime
()).
toString
(),
dft
.
format
(
gpuTask
.
getFinishTime
()).
toString
());
at
.
addRule
();
}
at
.
getContext
().
setWidth
(
100
);
Log
.
print
(
at
.
render
());
Log
.
printLine
();
}
}
}
\ No newline at end of file
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/gpu/lpds/LpdsWorkload.java
deleted
100644 → 0
View file @
dc418c00
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
deleted
100644 → 0
View file @
dc418c00
{
"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/power/models/VideoCardPowerModelLinear.java
0 → 100644
View file @
ad64ecd5
package
org
.
cloudbus
.
cloudsim
.
gpu
.
power
.
models
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
org.cloudbus.cloudsim.gpu.Pgpu
;
/**
* Implements a power model where the power consumption is linear to resource
* usage and frequency.
*
* @author Ahmad Siavashi
*
*/
public
class
VideoCardPowerModelLinear
implements
VideoCardPowerModel
{
private
boolean
powerGate
;
private
double
a3
,
a2
,
a1
,
a0
;
private
int
frequency
;
/**
* A power model where the power consumption is linear to resource usage and
* frequency.
*
* @param frequency
* nominal frequency of the device in MHz
* @param a3
* constant parameter of the model
* @param a2
* constant parameter of the model
*
* @param a1
* constant parameter of the model
*
* @param a0
* constant parameter of the model
*
* @param powerGate
* power gates individual GPUs if they are idle
*/
public
VideoCardPowerModelLinear
(
int
frequency
,
double
a3
,
double
a2
,
double
a1
,
double
a0
,
boolean
powerGate
)
{
this
.
powerGate
=
powerGate
;
this
.
frequency
=
frequency
;
this
.
a3
=
a3
;
this
.
a2
=
a2
;
this
.
a1
=
a1
;
this
.
a0
=
a0
;
}
@Override
public
double
getPower
(
Map
<
Pgpu
,
Double
>
pgpuUtilization
,
Map
<
Pgpu
,
Double
>
gddramUtilization
,
double
bwUtilization
)
{
double
totalVideoCardPower
=
0.0
;
for
(
Entry
<
Pgpu
,
Double
>
entry
:
pgpuUtilization
.
entrySet
())
{
Double
utilization
=
entry
.
getValue
();
double
pgpuPower
=
0.0
;
if
(!
this
.
powerGate
||
this
.
powerGate
&&
utilization
>
0.0
)
{
pgpuPower
=
powerFunction
(
frequency
,
utilization
);
}
totalVideoCardPower
+=
pgpuPower
;
}
return
totalVideoCardPower
;
}
/**
*
* @param f
* pgpu frequency
* @param u
* pgpu utilization
* @return power consumption for the given f and u
*/
protected
double
powerFunction
(
double
f
,
double
u
)
{
u
*=
100
;
double
power
=
a3
*
f
*
u
+
a2
*
f
+
a1
*
u
+
a0
;
return
power
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/power/models/VideoCardPowerModelNvidiaGridK1.java
View file @
ad64ecd5
...
@@ -8,7 +8,7 @@ import org.cloudbus.cloudsim.gpu.Pgpu;
...
@@ -8,7 +8,7 @@ import org.cloudbus.cloudsim.gpu.Pgpu;
import
org.cloudbus.cloudsim.gpu.VideoCardTags
;
import
org.cloudbus.cloudsim.gpu.VideoCardTags
;
/**
/**
* Implements a power model for NVIDIA GRID K1 video card where the power consumption is linear to resource
* Implements a p
rocess variation-aware p
ower model for NVIDIA GRID K1 video card where the power consumption is linear to resource
* usage and frequency.
* usage and frequency.
*
*
* @author Ahmad Siavashi
* @author Ahmad Siavashi
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/power/models/VideoCardPowerModelNvidiaGridK2.java
View file @
ad64ecd5
...
@@ -8,7 +8,7 @@ import org.cloudbus.cloudsim.gpu.Pgpu;
...
@@ -8,7 +8,7 @@ import org.cloudbus.cloudsim.gpu.Pgpu;
import
org.cloudbus.cloudsim.gpu.VideoCardTags
;
import
org.cloudbus.cloudsim.gpu.VideoCardTags
;
/**
/**
* Implements a power model for NVIDIA GRID K2 video card where the power
* Implements a p
rocess variation-aware p
ower model for NVIDIA GRID K2 video card where the power
* consumption is linear to resource usage and frequency.
* consumption is linear to resource usage and frequency.
*
*
* @author Ahmad Siavashi
* @author Ahmad Siavashi
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/gpu/remote/RemoteVgpuSchedulerFairShare.java
View file @
ad64ecd5
...
@@ -11,6 +11,7 @@ import org.cloudbus.cloudsim.gpu.Pgpu;
...
@@ -11,6 +11,7 @@ import org.cloudbus.cloudsim.gpu.Pgpu;
import
org.cloudbus.cloudsim.gpu.Vgpu
;
import
org.cloudbus.cloudsim.gpu.Vgpu
;
import
org.cloudbus.cloudsim.gpu.VgpuScheduler
;
import
org.cloudbus.cloudsim.gpu.VgpuScheduler
;
import
org.cloudbus.cloudsim.gpu.VgpuSchedulerFairShare
;
import
org.cloudbus.cloudsim.gpu.VgpuSchedulerFairShare
;
import
org.cloudbus.cloudsim.gpu.performance.PerformanceScheduler
;
import
org.cloudbus.cloudsim.gpu.performance.PerformanceVgpuSchedulerFairShare
;
import
org.cloudbus.cloudsim.gpu.performance.PerformanceVgpuSchedulerFairShare
;
import
org.cloudbus.cloudsim.gpu.performance.models.PerformanceModel
;
import
org.cloudbus.cloudsim.gpu.performance.models.PerformanceModel
;
import
org.cloudbus.cloudsim.gpu.selection.PgpuSelectionPolicy
;
import
org.cloudbus.cloudsim.gpu.selection.PgpuSelectionPolicy
;
...
@@ -21,7 +22,7 @@ import org.cloudbus.cloudsim.util.MathUtil;
...
@@ -21,7 +22,7 @@ import org.cloudbus.cloudsim.util.MathUtil;
*
*
* @author Ahmad Siavashi
* @author Ahmad Siavashi
*/
*/
public
class
RemoteVgpuSchedulerFairShare
extends
PerformanceVgpuSchedulerFairShare
{
public
class
RemoteVgpuSchedulerFairShare
extends
PerformanceVgpuSchedulerFairShare
implements
PerformanceScheduler
<
Vgpu
>
{
/**
/**
* Extends {@link VgpuSchedulerFairShare} to add support for GPU remoting.
* Extends {@link VgpuSchedulerFairShare} to add support for GPU remoting.
...
...
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