summaryrefslogtreecommitdiff
path: root/opendc-simulator
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-08-22 14:07:59 +0200
committerGitHub <noreply@github.com>2021-08-22 14:07:59 +0200
commitf03129779a1ec60e8689ad9c7fd5ad488c66f54c (patch)
tree34dfc78f84c5f463fda7f97957cc403411b4f166 /opendc-simulator
parentf84dc9f8b8b4eaa7621f9ee4fc83ef38a85c431b (diff)
parentb8f64c1d3df2c990df8941cd036222fab2def9fa (diff)
merge: Follow OpenStack's Nova scheduler implementation more closely
This pull request updates the FilterScheduler in OpenDC Compute to follow OpenStack's Nova scheduler implementation more closely. * Normalize weights returned by weighers * Implement RAM and vCPU overcomitting * Implement VCPU filter **Breaking API Changes** * `MemoryFilter` and `CoreMemoryFilter` renamed to `RamFilter` and `CoreRamFilter` * `ComputeCapabilityFilter` replaced by `VCpuFilter` and `RamFilter`
Diffstat (limited to 'opendc-simulator')
-rw-r--r--opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt b/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt
index c1b1450e..860c50ee 100644
--- a/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt
+++ b/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt
@@ -88,6 +88,10 @@ public abstract class SimAbstractResourceProvider(
* Update the counters of the resource provider.
*/
protected fun updateCounters(ctx: SimResourceContext, work: Double) {
+ if (work <= 0.0) {
+ return
+ }
+
val counters = _counters
val remainingWork = ctx.remainingWork
counters.demand += work