4.3.2. Simulation Configuration#

4.3.2.1. Base#

class simbricks.orchestration.simulation.base.Simulator(simulation: sim_base.Simulation, executable: str, name: str = '')#

Base class for all simulators.

filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
property extra_args: str#
property wait_terminate: bool#
toJSON() → dict#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

get_interface_url(inst: Instantiation, intf: Interface) → str#
components() → set[Component]#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

full_name() → str#

Full name of the simulator.

add(comp: Component) → None#
get_channels() → list[Channel]#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
abstractmethod run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
abstractmethod supported_socket_types(interface: Interface) → set[SockType]#
sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
start_delay() → int#
supports_checkpointing() → bool#
async prepare(inst: Instantiation) → None#
id() → int#
class simbricks.orchestration.simulation.base.DummySimulator(simulation: sim_base.Simulation, executable: str, name: str = '')#
run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

supported_socket_types(interface: Interface) → set[SockType]#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
add(comp: Component) → None#
checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
components() → set[Component]#
property extra_args: str#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
full_name() → str#

Full name of the simulator.

get_channels() → list[Channel]#
get_interface_url(inst: Instantiation, intf: Interface) → str#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
id() → int#
async prepare(inst: Instantiation) → None#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
start_delay() → int#
supports_checkpointing() → bool#
toJSON() → dict#
property wait_terminate: bool#
class simbricks.orchestration.simulation.base.GenericSimulator(simulation: sim_base.Simulation, executable: str, name: str = '', args: list[str] | None = None)#

Runs an arbitrary simulator binary whose full argv is given by the user.

The binary and args can contain placeholders. There are two kinds of placeholder:

  • @{SIMBRICKS_URL:<interface-id>}@ becomes the SimBricks parameters url of that interface’s connection. Build it with interface_url_placeholder.

  • @{SIMBRICKS_PATH:<name>}@ becomes one of the run’s directories, see simbricks.orchestration.instantiation.base.InstantiationEnvironment.path_placeholder.

A placeholder may sit inside a larger argument, e.g. --pci=@{...}@. Any other text is passed through untouched.

Note: To run a binary shipped in an input artifact, name it relative to the directory it is unpacked into, e.g. executable="@{SIMBRICKS_PATH:input_artifacts_dir}@/my-sim".

args: list[str]#

Arguments to invoke executable with, possibly containing placeholders.

static interface_url_placeholder(interface: Interface) → str#

Placeholder that run_cmd replaces with @interface’s parameters url.

supported_socket_types(interface: Interface) → set[SockType]#
full_name() → str#

Full name of the simulator.

toJSON() → dict#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

add(comp: Component) → None#
checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
components() → set[Component]#
property extra_args: str#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
get_channels() → list[Channel]#
get_interface_url(inst: Instantiation, intf: Interface) → str#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
id() → int#
async prepare(inst: Instantiation) → None#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
start_delay() → int#
supports_checkpointing() → bool#
property wait_terminate: bool#
class simbricks.orchestration.simulation.base.Simulation(name: str, system: System)#

Base class for all simulation experiments.

Contains the simulators to be run and experiment-wide parameters.

name#

This experiment’s name.

Can be used to run only a selection of experiments.

timeout: int | None#

Timeout for experiment in seconds.

toJSON() → dict#

Serializes a Simulation.

Note: The sys_sim_map is not serialized as the sim_list stores the required information implicitly as Simulators,

when serialized store a list of their corresponding components.

classmethod fromJSON(system: System, json_obj: dict, enforce_dummies: bool = False) → Self#

Deserializes a Simulation.

Note: The sys_sim_map is not deserialized as the map is restored when deserializing the the sim_list.

This is possible as each Simulator stores when a list of their corresponding components when serialized.

add_sim(sim: Simulator)#
add_spec_sim_map(sys: Component, sim: Simulator)#

Add a mapping from specification to simulation instance

is_channel_instantiated(chan: Channel) → bool#
update_channel_mapping(sys_chan: Channel, sim_chan: Channel) → None#
retrieve_or_create_channel(chan: Channel) → Channel#
get_channel(chan: Channel) → Channel#
get_channel_by_id(id: int) → Channel#
id() → int#
all_simulators() → list[Simulator]#
get_simulator(id: int) → Simulator#
get_all_channels(lazy: bool = False) → list[Channel]#
enable_synchronization(sync_period: TimeInterval | str | None = None) → None#
resreq_mem() → int#

Memory required to run all simulators in this experiment.

resreq_cores() → int#

Number of Cores required to run all simulators in this experiment.

find_sim(comp: sys_conf.Component) → sim_base.Simulator#

Returns the used simulator object for the system component.

async prepare(inst: Instantiation) → None#
any_supports_checkpointing() → bool#

4.3.2.2. Channel#

class simbricks.orchestration.simulation.channel.Channel(chan: Channel)#
property sync_period: TimeInterval#

The synchronization period. For SimBricks to function properly in sync mode, the sync period must not be larger than a channels latency.

