libmuscle.manager.mmp_server module

class libmuscle.manager.mmp_server.MMPServer(logger: Logger, settings: Settings, instance_registry: InstanceRegistry, topology_store: TopologyStore)[source]

Bases: object

The MUSCLE Manager Protocol server.

This class accepts connections from the instances comprising the multiscale model to be executed, and services them using an MMPServicer.

get_location() str[source]

Returns this server’s network location.

This is a string of the form <hostname>:<port>.

stop() None[source]

Stops the server.

This makes the server stop serving requests, and shuts down its background threads.

wait() None[source]

Waits for the server to finish.

The server will shut down after every instance has been registered and deregistered again.

class libmuscle.manager.mmp_server.MMPServicer(logger: Logger, settings: Settings, instance_registry: InstanceRegistry, topology_store: TopologyStore)[source]

Bases: MuscleManagerServicer

The MUSCLE Manager Protocol server.

This class handles incoming requests from the instances comprising the multiscale simulation to be executed.

Parameters
  • logger – The Logger component to log messages to.

  • settings – The global settings to serve to instances.

  • instance_registry – The database for instances.

  • topology_store – Keeps track of how to connect things.

DeregisterInstance(request: DeregistrationRequest, context: ServicerContext) DeregistrationResult[source]

Handles an instance deregistration request.

RegisterInstance(request: RegistrationRequest, context: ServicerContext) RegistrationResult[source]

Handles an instance registration request.

RequestPeers(request: PeerRequest, context: ServicerContext) PeerResult[source]

Handles a peer request.

RequestSettings(request: SettingsRequest, context: ServicerContext) SettingsResult[source]

Returns the central base settings.

SubmitLogMessage(request: LogMessage, context: ServicerContext) LogResult[source]

Forwards a submitted log message to the Logger.

SubmitProfileEvents(request: Profile, context: ServicerContext) ProfileResult[source]

Forwards a submitted log message to the ProfilingStore.