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 Process for your process logic.
  3. Configure the simulation with SimulationBuilder.
  4. Call run_X() on the result of SimulationBuilder::build.

Re-exports§

pub use services::broadcast;
pub use services::broadcast_within_pool;
pub use services::choose_from_pool;
pub use services::list_pool;
pub use services::now;
pub use services::pid;
pub use services::schedule_timer_after;
pub use services::send_random;
pub use services::send_random_from_pool;
pub use services::send_to;
pub use services::unique_id;
pub use log;
pub use rand;

Modules§

helpers
Helper utilities for simulation processes.
services
Services to use with simulation: key-value store, process interaction, uid generator.

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_log
Logs at the given level, prefixed with simulation time and process pid. Controlled by the RUST_LOG environment variable.
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.
CompleteStatus
Outcome of a simulation run.
Distr
Probability Distributions used to sample network latencies.
MessagePtr
Reference-counted wrapper around a Message.
ThreadNumber
Represents how many threads will be used 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
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.
Seed
Represents seed type for deterministic random number generators.
TimerId
Scheduled timer id. TimerId is guaranteed to be unique.