toJSON()#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
id() → int#

4.3.2.3. Host#

class simbricks.orchestration.simulation.host.HostSim(simulation: Simulation, executable: str, name='')#
toJSON() → dict#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
full_name() → str#

Full name of the simulator.

add(host: Host)#
abstractmethod supported_image_formats() → list[str]#
abstractmethod async copy_disk_image(inst: Instantiation, disk_image: DiskImage, ident: str) → str#
async prepare(inst: Instantiation)#
async pull_boot_artifacts(inst: Instantiation, host: FullSystemHost, kinds: list[BootArtifact]) → None#

Fetch @kinds from @host’s first disk image and stash them for run_cmd.

Called from a simulator’s prepare, naming every kind at once. run_cmd is synchronous and cannot fetch, so it reads the stash via boot_artifact().

check_boot_artifact(host: FullSystemHost, kind: BootArtifact) → bool#
boot_artifact(host: FullSystemHost, kind: BootArtifact) → str#

Path of a boot artifact previously fetched by pull_boot_artifacts.

supported_socket_types(interface: Interface) → set[SockType]#
checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
components() → set[Component]#
property extra_args: str#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
get_channels() → list[Channel]#
get_interface_url(inst: Instantiation, intf: Interface) → str#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
id() → int#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

abstractmethod run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
start_delay() → int#
supports_checkpointing() → bool#
property wait_terminate: bool#

4.3.2.4. PCIDev#

class simbricks.orchestration.simulation.pcidev.PCIDevSim(simulation: Simulation, executable: str, name: str)#

Base class for PCIe device simulators.

full_name() → str#

Full name of the simulator.

supported_socket_types(interface: Interface) → set[SockType]#
add(comp: Component) → None#
checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
components() → set[Component]#
property extra_args: str#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
get_channels() → list[Channel]#
get_interface_url(inst: Instantiation, intf: Interface) → str#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
id() → int#
async prepare(inst: Instantiation) → None#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

abstractmethod run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
start_delay() → int#
supports_checkpointing() → bool#
toJSON() → dict#
property wait_terminate: bool#
class simbricks.orchestration.simulation.pcidev.NICSim(simulation: Simulation, executable: str, name: str = '')#

Base class for NIC simulators.

toJSON() → dict#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
full_name() → str#

Full name of the simulator.

add(nic: SimplePCIeNIC)#
run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
components() → set[Component]#
property extra_args: str#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
get_channels() → list[Channel]#
get_interface_url(inst: Instantiation, intf: Interface) → str#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
id() → int#
async prepare(inst: Instantiation) → None#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
start_delay() → int#
supported_socket_types(interface: Interface) → set[SockType]#
supports_checkpointing() → bool#
property wait_terminate: bool#

4.3.2.5. Net#

class simbricks.orchestration.simulation.net.NetSim(simulation: Simulation, executable: str, name: str = '')#

Base class for network simulators.

full_name() → str#

Full name of the simulator.

init_network() → None#
supported_socket_types(interface: Interface) → set[SockType]#
toJSON() → dict#
classmethod fromJSON(simulation: Simulation, json_obj: dict) → Self#
add(comp: Component) → None#
checkpoint_commands() → list[str]#
cleanup_commands() → list[str]#
components() → set[Component]#
property extra_args: str#
static filter_channels_by_sys_type(channels: list[Channel], ty: type) → list[Channel]#
filter_components_by_pred(pred: ~typing.Callable[[~simbricks.orchestration.system.base.Component], bool], ty: type[~simbricks.orchestration.simulation.base.T] = <class 'simbricks.orchestration.system.base.Component'>) → list[T]#
filter_components_by_type(ty: type[T]) → list[T]#
static filter_sockets(sockets: list[Socket], filter_type: SockType = SockType.LISTEN) → list[Socket]#
get_channels() → list[Channel]#
get_interface_url(inst: Instantiation, intf: Interface) → str#
get_parameters_url(inst: Instantiation, socket: Socket, channel: Channel | None = None, sync: bool | None = None, latency: TimeInterval | None = None, sync_period: TimeInterval | None = None) → str#

Build the parameters url handed to a simulator’s SimBricks adapter.

By convention the time intervals in these urls are always given as plain picosecond values without a unit suffix.

static get_unique_latency_period_sync(channels: list[Channel]) → tuple[TimeInterval, TimeInterval, bool]#
id() → int#
async prepare(inst: Instantiation) → None#
resreq_cores() → int#

Number of cores this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

resreq_mem() → int#

Number of memory in MB this simulator requires during execution.

This is used for scheduling multiple runs and experiments.

abstractmethod run_cmd(inst: Instantiation) → str#

Command to execute this simulator.

sockets_cleanup(inst: Instantiation) → list[Socket]#
sockets_wait(inst: Instantiation) → list[Socket]#
static split_sockets_by_type(sockets: list[Socket]) → tuple[list[Socket], list[Socket]]#
start_delay() → int#
supports_checkpointing() → bool#
property wait_terminate: bool#