Expand description
Deterministic & fast simulation framework for distributed systems.
DScale provides a single-threaded or parallel, event-driven simulation engine that models network latency, bandwidth constraints, and process execution. Simulations are fully deterministic when seeded, making them reproducible for testing and benchmarking.
The main workflow:
- Define messages implementing
Message. - Implement
ProcessHandlefor your process logic. - Configure the simulation with
SimulationBuilder. - Call
run_X()on the result ofSimulationBuilder::build.
Re-exports§
pub use global::broadcast;pub use global::broadcast_within_pool;pub use global::choose_from_pool;pub use global::global_unique_id;pub use global::list_pool;pub use global::now;pub use global::pid;pub use global::schedule_timer_after;pub use global::send_random;pub use global::send_random_from_pool;pub use global::send_to;
Modules§
- global
- Global simulation state: clock, configuration, key-value store, and process interaction functions.
- helpers
- Helper utilities for simulation processes.
Macros§
- dscale_
debug - Logs at debug level. See [
dscale_log]. - dscale_
error - Logs at error level. See [
dscale_log]. - dscale_
info - Logs at info level. See [
dscale_log]. - dscale_
trace - Logs at trace level. See [
dscale_log]. - dscale_
warn - Logs at warn level. See [
dscale_log].
Structs§
- Jiffies
- The simulation time unit. One jiffy is the smallest discrete time step.
- Simulation
Builder - Builder for configuring and constructing a simulation.
Enums§
- Bandwidth
Config - Per-process NIC bandwidth configuration.
- Distr
- Probability Distributions used to sample network latencies.
- Message
Ptr - Reference-counted wrapper around a
Message. - RunStatus
- Outcome of a simulation run.
- Threads
- Represents how many threads will workers use to run steps in parallel.
Constants§
- GLOBAL_
POOL - Name of the implicit pool that contains every process.
Traits§
- Message
- Trait for values that can be sent between simulated processes.
- Process
Handle - Core trait for defining process behavior in the simulation.
- Simulation
Runner - Execution engine returned by
crate::SimulationBuilder::build.