libmuscle.manager.instance_manager module

class libmuscle.manager.instance_manager.InstanceManager(configuration: Configuration, run_dir: RunDir, instance_registry: InstanceRegistry)[source]

Bases: object

Instantiates and manages running instances

get_resources() Dict[Reference, Resources][source]

Returns the resources allocated to each instance.

Only call this after start_all() has been called, or it will raise an exception because the information is not available.

Returns:

The resources for each instance instantiated by start_all()

set_manager_location(location: str) None[source]

Sets the network location of the manager.

Call this before starting any instances so that the location can be passed to them.

Parameters:

location – The network location (e.g. localhost:5000)

shutdown() None[source]

Shuts down the backend.

This will wait for any processes still running before shutting down and returning.

start_all() None[source]

Starts all the instances of the model.

wait() bool[source]

Waits for all instances to be done.

class libmuscle.manager.instance_manager.LogHandlingThread(queue: Queue)[source]

Bases: Thread

Pumps log records from a queue.

This gets log records from a queue and sends them to the logging system.

run() None[source]

The thread’s entry point.

shutdown() None[source]

Process remaining records and stop the thread.