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
8297be13
Commit
8297be13
authored
Jan 05, 2012
by
Anton Beloglazov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed PowerVmAllocationPolicyDvfs -> PowerVmAllocationPolicySimple
parent
06322462
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
17 deletions
+45
-17
RunnerAbstract.java
.../org/cloudbus/cloudsim/examples/power/RunnerAbstract.java
+37
-10
NonPowerAware.java
...loudbus/cloudsim/examples/power/random/NonPowerAware.java
+2
-1
PowerVmAllocationPolicySimple.java
...loudbus/cloudsim/power/PowerVmAllocationPolicySimple.java
+6
-6
No files found.
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/power/RunnerAbstract.java
View file @
8297be13
...
...
@@ -14,14 +14,14 @@ import org.cloudbus.cloudsim.VmAllocationPolicy;
import
org.cloudbus.cloudsim.core.CloudSim
;
import
org.cloudbus.cloudsim.power.PowerDatacenter
;
import
org.cloudbus.cloudsim.power.PowerHost
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicySimple
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationAbstract
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationInterQuartileRange
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegression
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegressionRobust
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation2
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicySimple
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationStaticThreshold
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicy
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMaximumCorrelation
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMinimumMigrationTime
;
...
...
@@ -51,8 +51,11 @@ public abstract class RunnerAbstract {
/**
* Run.
*
* @param enableOutput the enable output
* @param outputToFile the output to file
* @param inputFolder the input folder
* @param outputFolder the output folder
* @param workload the workload
* @param vmAllocationPolicy the vm allocation policy
* @param vmSelectionPolicy the vm selection policy
* @param parameter the parameter
...
...
@@ -87,6 +90,19 @@ public abstract class RunnerAbstract {
getVmAllocationPolicy
(
vmAllocationPolicy
,
vmSelectionPolicy
,
parameter
));
}
/**
* Inits the log output.
*
* @param enableOutput the enable output
* @param outputToFile the output to file
* @param outputFolder the output folder
* @param workload the workload
* @param vmAllocationPolicy the vm allocation policy
* @param vmSelectionPolicy the vm selection policy
* @param parameter the parameter
* @throws IOException Signals that an I/O exception has occurred.
* @throws FileNotFoundException the file not found exception
*/
protected
void
initLogOutput
(
boolean
enableOutput
,
boolean
outputToFile
,
...
...
@@ -123,7 +139,7 @@ public abstract class RunnerAbstract {
protected
abstract
void
init
(
String
inputFolder
);
/**
*
Ru
n.
*
Starts the simulatio
n.
*
* @param experimentName the experiment name
* @param outputFolder the output folder
...
...
@@ -162,7 +178,8 @@ public abstract class RunnerAbstract {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
printLine
(
"Unwanted errors happen"
);
Log
.
printLine
(
"The simulation has been terminated due to an unexpected error"
);
System
.
exit
(
0
);
}
Log
.
printLine
(
"Finished "
+
experimentName
);
...
...
@@ -210,7 +227,7 @@ public abstract class RunnerAbstract {
parameter
=
Double
.
valueOf
(
parameterName
);
}
if
(
vmAllocationPolicyName
.
equals
(
"iqr"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
vmSelectionPolicy
,
0.7
);
...
...
@@ -220,7 +237,7 @@ public abstract class RunnerAbstract {
parameter
,
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"mad"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
vmSelectionPolicy
,
0.7
);
...
...
@@ -230,7 +247,7 @@ public abstract class RunnerAbstract {
parameter
,
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"mad2"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
vmSelectionPolicy
,
0.7
);
...
...
@@ -240,7 +257,7 @@ public abstract class RunnerAbstract {
parameter
,
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"lr"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
vmSelectionPolicy
,
0.7
);
...
...
@@ -251,7 +268,7 @@ public abstract class RunnerAbstract {
Constants
.
SCHEDULING_INTERVAL
,
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"lrr"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
vmSelectionPolicy
,
0.7
);
...
...
@@ -262,7 +279,7 @@ public abstract class RunnerAbstract {
Constants
.
SCHEDULING_INTERVAL
,
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"thr"
))
{
vmAllocationPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
vmAllocationPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
vmSelectionPolicy
,
parameter
);
...
...
@@ -299,10 +316,20 @@ public abstract class RunnerAbstract {
return
vmSelectionPolicy
;
}
/**
* Sets the enable output.
*
* @param enableOutput the new enable output
*/
public
void
setEnableOutput
(
boolean
enableOutput
)
{
RunnerAbstract
.
enableOutput
=
enableOutput
;
}
/**
* Checks if is enable output.
*
* @return true, if is enable output
*/
public
boolean
isEnableOutput
()
{
return
enableOutput
;
}
...
...
modules/cloudsim-examples/src/main/java/org/cloudbus/cloudsim/examples/power/random/NonPowerAware.java
View file @
8297be13
...
...
@@ -75,7 +75,8 @@ public class NonPowerAware {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
Log
.
printLine
(
"Unwanted errors happen"
);
Log
.
printLine
(
"The simulation has been terminated due to an unexpected error"
);
System
.
exit
(
0
);
}
Log
.
printLine
(
"Finished "
+
experimentName
);
...
...
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/PowerVmAllocationPolicy
Dvfs
.java
→
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/PowerVmAllocationPolicy
Simple
.java
View file @
8297be13
...
...
@@ -7,21 +7,21 @@ import org.cloudbus.cloudsim.Host;
import
org.cloudbus.cloudsim.Vm
;
/**
* This a simple class representing a
DVFS VM allocation policy. The actual application of DVFS
*
(adjustment of the host's power consumption) happens in the PowerDatacenter class
.
* This a simple class representing a
simple VM allocation policy that does not perform any
*
optimization of the VM allocation
.
*
* @author Anton Beloglazov
* @since Jan 5, 2012
*
*/
public
class
PowerVmAllocationPolicy
Dvfs
extends
PowerVmAllocationPolicyAbstract
{
public
class
PowerVmAllocationPolicy
Simple
extends
PowerVmAllocationPolicyAbstract
{
/**
* Instantiates a new power vm allocation policy
dvfs
.
* Instantiates a new power vm allocation policy
simple
.
*
* @param list the list
*/
public
PowerVmAllocationPolicy
Dvfs
(
List
<?
extends
Host
>
list
)
{
public
PowerVmAllocationPolicy
Simple
(
List
<?
extends
Host
>
list
)
{
super
(
list
);
}
...
...
@@ -32,7 +32,7 @@ public class PowerVmAllocationPolicyDvfs extends PowerVmAllocationPolicyAbstract
*/
@Override
public
List
<
Map
<
String
,
Object
>>
optimizeAllocation
(
List
<?
extends
Vm
>
vmList
)
{
// This policy does
n'
t optimize the VM allocation
// This policy does
no
t optimize the VM allocation
return
null
;
}
...
...
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