summaryrefslogtreecommitdiff
path: root/opendc/opendc-experiments-sc20
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-03-31 22:24:13 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-03-31 22:24:31 +0200
commit548804adc2b675042e59b9e2f6bfba7b0428024c (patch)
tree329da79246277f29b38c8eb486697f1271f6a06a /opendc/opendc-experiments-sc20
parent5cfd1421fcc3bdad95285b9d04d17a6b26fbab0e (diff)
feat: Add reversed policies and random allocation policy
Diffstat (limited to 'opendc/opendc-experiments-sc20')
-rw-r--r--opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt b/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt
index 0c5bf461..cc403e6e 100644
--- a/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt
+++ b/opendc/opendc-experiments-sc20/src/main/kotlin/com/atlarge/opendc/experiments/sc20/TestExperiment.kt
@@ -40,6 +40,7 @@ import com.atlarge.opendc.compute.virt.service.allocation.AvailableCoreMemoryAll
import com.atlarge.opendc.compute.virt.service.allocation.AvailableMemoryAllocationPolicy
import com.atlarge.opendc.compute.virt.service.allocation.NumberOfActiveServersAllocationPolicy
import com.atlarge.opendc.compute.virt.service.allocation.ProvisionedCoresAllocationPolicy
+import com.atlarge.opendc.compute.virt.service.allocation.RandomAllocationPolicy
import com.atlarge.opendc.core.failure.CorrelatedFaultInjector
import com.atlarge.opendc.core.failure.FailureDomain
import com.atlarge.opendc.core.failure.FaultInjector
@@ -76,7 +77,7 @@ class ExperimentParameters(parser: ArgParser) {
}
.default { emptyList() }
val failures by parser.flagging("-x", "--failures", help = "enable (correlated) machine failures")
- val allocationPolicy by parser.storing("name of VM allocation policy to use").default("mem")
+ val allocationPolicy by parser.storing("name of VM allocation policy to use").default("core-mem")
fun getSelectedVmList(): List<String> {
return if (selectedVms.isEmpty()) {
@@ -122,9 +123,14 @@ fun main(args: Array<String>) {
val allocationPolicies = mapOf(
"mem" to AvailableMemoryAllocationPolicy(),
+ "mem-inv" to AvailableMemoryAllocationPolicy(true),
"core-mem" to AvailableCoreMemoryAllocationPolicy(),
+ "core-mem-inv" to AvailableCoreMemoryAllocationPolicy(true),
"active-servers" to NumberOfActiveServersAllocationPolicy(),
- "provisioned-cores" to ProvisionedCoresAllocationPolicy()
+ "active-servers-inv" to NumberOfActiveServersAllocationPolicy(true),
+ "provisioned-cores" to ProvisionedCoresAllocationPolicy(),
+ "provisioned-cores-inv" to ProvisionedCoresAllocationPolicy(true),
+ "random" to RandomAllocationPolicy()
)
if (allocationPolicy !in allocationPolicies) {
@@ -191,7 +197,6 @@ fun main(args: Array<String>) {
event.numberOfDeployedImages,
event.hostServer
)
- else -> println(event)
}
}
.launchIn(this)