Skip to main content

Crate dscale

Crate dscale 

Source
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:

  1. Define messages implementing Message.
  2. Implement ProcessHandle for your process logic.
  3. Configure the simulation with SimulationBuilder.
  4. Call run_X() on the result of SimulationBuilder::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.
SimulationBuilder
Builder for configuring and constructing a simulation.

Enums§

BandwidthConfig
Per-process NIC bandwidth configuration.
Distr
Probability Distributions used to sample network latencies.
MessagePtr
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.
ProcessHandle
Core trait for defining process behavior in the simulation.
SimulationRunner
Execution engine returned by crate::SimulationBuilder::build.

Type Aliases§

Pid
Unique identifier for a process within the simulation. Pids are assigned sequentially starting from 0 in the order pools are added.
TimerId
Scheduled timer id. TimerId is guaranteed to be unique.