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
f0662234
Commit
f0662234
authored
Jul 02, 2011
by
Anton Beloglazov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few fixes here and there
parent
7b66bab7
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
219 additions
and
34 deletions
+219
-34
CloudletScheduler.java
...rc/main/java/org/cloudbus/cloudsim/CloudletScheduler.java
+14
-0
CloudletSchedulerSpaceShared.java
...a/org/cloudbus/cloudsim/CloudletSchedulerSpaceShared.java
+12
-0
CloudletSchedulerTimeShared.java
...va/org/cloudbus/cloudsim/CloudletSchedulerTimeShared.java
+18
-0
HostDynamicWorkload.java
.../main/java/org/cloudbus/cloudsim/HostDynamicWorkload.java
+15
-7
UtilizationModelNull.java
...main/java/org/cloudbus/cloudsim/UtilizationModelNull.java
+28
-0
Vm.java
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/Vm.java
+29
-9
PowerDatacenter.java
...ain/java/org/cloudbus/cloudsim/power/PowerDatacenter.java
+22
-17
PowerHost.java
.../src/main/java/org/cloudbus/cloudsim/power/PowerHost.java
+1
-1
PowerModelSpecPowerHpProLiantMl110G3PentiumD930.java
...dels/PowerModelSpecPowerHpProLiantMl110G3PentiumD930.java
+20
-0
PowerModelSpecPowerHpProLiantMl110G4Xeon3040.java
.../models/PowerModelSpecPowerHpProLiantMl110G4Xeon3040.java
+20
-0
PowerModelSpecPowerHpProLiantMl110G5Xeon3075.java
.../models/PowerModelSpecPowerHpProLiantMl110G5Xeon3075.java
+20
-0
PowerModelSpecPowerIbmX3250XeonX3470.java
...im/power/models/PowerModelSpecPowerIbmX3250XeonX3470.java
+20
-0
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/CloudletScheduler.java
View file @
f0662234
...
...
@@ -223,6 +223,20 @@ public abstract class CloudletScheduler {
*/
public
abstract
double
getTotalCurrentAllocatedMipsForCloudlet
(
ResCloudlet
rcl
,
double
time
);
/**
* Gets the current requested ram.
*
* @return the current requested ram
*/
public
abstract
double
getCurrentRequestedUtilizationOfRam
();
/**
* Gets the current requested bw.
*
* @return the current requested bw
*/
public
abstract
double
getCurrentRequestedUtilizationOfBw
();
/**
* Gets the previous time.
*
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/CloudletSchedulerSpaceShared.java
View file @
f0662234
...
...
@@ -659,4 +659,16 @@ public class CloudletSchedulerSpaceShared extends CloudletScheduler {
return
0.0
;
}
@Override
public
double
getCurrentRequestedUtilizationOfRam
()
{
// TODO Auto-generated method stub
return
0
;
}
@Override
public
double
getCurrentRequestedUtilizationOfBw
()
{
// TODO Auto-generated method stub
return
0
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/CloudletSchedulerTimeShared.java
View file @
f0662234
...
...
@@ -543,4 +543,22 @@ public class CloudletSchedulerTimeShared extends CloudletScheduler {
return
0.0
;
}
@Override
public
double
getCurrentRequestedUtilizationOfRam
()
{
double
ram
=
0
;
for
(
ResCloudlet
cloudlet
:
cloudletExecList
)
{
ram
+=
cloudlet
.
getCloudlet
().
getUtilizationOfRam
(
CloudSim
.
clock
());
}
return
ram
;
}
@Override
public
double
getCurrentRequestedUtilizationOfBw
()
{
double
bw
=
0
;
for
(
ResCloudlet
cloudlet
:
cloudletExecList
)
{
bw
+=
cloudlet
.
getCloudlet
().
getUtilizationOfBw
(
CloudSim
.
clock
());
}
return
bw
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/HostDynamicWorkload.java
View file @
f0662234
...
...
@@ -77,10 +77,10 @@ public class HostDynamicWorkload extends Host {
for
(
Vm
vm
:
getVmList
())
{
double
totalRequestedMips
=
vm
.
getCurrentRequestedTotalMips
();
if
(
totalRequestedMips
==
0
)
{
Log
.
printLine
(
"VM #"
+
vm
.
getId
()
+
" has completed its execution and destroyed"
);
continue
;
}
//
if (totalRequestedMips == 0) {
//
Log.printLine("VM #" + vm.getId() + " has completed its execution and destroyed");
//
continue;
//
}
double
totalAllocatedMips
=
getVmScheduler
().
getTotalAllocatedMipsForVm
(
vm
);
...
...
@@ -95,8 +95,6 @@ public class HostDynamicWorkload extends Host {
Log
.
formatLine
(
"%.2f: [Host #"
+
getId
()
+
"] MIPS for VM #"
+
vm
.
getId
()
+
" by PEs ("
+
getPesNumber
()
+
" * "
+
getVmScheduler
().
getPeCapacity
()
+
")."
+
pesString
,
CloudSim
.
clock
());
}
vm
.
addStateHistoryEntry
(
currentTime
,
totalAllocatedMips
,
totalRequestedMips
,
(
vm
.
isInMigration
()
&&
!
getVmsMigratingIn
().
contains
(
vm
)));
if
(
getVmsMigratingIn
().
contains
(
vm
))
{
Log
.
formatLine
(
"%.2f: [Host #"
+
getId
()
+
"] VM #"
+
vm
.
getId
()
+
" is being migrated to Host #"
+
getId
(),
CloudSim
.
clock
());
}
else
{
...
...
@@ -104,6 +102,8 @@ public class HostDynamicWorkload extends Host {
Log
.
formatLine
(
"%.2f: [Host #"
+
getId
()
+
"] Under allocated MIPS for VM #"
+
vm
.
getId
()
+
": %.2f"
,
CloudSim
.
clock
(),
totalRequestedMips
-
totalAllocatedMips
);
}
vm
.
addStateHistoryEntry
(
currentTime
,
totalAllocatedMips
,
totalRequestedMips
,
(
vm
.
isInMigration
()
&&
!
getVmsMigratingIn
().
contains
(
vm
)));
if
(
vm
.
isInMigration
())
{
Log
.
formatLine
(
"%.2f: [Host #"
+
getId
()
+
"] VM #"
+
vm
.
getId
()
+
" is in migration"
,
CloudSim
.
clock
());
totalAllocatedMips
/=
0.9
;
// performance degradation due to migration - 10%
...
...
@@ -265,7 +265,15 @@ public class HostDynamicWorkload extends Host {
* @param isActive the is active
*/
public
void
addStateHistoryEntry
(
double
time
,
double
allocatedMips
,
double
requestedMips
,
boolean
isActive
)
{
getStateHistory
().
add
(
new
HostStateHistoryEntry
(
time
,
allocatedMips
,
requestedMips
,
isActive
));
HostStateHistoryEntry
newState
=
new
HostStateHistoryEntry
(
time
,
allocatedMips
,
requestedMips
,
isActive
);
if
(!
getStateHistory
().
isEmpty
())
{
HostStateHistoryEntry
previousState
=
getStateHistory
().
get
(
getStateHistory
().
size
()
-
1
);
if
(
previousState
.
getTime
()
==
time
)
{
getStateHistory
().
set
(
getStateHistory
().
size
()
-
1
,
newState
);
return
;
}
}
getStateHistory
().
add
(
newState
);
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/UtilizationModelNull.java
0 → 100644
View file @
f0662234
/*
* Title: CloudSim Toolkit
* Description: CloudSim (Cloud Simulation) Toolkit for Modeling and Simulation of Clouds
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
*
* Copyright (c) 2009-2010, The University of Melbourne, Australia
*/
package
org
.
cloudbus
.
cloudsim
;
/**
* The UtilizationModelNull class is a simple model, according to which
* a Cloudlet always require zero capacity.
*
* @author Anton Beloglazov
* @since CloudSim Toolkit 2.0
*/
public
class
UtilizationModelNull
implements
UtilizationModel
{
/* (non-Javadoc)
* @see cloudsim.power.UtilizationModel#getUtilization(double)
*/
@Override
public
double
getUtilization
(
double
time
)
{
return
0
;
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/Vm.java
View file @
f0662234
...
...
@@ -12,6 +12,8 @@ import java.util.ArrayList;
import
java.util.LinkedList
;
import
java.util.List
;
import
org.cloudbus.cloudsim.core.CloudSim
;
/**
* Vm represents a VM: it runs inside a Host, sharing hostList
* with other VMs. It processes cloudlets. This processing happens according
...
...
@@ -150,13 +152,17 @@ public class Vm {
if
(
isRecentlyCreated
())
{
boolean
mipsIsNull
=
true
;
for
(
double
mips
:
currentRequestedMips
)
{
if
(
mips
>
0.0
)
{
mipsIsNull
=
false
;
setRecentlyCreated
(
false
);
break
;
}
if
(
CloudSim
.
clock
()
>
0
)
{
mipsIsNull
=
false
;
setRecentlyCreated
(
false
);
}
// for (double mips : currentRequestedMips) {
// if (mips > 0.0) {
// mipsIsNull = false;
// setRecentlyCreated(false);
// break;
// }
// }
//if (mipsIsNull && isRecentlyCreated()) {
if
(
mipsIsNull
)
{
...
...
@@ -204,7 +210,10 @@ public class Vm {
* @return the current requested bw
*/
public
long
getCurrentRequestedBw
()
{
return
getBw
();
if
(
isRecentlyCreated
())
{
return
getBw
();
}
return
(
long
)
(
getCloudletScheduler
().
getCurrentRequestedUtilizationOfBw
()
*
getBw
());
}
/**
...
...
@@ -213,7 +222,10 @@ public class Vm {
* @return the current requested ram
*/
public
int
getCurrentRequestedRam
()
{
return
getRam
();
if
(
isRecentlyCreated
())
{
return
getRam
();
}
return
(
int
)
(
getCloudletScheduler
().
getCurrentRequestedUtilizationOfRam
()
*
getRam
());
}
/**
...
...
@@ -602,7 +614,15 @@ public class Vm {
* @param isInMigration the is in migration
*/
public
void
addStateHistoryEntry
(
double
time
,
double
allocatedMips
,
double
requestedMips
,
boolean
isInMigration
)
{
getStateHistory
().
add
(
new
VmStateHistoryEntry
(
time
,
allocatedMips
,
requestedMips
,
isInMigration
));
VmStateHistoryEntry
newState
=
new
VmStateHistoryEntry
(
time
,
allocatedMips
,
requestedMips
,
isInMigration
);
if
(!
getStateHistory
().
isEmpty
())
{
VmStateHistoryEntry
previousState
=
getStateHistory
().
get
(
getStateHistory
().
size
()
-
1
);
if
(
previousState
.
getTime
()
==
time
)
{
getStateHistory
().
set
(
getStateHistory
().
size
()
-
1
,
newState
);
return
;
}
}
getStateHistory
().
add
(
newState
);
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/PowerDatacenter.java
View file @
f0662234
...
...
@@ -87,6 +87,8 @@ public class PowerDatacenter extends Datacenter {
// if some time passed since last processing
if
(
currentTime
>
getLastProcessTime
())
{
System
.
out
.
print
(
currentTime
+
" "
);
double
minTime
=
updateCloudetProcessingWithoutSchedulingFutureEventsForce
();
if
(!
isDisableMigrations
())
{
...
...
@@ -110,7 +112,7 @@ public class PowerDatacenter extends Datacenter {
/** VM migration delay = RAM / bandwidth **/
// we use BW / 2 to model BW available for migration purposes, the other half of BW is for VM communication
// around 16 seconds for 1024 MB using 1 Gbit/s network
send
(
getId
(),
vm
.
get
CurrentAllocated
Ram
()
/
((
double
)
targetHost
.
getBw
()
/
(
2
*
8000
)),
CloudSimTags
.
VM_MIGRATE
,
migrate
);
send
(
getId
(),
vm
.
getRam
()
/
((
double
)
targetHost
.
getBw
()
/
(
2
*
8000
)),
CloudSimTags
.
VM_MIGRATE
,
migrate
);
}
}
}
...
...
@@ -148,23 +150,8 @@ public class PowerDatacenter extends Datacenter {
double
timeDiff
=
currentTime
-
getLastProcessTime
();
double
timeFrameDatacenterEnergy
=
0.0
;
if
(
timeDiff
>
0
)
{
Log
.
formatLine
(
"\nEnergy consumption for the last time frame from %.2f to %.2f:"
,
getLastProcessTime
(),
currentTime
);
for
(
PowerHost
host
:
this
.<
PowerHost
>
getHostList
())
{
double
timeFrameHostEnergy
=
host
.
getEnergyLinearInterpolation
(
host
.
getPreviousUtilizationOfCpu
(),
host
.
getUtilizationOfCpu
(),
timeDiff
);
timeFrameDatacenterEnergy
+=
timeFrameHostEnergy
;
Log
.
printLine
();
Log
.
formatLine
(
"%.2f: [Host #%d] utilization is %.2f%%"
,
currentTime
,
host
.
getId
(),
host
.
getUtilizationOfCpu
()
*
100
);
Log
.
formatLine
(
"%.2f: [Host #%d] energy is %.2f W*sec"
,
currentTime
,
host
.
getId
(),
timeFrameHostEnergy
);
}
Log
.
formatLine
(
"\n%.2f: Consumed energy is %.2f W*sec\n"
,
currentTime
,
timeFrameDatacenterEnergy
);
}
Log
.
printLine
(
"\n\n--------------------------------------------------------------\n\n"
);
Log
.
printLine
(
"New resource usage for the next time frame:"
);
Log
.
formatLine
(
"New resource usage for the time frame starting at %.2f:"
,
currentTime
);
for
(
PowerHost
host
:
this
.<
PowerHost
>
getHostList
())
{
Log
.
printLine
();
...
...
@@ -177,6 +164,24 @@ public class PowerDatacenter extends Datacenter {
Log
.
formatLine
(
"%.2f: [Host #%d] utilization is %.2f%%"
,
currentTime
,
host
.
getId
(),
host
.
getUtilizationOfCpu
()
*
100
);
}
if
(
timeDiff
>
0
)
{
Log
.
formatLine
(
"\nEnergy consumption for the last time frame from %.2f to %.2f:"
,
getLastProcessTime
(),
currentTime
);
for
(
PowerHost
host
:
this
.<
PowerHost
>
getHostList
())
{
double
previousUtilizationOfCpu
=
host
.
getPreviousUtilizationOfCpu
();
double
utilizationOfCpu
=
host
.
getUtilizationOfCpu
();
double
timeFrameHostEnergy
=
host
.
getEnergyLinearInterpolation
(
previousUtilizationOfCpu
,
utilizationOfCpu
,
timeDiff
);
timeFrameDatacenterEnergy
+=
timeFrameHostEnergy
;
Log
.
printLine
();
Log
.
formatLine
(
"%.2f: [Host #%d] utilization at %.2f was %.2f%%, now is %.2f%%"
,
currentTime
,
host
.
getId
(),
getLastProcessTime
(),
previousUtilizationOfCpu
*
100
,
utilizationOfCpu
*
100
);
Log
.
formatLine
(
"%.2f: [Host #%d] energy is %.2f W*sec"
,
currentTime
,
host
.
getId
(),
timeFrameHostEnergy
);
}
Log
.
formatLine
(
"\n%.2f: Data center's energy is %.2f W*sec\n"
,
currentTime
,
timeFrameDatacenterEnergy
);
}
setPower
(
getPower
()
+
timeFrameDatacenterEnergy
);
checkCloudletCompletion
();
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/PowerHost.java
View file @
f0662234
...
...
@@ -101,7 +101,7 @@ public class PowerHost extends HostDynamicWorkload {
* @return the energy
*/
public
double
getEnergyLinearInterpolation
(
double
fromUtilization
,
double
toUtilization
,
double
time
)
{
if
(
fromUtilization
==
0
&&
toUtilization
==
0
)
{
if
(
fromUtilization
==
0
)
{
return
0
;
}
double
fromPower
=
getPower
(
fromUtilization
);
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/models/PowerModelSpecPowerHpProLiantMl110G3PentiumD930.java
0 → 100644
View file @
f0662234
package
org
.
cloudbus
.
cloudsim
.
power
.
models
;
/**
* The power model of an HP ProLiant ML110 G3 (1 x [Pentium D930 3000 MHz, 2 cores], 4GB).
* http://www.spec.org/power_ssj2008/results/res2011q1/power_ssj2008-20110127-00342.html
*/
public
class
PowerModelSpecPowerHpProLiantMl110G3PentiumD930
extends
PowerModelSpecPower
{
/** The power. */
private
final
double
[]
power
=
{
105
,
112
,
118
,
125
,
131
,
137
,
147
,
153
,
157
,
164
,
169
};
/* (non-Javadoc)
* @see org.cloudbus.cloudsim.power.models.PowerModelSpecPower#getPowerData(int)
*/
@Override
protected
double
getPowerData
(
int
index
)
{
return
power
[
index
];
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/models/PowerModelSpecPowerHpProLiantMl110G4Xeon3040.java
0 → 100644
View file @
f0662234
package
org
.
cloudbus
.
cloudsim
.
power
.
models
;
/**
* The power model of an HP ProLiant ML110 G4 (1 x [Xeon 3040 1860 MHz, 2 cores], 4GB).
* http://www.spec.org/power_ssj2008/results/res2011q1/power_ssj2008-20110127-00342.html
*/
public
class
PowerModelSpecPowerHpProLiantMl110G4Xeon3040
extends
PowerModelSpecPower
{
/** The power. */
private
final
double
[]
power
=
{
86
,
89.4
,
92.6
,
96
,
99.5
,
102
,
106
,
108
,
112
,
114
,
117
};
/* (non-Javadoc)
* @see org.cloudbus.cloudsim.power.models.PowerModelSpecPower#getPowerData(int)
*/
@Override
protected
double
getPowerData
(
int
index
)
{
return
power
[
index
];
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/models/PowerModelSpecPowerHpProLiantMl110G5Xeon3075.java
0 → 100644
View file @
f0662234
package
org
.
cloudbus
.
cloudsim
.
power
.
models
;
/**
* The power model of an HP ProLiant ML110 G5 (1 x [Xeon 3075 2660 MHz, 2 cores], 4GB).
* http://www.spec.org/power_ssj2008/results/res2011q1/power_ssj2008-20110124-00339.html
*/
public
class
PowerModelSpecPowerHpProLiantMl110G5Xeon3075
extends
PowerModelSpecPower
{
/** The power. */
private
final
double
[]
power
=
{
93.7
,
97
,
101
,
105
,
110
,
116
,
121
,
125
,
129
,
133
,
135
};
/* (non-Javadoc)
* @see org.cloudbus.cloudsim.power.models.PowerModelSpecPower#getPowerData(int)
*/
@Override
protected
double
getPowerData
(
int
index
)
{
return
power
[
index
];
}
}
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/models/PowerModelSpecPowerIbmX3250XeonX3470.java
0 → 100644
View file @
f0662234
package
org
.
cloudbus
.
cloudsim
.
power
.
models
;
/**
* The power model of an IBM server x3250 (1 x [Xeon X3470 2933 MHz, 4 cores], 8GB).
* http://www.spec.org/power_ssj2008/results/res2009q4/power_ssj2008-20091104-00213.html
*/
public
class
PowerModelSpecPowerIbmX3250XeonX3470
extends
PowerModelSpecPower
{
/** The power. */
private
final
double
[]
power
=
{
41.6
,
46.7
,
52.3
,
57.9
,
65.4
,
73
,
80.7
,
89.5
,
99.6
,
105
,
113
};
/* (non-Javadoc)
* @see org.cloudbus.cloudsim.power.models.PowerModelSpecPower#getPowerData(int)
*/
@Override
protected
double
getPowerData
(
int
index
)
{
return
power
[
index
];
}
}
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