Module simnet

Source
Expand description

A simulator capable of simulating Hyperactor’s network channels (see: [channel]). The simulator can simulate message delivery delays and failures, and is used for testing and development of message distribution techniques.

Structs§

BetaDistribution
A beta distribution scaled to a given range of values.
LatencyConfig
Configuration for latencies between distances for the simulator
SimNet
SimNet defines a network of nodes. Each node is identified by a unique id. The network is represented as a graph of nodes. The graph is represented as a map of edges. The network also has a cloud of inflight messages
SimNetHandle
A handle to a running SimNet instance.
SimulatorEventRecord
DeliveryRecord is a structure to bookkeep the message events.
TorchOpEvent
A pytorch operation

Enums§

LatencyDistribution
A distribution of latencies that can be sampled from
SimNetError
SimNetError is used to indicate errors that occur during network simulation.
TrainingScriptState
The state of the python training script.

Traits§

Address
This is used to define an Address-type for the network. Addresses are bound to nodes in the network.
Dispatcher
Dispatcher is a trait that defines the send operation. The send operation takes a target address and a data buffer. This method is called when the simulator is ready for the message to be received by the target address.
Event
The unit of execution for the simulator. Using handle(), simnet can schedule executions in the network. If you want to send a message for example, you would want to implement a MessageDeliveryEvent much on the lines expressed in simnet tests. You can also do other more advanced concepts such as node churn, or even simulate process spawns in a distributed system. For example, one can implement a SystemActorSimEvent in order to spawn a system actor.

Functions§

simnet_handle
A handle for SimNet through which you can send and schedule events in the network.
start
Starts a sim net.
start_with_config
Starts a sim net with configured latencies between distances

Type Aliases§

SimulatorTimeInstant
Minimum time unit for the simulator.