slacm.app module

Created on Sep 18, 2020

@author: esdev

class slacm.app.App(arg, verbose, arg2)[source]

Bases: object

Class representing an application. Instantiated by the main(), as a singleton. Constructs and runs the application on the current (‘root’) and on remote (‘peer’) nodes.

MODE_PEER = 3
MODE_ROOT = 2
MODE_SIMPLE = 1
broadcast_to_peers(msg)[source]

Broadcast a message from the root to all peers. :param msg: Message to broadcast

build_package()[source]

Build a deployment package from the content of the application folder, where the model file is contained. :return tgz_file: the full path of the package file.

collect_from_peers(arg=None)[source]

Collect an expected message from all peer nodes on the root node. :param arg: Expected message string

get_actor_params(actor)[source]

Return the parameters specific to an actor of the application.

get_comp_params(actor, component)[source]

Return the parameters specific to a component of an actor of the application.

get_disco()[source]

Return the discovery manager.

get_netInfo()[source]

Return the network information record.

join()[source]

On a root node: execute a ‘join’ for all actors. On a peer node: wait for a ‘terminate’ message from the root, and then terminate

make_peer_arg()[source]

Form the command line argument for the peer nodes.

parse_deplo()[source]

Parse the deployment section of the model.

recv_from_root(arg=None)[source]

Expect and receivee message from the root on a peer node. :param arg: Message expected

run()[source]

Run the actors of the node (root or peer)

run_peers(dist)[source]

Launch SLAcM on the peer node/s, with the distribution parameter

send_to_root(msg)[source]

Send a message to the root from a peer node. :param msg: Message to send.

setup()[source]

Execute the ‘setup’ and ‘finalize’ steps in application initialization. The same code runs on the root and the peer nodes, but execution is synchronized through messages. The expected sequence: (1) peers ready, (2) setup executed, (3) finalize executed.

setupInterfaces()[source]

Determine the network interface used to communicate within the SLAcM network. Note: the root and peer nodes may use different network interfaces. Builds the network information record.

setup_peer_ports()[source]

Set up ports for the peer App used to communicate with the root node.

setup_root_ports()[source]

Set up ports for the root App used to communicate with peer nodes.

terminate()[source]

Terminate actvities of the current app.

class slacm.app.DeplInfo(actor, params)

Bases: tuple

actor

Alias for field number 0

params

Alias for field number 1