summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-resources
AgeCommit message (Collapse)Author
2021-10-03refactor(simulator): Migrate to flow-based simulationFabian Mastenbroek
This change renames the `opendc-simulator-resources` module into the `opendc-simulator-flow` module to indicate that the core simulation model of OpenDC is based around modelling and simulating flows. Previously, the distinction between resource consumer and provider, and input and output caused some confusion. By switching to a flow-based model, this distinction is now clear (as in, the water flows from source to consumer/sink).
2021-10-03refactor(simulator): Remove transform from SimResourceForwarderFabian Mastenbroek
This change removes the ability to transform the duration of a pull from the SimResourceForwarder class. This ability is not used anymore, since pushes are now done using a method instead of a command.
2021-10-03refactor(simulator): Merge distributor and aggregator into switchFabian Mastenbroek
This change removes the distributor and aggregator interfaces in favour of a single switch interface. Since the switch interface is as powerful as both the distributor and aggregator, we don't need the latter two.
2021-10-03refactor(simulator): Remove SimResourceFlow interfaceFabian Mastenbroek
2021-10-03refactor(simulator): Do not expose SimResourceStateFabian Mastenbroek
This change hides the SimResourceState from public API since it is not actively used outside of the `SimResourceContextImpl` class.
2021-10-03refactor(simulator): Remove onUpdate callbackFabian Mastenbroek
This change removes the `onUpdate` callback from the `SimResourceProviderLogic` interface. Instead, users should now update counters using either `onConsume` or `onConverge`.
2021-10-03refactor(simulator): Lazily push changes to resource contextFabian Mastenbroek
This change updates the SimResourceContextImpl to lazily push changes to the resource context instead of applying them directly. The change is picked up after the resource is updated again.
2021-10-03refactor(simulator): Invoke consumer callback on every invalidationFabian Mastenbroek
This change updates the simulator implementation to always invoke the `SimResourceConsumer.onNext` callback when the resource context is invalidated. This allows users to update the resource counter or do some other work if the context has changed.
2021-10-03refactor(simulator): Simplify max-min aggregator implementationFabian Mastenbroek
This change simplifies the implementation of the SimResourceAggregatorMaxMin class by utilizing the new push method. This approach should offer better performance than the previous version, since we can directly push changes to the source.
2021-10-03perf(simulator): Reduce memory allocations in SimResourceInterpreterFabian Mastenbroek
This change removes unnecessary allocations in the SimResourceInterpreter caused by the way timers were allocated for the resource context.
2021-10-03refactor(simulator): Add support for pushing flow from contextFabian Mastenbroek
This change adds a new method to `SimResourceContext` called `push` which allows users to change the requested flow rate directly without having to interrupt the consumer.
2021-10-03refactor(simulator): Combine work and deadline to durationFabian Mastenbroek
This change removes the work and deadline properties from the SimResourceCommand.Consume class and introduces a new property duration. This property is now used in conjunction with the limit to compute the amount of work processed by a resource provider. Previously, we used both work and deadline to compute the duration and the amount of remaining work at the end of a consumption. However, with this change, we ensure that a resource consumption always runs at the same speed once establishing, drastically simplifying the computation for the amount of work processed during the consumption.
2021-10-03perf(simulator): Use direct field access for perf-sensitive codeFabian Mastenbroek
This change updates the SimResourceDistributorMaxMin implementation to use direct field accesses in the perf-sensitive code.
2021-10-03test(simulator): Use longer traces for benchmarksFabian Mastenbroek
This change updates the JMH benchmarks to use longer traces in order to measure the overhead of running the flow simulation as opposed to setting up the benchmark.
2021-10-03build: Migrate from kotlinx-benchmark to jmh-gradleFabian Mastenbroek
This change updates the project to use jmh-gradle for benchmarking as opposed to kotlinx-benchmark. Both plugins use JMH under the hood, but jmh-gradle offers more options for profiling and seems to be beter maintained.
2021-08-24feat(simulator): Add support for reporting interfered workFabian Mastenbroek
This change adds support to the simulator for reporting the work lost due to performance interference.
2021-08-24fix(simulator): Support unaligned trace fragmentsFabian Mastenbroek
2021-08-24fix(simulator): Record overcommit only after deadlineFabian Mastenbroek
This change fixes an issue with the simulator where it would record overcomitted work if the output was updated before the deadline was reached.
2021-08-22refactor(compute): Update FilterScheduler to follow OpenStack's NovaFabian Mastenbroek
This change updates the FilterScheduler implementation to follow more closely the scheduler implementation in OpenStack's Nova. We now normalize the weights, support many of the filters and weights in OpenStack and support overcommitting resources.
2021-08-22perf(simulator): Prevent counter update without workFabian Mastenbroek
This change implements a performance improvement by preventing updates on the resource counters in case no work was performed in the last cycle.
2021-08-13build: Update Kotlin dependenciesFabian Mastenbroek
This change updates the Kotlin dependencies used by OpenDC to their latest version.
2021-06-24simulator: Add interface for resource interferenceFabian Mastenbroek
This change introduces an interface for modelling performance variability due to resource interference in systems where resources are shared across multiple consumers.
2021-06-21simulator: Reduce allocations in interpreter hot pathFabian Mastenbroek
This change updates the resources module to reduce the number of object allocations in the interpreter's hot path. This in turn should reduce the GC pressure.
2021-06-21simulator: Optimize flag management of resource contextFabian Mastenbroek
This change optimizes the internal flag management used in the SimResourceContextImpl to use bitwise flags instead of enums. This approach simplifies the implementation immensely and reduces the number of branches.
2021-06-21simulator: Remove concept of resource lifecycleFabian Mastenbroek
This change removes the AutoCloseable interface from the SimResourceProvider and removes the concept of a resource lifecycle. Instead, resource providers are now either active (running a resource consumer) or in-active (being idle), which simplifies implementation.
2021-06-21simulator: Pool update allocations in interpreterFabian Mastenbroek
This change updates the SimResourceInterpreter implementation to pool the allocations of the Update objects. This reduces the amount of allocations necessary in the hot path of the simulator.
2021-06-21simulator: Optimize access to remainingWork propertyFabian Mastenbroek
This change updates the SimResourceContextImpl to optimize the access to the remainingWork property, which is required by many calls in the hot path.
2021-06-11simulator: Integrate power subsystem with compute subsystemFabian Mastenbroek
This change integrates the power subsystem of the simulator with the compute subsystem by exposing a new field on a SimBareMetalMachine, psu, which provides access to the machine's PSU, which in turn can be connected to a SimPowerOutlet.
2021-06-02simulator: Add uniform interface for resource metricsFabian Mastenbroek
This change adds a new interface to the resources library for accessing metrics of resources such as work, demand and overcommitted work. With this change, we do not need an implementation specific listener interface in SimResourceSwitchMaxMin anymore. Another benefit of this approach is that updates will be scheduled more efficiently and progress will only be reported once the system has reached a steady-state for that timestamp.
2021-06-01simulator: Centralize resource logic in SimResourceInterpreterFabian Mastenbroek
This change introduces the SimResourceInterpreter which centralizes the logic for scheduling and interpreting the communication between resource consumer and provider. This approach offers better performance due to avoiding invalidating the state of the resource context when not necessary. Benchmarks show in the best case a 5x performance improvement and at worst a 2x improvement.
2021-05-18chore: Address deprecations due to Kotlin 1.5Fabian Mastenbroek
This change addresses the deprecations that were caused by the migration to Kotlin 1.5.
2021-05-07build: Use Gradle version catalogFabian Mastenbroek
This change adds support for the Gradle version catalog feature in our build configuration. This allows us to have a single file, gradle/libs.versions.toml, which contains all the dependency versions used in this project.
2021-05-06build: Use type-safe project accessorsFabian Mastenbroek
This change updates the build scripts to use type-safe project accessors when specifying build dependencies between modules.
2021-05-03simulator: Introduce SimResourceSchedulerFabian Mastenbroek
This change introduces the SimResourceScheduler interface, which is a generic interface for scheduling the coordination and synchronization between resource providers and resource consumers. This interface replaces the need for users to manually specify the clock and coroutine context per resource provider.
2021-05-03simulator: Add generic approach for reporting resource eventsFabian Mastenbroek
This change introduces a generic approach for reporting resource events to resource consumers. This way we reduce the boilerplate of the SimResourceConsumer interface.
2021-05-03simulator: Simplify scheduling logic of resource aggregatorFabian Mastenbroek
This change simplifies the scheduling logic of the resource aggregator. Previously, after each scheduling cycle, each aggregated input was interrupted. With the new approach, the scheduler can decide which ones of the inputs to send a new command to.
2021-04-25build: Migrate to flat project structureFabian Mastenbroek
This change updates the project structure to become flattened. Previously, the simulator, frontend and API each lived into their own directory. With this change, all modules of the project live in the top-level directory of the repository. This should improve discoverability of modules of the project.