summaryrefslogtreecommitdiff
path: root/opendc-simulator
AgeCommit message (Collapse)Author
2022-11-13test(sim/power): Remove use of Spy object from TestInletFabian Mastenbroek
This change removes the use of a Spy object from the TestInlet class. Since the Spy is not actually used in our tests, we remove it due to the high initialization cost.
2022-11-13refactor: Replace use of CoroutineContext by DispatcherFabian Mastenbroek
This change replaces the use of `CoroutineContext` for passing the `SimulationDispatcher` across the different modules of OpenDC by the lightweight `Dispatcher` interface of the OpenDC common module.
2022-11-13refactor(sim/core): Re-implement SimulationScheduler as DispatcherFabian Mastenbroek
This change updates the `SimulationScheduler` class to implement the `Dispatcher` interface from the OpenDC Common module, so that OpenDC modules only need to depend on the common module for dispatching future task (possibly in simulation).
2022-11-13refactor: Use InstantSource as time sourceFabian Mastenbroek
This change updates the modules of OpenDC to always accept the `InstantSource` interface as source of time. Previously we used `java.time.Clock`, but this class is bound to a time zone which does not make sense for our use-cases. Since `java.time.Clock` implements `java.time.InstantSource`, it can be used in places that require an `InstantSource` as parameter. Conversion from `InstantSource` to `Clock` is also possible by invoking `InstantSource#withZone`.
2022-10-31feat(sim/compute): Add support for snapshotting workloadsFabian Mastenbroek
This change updates the interface of `SimWorkload` to support snapshotting workloads. We introduce a new method `snapshot()` to this interface which returns a new `SimWorkload` that can be started at a later point in time and on another `SimMachine`, which continues progress from the moment the workload was snapshotted.
2022-10-31refactor(sim/compute): Report exceptions in onStop as suppressedFabian Mastenbroek
This change updates the implementation of `SimMachineContext` to report exceptions thrown in `onStop` as suppressed exceptions if an exception caused the workload to stop.
2022-10-31feat(sim/flow): Support synchronous update of FlowStageFabian Mastenbroek
This change adds a new method to `FlowStage` called `sync()` which enables users to synchronously update the stage at the current timestamp. This functionality is neccessary to support snapshotting since we need to synchronize the state of the `FlowStage` before creating a snapshot of the workload.
2022-10-28feat(sim/compute): Add support for chaining workloadsFabian Mastenbroek
This change adds a new static method `chain` to `SimWorkloads` to chain multiple workloads sequentially.
2022-10-28feat(sim/compute): Add support for resetting machine contextFabian Mastenbroek
This change updates the interface of `SimMachineContext` to allow workloads to reset all resources provided by the machine to the workload. This allows us to implement a `SimWorkload` that can compose multiple workloads.
2022-10-28refactor(sim/compute): Provide workload constructors in SimWorkloadsFabian Mastenbroek
This change introduces a new class SimWorkloads which provides construction methods for the standard workloads available in OpenDC.
2022-10-28feat(sim/compute): Add completion parameter to startWorkloadFabian Mastenbroek
This change updates the interface of `SimMachine#startWorkload` to introduce a parameter `completion` that is invoked when the workload completes either succesfully or due to failure. This functionality has often been implemented by wrapping a `SimWorkload` and catching its exceptions. However, since this functionality is used in all usages of `SimMachine#startWorkload` we instead embed it into `SimMachine` itself.
2022-10-21refactor(sim/flow): Remove old flow simulatorFabian Mastenbroek
This change removes the old version of the flow simulator from the OpenDC repository. The old version has been replaced by the new flow2 framework which is able to simulate flows more efficiently.
2022-10-21perf(sim/compute): Optimize workload implementation of SimTraceFabian Mastenbroek
This change updates the workload implementation of SimTrace by introducing multiple implementations of the FlowStageLogic interface, which is selected dynamically when the workload starts. This change helps eliminate the unecessary division (and memory fetch) when running a workload with just a single CPU.
2022-10-21refactor(sim/compute): Re-implement using flow2Fabian Mastenbroek
This change re-implements the OpenDC compute simulator framework using the new flow2 framework for modelling multi-edge flow networks. The re-implementation is written in Java and focusses on performance and clean API surface.
2022-10-21refactor(sim/power): Re-implement power sim using flow2Fabian Mastenbroek
This change updates the `opendc-simulator-power` module to use the new flow simulation framework in OpenDC (named flow2 for now).
2022-10-21refactor(sim/net): Re-implement network sim using flow2Fabian Mastenbroek
2022-10-21feat(sim/flow): Expose metrics on FlowMultiplexerFabian Mastenbroek
2022-10-21feat(sim/flow): Add forwarding flow multiplexerFabian Mastenbroek
This change implements a new `FlowMultiplexer` that forwards the inputs directly to one of the pre-allocated outputs.
2022-10-21feat(sim/flow): Support flow transformationsFabian Mastenbroek
This change adds a new component, FlowTransform, which is able to transform the flow from one component to another, based on some inversible transformation. Such as component is useful when converting between different units of flow between different components.
2022-10-21perf(sim/flow): Add support for multi-flow stagesFabian Mastenbroek
This change adds support for creating nodes in a flow graph that support multiple inputs and outputs directly, instead of our current approach where we need to re-implement the `FlowConsumerContext` interface in order to support multiple inputs or outputs.
2022-10-06build: Switch to Spotless for formattingFabian Mastenbroek
This change updates the build configuration to use Spotless for code formating of both Kotlin and Java.
2022-10-06style: Eliminate use of wildcard importsFabian Mastenbroek
This change updates the repository to remove the use of wildcard imports everywhere. Wildcard imports are not allowed by default by Ktlint as well as Google's Java style guide.
2022-10-05refactor(sim/core): Rename runBlockingSimulation to runSimulationFabian Mastenbroek
This change renames the method `runBlockingSimulation` to `runSimulation` to put more emphasis on the simulation part of the method. The blocking part is not that important, but this behavior is still described in the method documentation.
2022-10-05refactor(sim/core): Use SimulationScheduler in coroutine dispatcherFabian Mastenbroek
This change updates the implementation of `SimulationDispatcher` to use a (possibly user-provided) `SimulationScheduler` for managing the execution of the simulation and future tasks.
2022-10-05feat(sim/core): Add Java-based simulator coreFabian Mastenbroek
This change introduces a new class, `SimulationScheduler`, which provides the basis for simulations in OpenDC by allowing components to schedule future tasks using delay-skipping queue and a virtual clock. This new class is written in Java to remove any dependency on the Kotlin and kotlinx-coroutines runtime when not necessary.
2022-09-22refactor(sim/compute): Simplify SimHypervisor classFabian Mastenbroek
This change simplifies the SimHypervisor class into a single implementation. Previously, it was implemented as an abstract class with multiple implementations for each multiplexer type. We now pass the multiplexer type as parameter to the SimHypervisor constructor.
2022-09-22refactor(sim/compute): Make interference domain independent of profileFabian Mastenbroek
This change updates the virtual machine performance interference model so that the interference domain can be constructed independently of the interference profile. As a consequence, the construction of the topology now does not depend anymore on the interference profile.
2022-09-22refactor(compute): Simplify constructor of SimHostFabian Mastenbroek
This change updates the constructor of SimHost to receive a `SimBareMetalMachine` and `SimHypervisor` directly instead of construction these objects itself. This ensures better testability and also simplifies the constructor of this class, especially when future changes to `SimBareMetalMachine` or `SimHypervisor` change their constructors.
2022-09-22refactor(sim/compute): Extract Random dependency from interference modelFabian Mastenbroek
This change moves the Random dependency outside the interference model, to allow the interference model to be completely immutable and passable between different simulations.
2022-09-21perf(sim/compute): Prevent boxing in interference algorithmFabian Mastenbroek
This change updates the performance interference algorithm to remove the boxing that happened due to using a generic collection for storing integers. This collection was accessed in the algorithm's hot path, so could cause slowdown.
2022-09-21refactor(sim/compute): Move interference logic into VmInterferenceMemberFabian Mastenbroek
This change updates the design of the VM interference model, where we move more of the logic into the `VmInterferenceMember` interface. This removes the dependency on the `VmInterferenceModel` for the hypervisor interface.
2022-09-21refactor(sim/compute): Pass interference key via parameterFabian Mastenbroek
This change updates the signature of the `SimHypervisor` interface to accept a `VmInterferenceKey` when creating a new virtual machine, instead of providing a string identifier. This is in preparation for removing the dependency on the `VmInterferenceModel` in the `SimAbstractHypervisor` class.
2022-09-21refactor(sim/compute): Remove timestamp parameter from SimTraceFabian Mastenbroek
This change removes the timestamp parameter from `SimTrace`. Instead, it is now assumed that the trace is continuous and the end of a fragment starts a new fragment, in order to simplify replaying of the trace.
2022-09-21refactor(sim/compute): Remove FlowEngine from SimMachineContextFabian Mastenbroek
This change removes the reference to the active FlowEngine from the SimMachineContext interface. This prevents leaking the lower layer into this module.
2022-09-21refactor(sim/compute): Remove convergence listener parameterFabian Mastenbroek
This change removes the convergence listener parameter in for the `SimBareMetalMachine` and the hypervisors. This parameter was not used in the code-base and is being removed with the introduction of the new flow2 module.
2022-09-21refactor(sim/compute): Move VM interference model into compute simulatorFabian Mastenbroek
This change moves the core of the VM interference model from the flow module into the compute simulator. This logic can be contained in the compute simulator and does not need to leak into the flow-level simulator.
2022-06-15fix(sim/compute): Always recompute power usageFabian Mastenbroek
This change fixes an issue in the `SimBareMetalMachine` implementation where the power usage was only updated after a non-zero duration. However, this would mean that OpenDC would possibly report incorrect power usage values when multiple convergence calls occured at the same timestamp.
2022-06-09fix(sim/compute): Limit growth rate for trace constructionFabian Mastenbroek
This change fixes an issue where the `SimTrace.Builder` would quickly allocate too much memory when constructing a trace, due to doubling the array sizes each time. Instead, we use the approach used by `ArrayList`, where we increase the array size by 50% every step.
2022-04-24build: Move modules into subgroupsFabian Mastenbroek
This change updates the Gradle build configuration of the project to publish the different type of modules (e.g., opendc-compute, opendc-simulator) into their own groups.
2022-04-23build: Enable testing for all library modulesFabian Mastenbroek
This change updates the Gradle build configuration to ensure that all library modules (that will be published) use testing and are included in coverage reports. This should ensure the public modules remain well tested.
2022-02-18refactor(simulator): Remove delta parameter from flow callbacksFabian Mastenbroek
This change removes the delta parameter from the callbacks of the flow framework. This parameter was used to indicate the duration in time between the last call and the current call. However, its usefulness was limited since the actual delta values needed by implementors of this method had to be bridged across different flow callbacks.
2022-02-18perf(simulator): Move logger field out of classFabian Mastenbroek
This change updates the FlowConsumerContextImpl by moving the logger outside of the class. This prevents each instance of this class from having to construct a logger instance.
2022-02-18fix(simulator): Flush results before accessing countersFabian Mastenbroek
This change updates the simulator implementation to flush the active progress when accessing the hypervisor counters. Previously, if the counters were accessed, while the mux or consumer was in progress, its counter values were not accurate.
2022-02-18build: Remove opendc-platform moduleFabian Mastenbroek
This change removes the opendc-platform module from the project. This module represented a Java platform which was previously used for sharing a set of dependency versions between subprojects. However, with the version catalogue that was added by Gradle, we currently do not use the platform anymore.
2021-12-09fix(simulator): Support convergence of space shared hypervisorFabian Mastenbroek
This change addresses an issue with the SimSpaceSharedHypervisor implementation where it did not emit convergence events due to missing implementation. This caused issues with users of this class trying to obtain usage data, which depended on these events being emitted.
2021-11-02refactor(trace): Support gaps in trace dataFabian Mastenbroek
This change updates the implementation of the trace converter and SimTrace implementation to support cases where there is a gap between samples in the trace data. This change allows users to specify what to do in case samples are missing in the trace. The available options are specified in `SimTrace.FillMode`. Currently, we support either carrying the previous value forward or set the usage to zero.
2021-10-25refactor(simulator): Support running workloads without coroutinesFabian Mastenbroek
This change updates the SimMachine interface to drop the coroutine requirement for running a workload on a machines. Users can now asynchronously start a workload and receive notifications via the workload callbacks. Users still have the possibility to suspend execution during workload execution by using the new `runWorkload` method, which is implemented on top of the new `startWorkload` primitive.
2021-10-25fix(simulator): Use correct flow input capacity for countersFabian Mastenbroek
This change fixes an issue with the FlowMultiplexer implementation where the capacity of each flow input was equal to the capacity of all flow outputs. Now, the user can specify the capacity of the input, which will be used to correctly compute the active and idle time.
2021-10-25perf(compute): Redesign VM interference algorithmFabian Mastenbroek
This change redesigns the virtual machine interference algorithm to have a fixed memory usage per `VmInterferenceModel` instance. Previously, for every interference domain, a copy of the model would be created, leading to OutOfMemory errors when running multiple experiments at the same time.
2021-10-25build(jmh): Fix duplicate classpath entriesFabian Mastenbroek
This change fixes an issue with the JMH plugin where entries would be included twice on the classpath or entries that did not belong on the classpath were also included.