libmuscle.manager.topology_store module

class libmuscle.manager.topology_store.TopologyStore(config: ymmsl.configuration.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]

Creates a TopologyStore.

Creates a TopologyStore containing conduits read from the given configuration data, which must contain a ‘model’ key.

Parameters

configuration – A yMMSL configuration.

get_conduits(kernel_name: ymmsl.identity.Reference) List[ymmsl.model.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: ymmsl.identity.Reference) Dict[ymmsl.identity.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.

has_kernel(kernel: ymmsl.identity.Reference) bool[source]

Returns True iff the given kernel is in the model.

Parameters

kernel – The kernel to check for.