diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-06-16 11:08:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-16 11:08:14 +0200 |
| commit | 8eab5895dcf21b4a3f585c62db14c9a049c81d98 (patch) | |
| tree | b2b698d85f7397ef67485d52128a9390f40f7252 /opendc-experiments/opendc-experiments-tf20/src/main | |
| parent | d146814bbbb86bfcb19ccb94250424703e9179e5 (diff) | |
| parent | 282f199e6f16350123a915b06faff62ca82be91b (diff) | |
merge: Fix distributed strategy for TensorFlow experiment (#89)
This pull request fixes an issue where the distributed strategies for the
TensorFlow experiments did not work correctly.
## Implementation Notes :hammer_and_pick:
* Limit growth rate for trace construction
* Derive device statistics directly from SimMachine
* Always recompute power usage when a `SImBareMetalMachine` converges
* Add a test case for `MirroredStrategy`
Diffstat (limited to 'opendc-experiments/opendc-experiments-tf20/src/main')
| -rw-r--r-- | opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt index 90350142..2c79da02 100644 --- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt +++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt @@ -68,13 +68,6 @@ public class SimTFDevice( ) /** - * Metrics collected by the device. - */ - private var _resourceUsage = 0.0 - private var _powerUsage = 0.0 - private var _energyUsage = 0.0 - - /** * The workload that will be run by the device. */ private val workload = object : SimWorkload, FlowSource { @@ -121,7 +114,7 @@ public class SimTFDevice( ctx = conn capacity = conn.capacity lastPull = now - conn.shouldSourceConverge = true + conn.shouldSourceConverge = false } override fun onPull(conn: FlowConnection, now: Long): Long { @@ -156,12 +149,6 @@ public class SimTFDevice( Long.MAX_VALUE } } - - override fun onConverge(conn: FlowConnection, now: Long) { - _resourceUsage = conn.rate - _powerUsage = machine.powerUsage - _energyUsage = machine.energyUsage - } } init { @@ -183,7 +170,8 @@ public class SimTFDevice( } override fun getDeviceStats(): TFDeviceStats { - return TFDeviceStats(_resourceUsage, _powerUsage, _energyUsage) + val resourceUsage = machine.cpus.sumOf { it.rate } + return TFDeviceStats(resourceUsage, machine.powerUsage, machine.energyUsage) } override fun close() { |
