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;
...
@@ -14,14 +14,14 @@ import org.cloudbus.cloudsim.VmAllocationPolicy;
import
org.cloudbus.cloudsim.core.CloudSim
;
import
org.cloudbus.cloudsim.core.CloudSim
;
import
org.cloudbus.cloudsim.power.PowerDatacenter
;
import
org.cloudbus.cloudsim.power.PowerDatacenter
;
import
org.cloudbus.cloudsim.power.PowerHost
;
import
org.cloudbus.cloudsim.power.PowerHost
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicySimple
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationAbstract
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationAbstract
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationInterQuartileRange
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationInterQuartileRange
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegression
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegression
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegressionRobust
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationLocalRegressionRobust
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation2
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationMedianAbsoluteDeviation2
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationThresholds
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicyMigrationStaticThreshold
;
import
org.cloudbus.cloudsim.power.PowerVmAllocationPolicySimple
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicy
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicy
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMaximumCorrelation
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMaximumCorrelation
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMinimumMigrationTime
;
import
org.cloudbus.cloudsim.power.PowerVmSelectionPolicyMinimumMigrationTime
;
...
@@ -51,8 +51,11 @@ public abstract class RunnerAbstract {
...
@@ -51,8 +51,11 @@ public abstract class RunnerAbstract {
/**
/**
* Run.
* Run.
*
*
* @param enableOutput the enable output
* @param outputToFile the output to file
* @param inputFolder the input folder
* @param inputFolder the input folder
* @param outputFolder the output folder
* @param outputFolder the output folder
* @param workload the workload
* @param vmAllocationPolicy the vm allocation policy
* @param vmAllocationPolicy the vm allocation policy
* @param vmSelectionPolicy the vm selection policy
* @param vmSelectionPolicy the vm selection policy
* @param parameter the parameter
* @param parameter the parameter
...
@@ -87,6 +90,19 @@ public abstract class RunnerAbstract {
...
@@ -87,6 +90,19 @@ public abstract class RunnerAbstract {
getVmAllocationPolicy
(
vmAllocationPolicy
,
vmSelectionPolicy
,
parameter
));
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
(
protected
void
initLogOutput
(
boolean
enableOutput
,
boolean
enableOutput
,
boolean
outputToFile
,
boolean
outputToFile
,
...
@@ -123,7 +139,7 @@ public abstract class RunnerAbstract {
...
@@ -123,7 +139,7 @@ public abstract class RunnerAbstract {
protected
abstract
void
init
(
String
inputFolder
);
protected
abstract
void
init
(
String
inputFolder
);
/**
/**
*
Ru
n.
*
Starts the simulatio
n.
*
*
* @param experimentName the experiment name
* @param experimentName the experiment name
* @param outputFolder the output folder
* @param outputFolder the output folder
...
@@ -162,7 +178,8 @@ public abstract class RunnerAbstract {
...
@@ -162,7 +178,8 @@ public abstract class RunnerAbstract {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
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
);
Log
.
printLine
(
"Finished "
+
experimentName
);
...
@@ -210,7 +227,7 @@ public abstract class RunnerAbstract {
...
@@ -210,7 +227,7 @@ public abstract class RunnerAbstract {
parameter
=
Double
.
valueOf
(
parameterName
);
parameter
=
Double
.
valueOf
(
parameterName
);
}
}
if
(
vmAllocationPolicyName
.
equals
(
"iqr"
))
{
if
(
vmAllocationPolicyName
.
equals
(
"iqr"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
hostList
,
vmSelectionPolicy
,
vmSelectionPolicy
,
0.7
);
0.7
);
...
@@ -220,7 +237,7 @@ public abstract class RunnerAbstract {
...
@@ -220,7 +237,7 @@ public abstract class RunnerAbstract {
parameter
,
parameter
,
fallbackVmSelectionPolicy
);
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"mad"
))
{
}
else
if
(
vmAllocationPolicyName
.
equals
(
"mad"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
hostList
,
vmSelectionPolicy
,
vmSelectionPolicy
,
0.7
);
0.7
);
...
@@ -230,7 +247,7 @@ public abstract class RunnerAbstract {
...
@@ -230,7 +247,7 @@ public abstract class RunnerAbstract {
parameter
,
parameter
,
fallbackVmSelectionPolicy
);
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"mad2"
))
{
}
else
if
(
vmAllocationPolicyName
.
equals
(
"mad2"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
hostList
,
vmSelectionPolicy
,
vmSelectionPolicy
,
0.7
);
0.7
);
...
@@ -240,7 +257,7 @@ public abstract class RunnerAbstract {
...
@@ -240,7 +257,7 @@ public abstract class RunnerAbstract {
parameter
,
parameter
,
fallbackVmSelectionPolicy
);
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"lr"
))
{
}
else
if
(
vmAllocationPolicyName
.
equals
(
"lr"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
hostList
,
vmSelectionPolicy
,
vmSelectionPolicy
,
0.7
);
0.7
);
...
@@ -251,7 +268,7 @@ public abstract class RunnerAbstract {
...
@@ -251,7 +268,7 @@ public abstract class RunnerAbstract {
Constants
.
SCHEDULING_INTERVAL
,
Constants
.
SCHEDULING_INTERVAL
,
fallbackVmSelectionPolicy
);
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"lrr"
))
{
}
else
if
(
vmAllocationPolicyName
.
equals
(
"lrr"
))
{
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
PowerVmAllocationPolicyMigrationAbstract
fallbackVmSelectionPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
hostList
,
vmSelectionPolicy
,
vmSelectionPolicy
,
0.7
);
0.7
);
...
@@ -262,7 +279,7 @@ public abstract class RunnerAbstract {
...
@@ -262,7 +279,7 @@ public abstract class RunnerAbstract {
Constants
.
SCHEDULING_INTERVAL
,
Constants
.
SCHEDULING_INTERVAL
,
fallbackVmSelectionPolicy
);
fallbackVmSelectionPolicy
);
}
else
if
(
vmAllocationPolicyName
.
equals
(
"thr"
))
{
}
else
if
(
vmAllocationPolicyName
.
equals
(
"thr"
))
{
vmAllocationPolicy
=
new
PowerVmAllocationPolicyMigration
Thresholds
(
vmAllocationPolicy
=
new
PowerVmAllocationPolicyMigration
StaticThreshold
(
hostList
,
hostList
,
vmSelectionPolicy
,
vmSelectionPolicy
,
parameter
);
parameter
);
...
@@ -299,10 +316,20 @@ public abstract class RunnerAbstract {
...
@@ -299,10 +316,20 @@ public abstract class RunnerAbstract {
return
vmSelectionPolicy
;
return
vmSelectionPolicy
;
}
}
/**
* Sets the enable output.
*
* @param enableOutput the new enable output
*/
public
void
setEnableOutput
(
boolean
enableOutput
)
{
public
void
setEnableOutput
(
boolean
enableOutput
)
{
RunnerAbstract
.
enableOutput
=
enableOutput
;
RunnerAbstract
.
enableOutput
=
enableOutput
;
}
}
/**
* Checks if is enable output.
*
* @return true, if is enable output
*/
public
boolean
isEnableOutput
()
{
public
boolean
isEnableOutput
()
{
return
enableOutput
;
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 {
...
@@ -75,7 +75,8 @@ public class NonPowerAware {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
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
);
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;
...
@@ -7,21 +7,21 @@ import org.cloudbus.cloudsim.Host;
import
org.cloudbus.cloudsim.Vm
;
import
org.cloudbus.cloudsim.Vm
;
/**
/**
* This a simple class representing a
DVFS VM allocation policy. The actual application of DVFS
* This a simple class representing a
simple VM allocation policy that does not perform any
*
(adjustment of the host's power consumption) happens in the PowerDatacenter class
.
*
optimization of the VM allocation
.
*
*
* @author Anton Beloglazov
* @author Anton Beloglazov
* @since Jan 5, 2012
* @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
* @param list the list
*/
*/
public
PowerVmAllocationPolicy
Dvfs
(
List
<?
extends
Host
>
list
)
{
public
PowerVmAllocationPolicy
Simple
(
List
<?
extends
Host
>
list
)
{
super
(
list
);
super
(
list
);
}
}
...
@@ -32,7 +32,7 @@ public class PowerVmAllocationPolicyDvfs extends PowerVmAllocationPolicyAbstract
...
@@ -32,7 +32,7 @@ public class PowerVmAllocationPolicyDvfs extends PowerVmAllocationPolicyAbstract
*/
*/
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
optimizeAllocation
(
List
<?
extends
Vm
>
vmList
)
{
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
;
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