libmuscle.manager.topology_store module

class libmuscle.manager.topology_store.TopologyStore(config: PartialConfiguration)[source]

Bases: object

Holds a description of how the simulation is wired together.

This class contains the list of conduits through which the submodels are connected.

conduits

A list of conduits.

Type:

List[Conduit]

get_conduits(kernel_name: Reference) List[Conduit][source]

Returns the list of conduits that attach to the given kernel.

Parameters:

kernel_name – Name of the kernel.

Returns:

All conduits that this kernel is a sender or receiver of.

get_peer_dimensions(kernel_name: Reference) Dict[Reference, List[int]][source]

Returns the dimensions of peer kernels.

For each kernel that the given kernel shares a conduit with, the returned dictionary has an entry containing its dimensions.

Parameters:

kernel_name – Name of the kernel for which to get peers.

Returns:

A dict of peer kernels and their dimensions.

get_peer_instances(instance: Reference) List[Reference][source]

Generates the names of all peer instances of an instance.

Parameters:

instance – The instance whose peers to generate.

Returns:

All peer instance identifiers.

has_kernel(kernel: Reference) bool[source]

Returns True iff the given kernel is in the model.

Parameters:

kernel – The kernel to check for.