Calls on objects Calls on class objects Calls on LegionClass Calls on file and context objects Start-up and shutdown functions Scheduling support

General functions about the state of the system Security Application development Program support Alphabetical list of commands Other on-line tutorials & documentation

Click on the to move to the selected text.

Depending on how your system is set up, you may need to set up your access to your system before you can run Legion commands. This will probably involve running a command such as this:

$ . ~legion/setup.sh
or
$ source ~legion/setup.csh

The exact syntax will depend on what kind of shell you are using and where your Legion files are installed (i.e., the value of ~legion will depend on your individual Legion net). Consult your system administrator for more information.

The following style conventions are used in these tutorials:

Unix, DOS, and local path names appear in

normal face.

Context names and paths appear in

fixed face.
A quick list of just the commands' syntax is also available.

Creates an interface from the list of <well-known class type> and <function signature> arguments specified in the argument list. Sends this interface to the object specified by <LOID> or <context path> in the form of a call to the object mandatory function named exportsInterface(). Prints to standard output the return value from the call:

1

if the interface of the object contains the entire interface of functions specified by the user

0

if any one or more of the functions are not exported by the object

-1

(without contacting the specified object) if the user creates a malformed argument list

The <well-known class type> argument is a string in the set of well known strings, which can be listed via the legion_wellknown_class tool.

For the purposes of this tool, "ClassObject" is a well-known class string. "CommandLineClass" and "BootstrapMetaClass" are not considered well-known classes because they do not have any special member functions, as shown in the examples below.

Calls the object-mandatory ping member function on the object named in <object LOID>. If the command returns, the object exists in an active state and its LOID is displayed. If the command does not return, the object is not accessible by the tool.

The time-out flag specifies a maximum number of seconds to wait for the ping to complete successfully. If the object does not respond to the ping within that amount of time, legion_ping will exit. Please note that legion_ping failing due to a user-specified time-out does not necessarily mean that the object is inactive or otherwise unreachable. There is no default time-out setting.

Adds, deletes, test, and updates attributes, named in <attribute description>, of an object named in <context path> or <object LOID> from the command line. The <attribute description> parameter takes the form name(val1, ..., valn). The attribute description must not contain any spaces or begin with an uppercase letter.

Optional parameters do the following:

-a

Add an attribute

-d

Delete an attribute

-t

Test an attribute

<attribute description>

Specify an attribute to be updated

-u

Update an object's attributes

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

The following example adds the attribute favoritenames to object Foo,
with the -a flag.

Creates an object of the class named in <class LOID> or <class context path>. No start-up parameters will be supplied for the class or new object.

If the -h flag isn't used, the host is selected by the class in which you are creating an instance. Similarly, the class will choose a vault if the -v flag isn't used. Normally, this means that a random host is selected, but some classes may act differently. If the -Ch or -Cv flag is used, the class will randomly choose a host or vault from the hosts or vaults listed in the specified context. In both cases, the system will not return the LOID of the randomly chosen host. The legion_host_vault_list and legion_vault_host_list commands will allow users to limit the placement of a given class's instances (i.e., any instances of class Foo can only be placed on hosts X, Y, and Z).

The following options are supported:

-h

Specify a host for the new object

-v

Specify a vault for the new object

-H

Specify the preferred host class's context path

-V

Specify the context path of the preferred vault

-Ch

Specify a context which contains a list of the preferred hosts

-Cv

Specify a context which contains a list of the preferred vaults

-d

Automatically start a legion_record session for the newly created object. This allows you to debug server objects. The object's relevant activity will be recorded by a previously started Legion recorder object, named in <recorder context path>.

Causes the specified class object to create a new object on the host named in <host name> using the rsh (remote shell) mechanism. The object will be managed with rsh, if the class it is invoked on is an rshStartClass. If this utility is invoked on a normal class, normal object create mechanism will be used, and the object will not be managed by rsh. This command is generally used only by the legion_create_host and legion_create_vault scripts, not by users.

The additional arguments specify information for the rsh environment.

<host name>

Specifies the host upon which the new object should be placed. Note that this should be a DNS name

<host architecture>

Specifies the host's architecture

<$LEGION>

Specifies the Legion environment variable on the rsh host

<$LEGION_OPR>

Specifies LEGION_OPR for host

<$LEGION_OPA>

Specifies the OPR address for the object, i.e, a unique directory in which the object will maintain its persistent representation on the remote host

Deletes the object named in <context path> or <object LOID>. More specifically, it removes the object's LOID but not its context name (if there is one). If the object is active, the command deactivates the object. In all cases, it deletes the OPR (object persistent representation) associated with the object.

This command will not remove an object's context name: you must use the legion_rm command to remove the context name(s) or you will get binding errors in that context. (You can use legion_ls -A to check for multiple context names.)

Lists the implementation objects associated with the class named in <class LOID> or <class context path>. In its default setting the output will consist of each implementation object's LOID and architecture type. If the -v flag is included, the output will include byte size and a brief description of each object.

The following options are supported:

-v

Run the command in a verbose setting

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

Note that if the -v flag is used Legion will use one extra method invocation per implementation object.

Displays information about the instances of the class named by <context path> or <class LOID>. For every instance, the tool displays the class's LOID, current object address, status (active or inert), the host on which it resides, and the vault that holds its OPR. The example below shows that class BasicFileClass has two instances, and that both are currently running.

Calls the set_host() class-mandatory member function on the class of the object named by in <object LOID> or <object context path>, causing that object to migrate to the host named in <host LOID> or <host context path>.

In the example below, object Foo's host is changed from BootstrapHost to newHost.

Moves the OPR of the object named in <object LOID> or <object context path> to the vault named in <vault LOID> or <vault context path>.

The following options are supported:

-permanent

Makes the migration permanent. I.e., the object's acceptable vault list will be change to list only the new vault. No further migration can occur without user intervention (via the legion_instance_vault_list command)

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

Be careful with the -permanent flag. If none of the instance's acceptable hosts match the chosen vault (i.e., there are no compatible host-vault pairs) the instance cannot be reactivated. Alternatively, the chosen vault may be compatible only with hosts for which the class has no implementation.

Please note that this command can fail for many reasons, including:

the instance does not exist

the user does not have permission to perform the migration

the target vault does not exist

the target vault will not grant the request to create a new OPR for the object

the source vault is unavailable or will not grant the request to get the current OPR

other machine or system failure

the specified vault is unacceptable

The class object will enforce the current restrictions on its instance's acceptable vaults before it migrates the object's state. You may need to change the instance's list of acceptable vaults (via the legion_instance_vault_list command) to include the target vault before running legion_set_vault.
This command is not exactly the equivalent of a true object migration, since the object is not reactivated after its state is moved. Where the object reactivates depends on the scheduling decision made at the time the reactivation occurs. If the -permanent flag is not used and the instance's acceptable vault list is not otherwise altered, future activations of the instance may be on different vaults. If the -permanent flag is used, all future activations must use the specified vault, until the acceptable vault list is altered.

Joins a set of Legion domains (systems) to create a single, larger, multi-domain Legion system. Before you run this command, you must obtain a copy of the Legion domain cookie files from all of the involved domains (see legion_generate_domain_cookie and legion_print_domain_cookie), including the current Legion domain. If you are joining domain A to domain B and domain B has already been joined to domain C, you will need cookie files from domains A, B, and C. This provides transitivity in the system join. All three domains will be joined to one another to form a single system. The command is implemented this way to avoid communication failures; if a LOID can be passed to an object (e.g., in a method continuation list), that object should be able to use the LOID for further communication.

Non-transitive or non-reflexive joins would allow communication of LOIDs for which an object could not obtain a binding. For example, object X in domain A might be able to bind to object Y in domain B and pass a method to it, but object Y might not be able to bind to object X to pass it the return value.

In addition to joining the binding trees of the involved domains, legion_combine_domains also creates context links in the current domain's context space to all of the remote domains' root contexts. These links appear in local context space in the following path: /domain/LegionDomain.<domain-id>.

If the command is run on domains that are already connected, it has no affect and is harmless.

There is currently no mechanism supporting "unjoining" of domains. However, Legion security mechanisms (e.g., ACLs) can be used to effectively forbid any use of the current domain by outside domains.

The following options are supported:

-v

Provide a verbose output as the command is running.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

The example below combines two domains. If either had previously been connected to another domain, three cookie files would be listed.

Creates an implementation object based on the binary executable named in <binary path name>. The new implementation object is associated with the class object named in <class LOID> or <context path>, and is marked as usable for hosts of a specified type (Linux, Solaris, or SGI).

The following options are supported:

-c <context path>

Specify a context path for the new object. Default is /impls/<binary_name>.<architecture>.<#>.

Generates a domain cookie file for the current Legion domain, as required by legion_combine_domains. A cookie file contains binding information for the LegionClass in the current domain, security credentials for joining to the current domain, and information about the context space of the current domain (for creating interdomain context space links). The default cookie file name is LegionDomainCookie.<domain-id>, or you can use the -o flag to specify a name.

In a secure environment, you must be logged in as /users/admin for the current domain. This ensures that the required credentials can be generated and saved in the cookie file.

Creates and registers implementation objects for commonly used classes in the current architecture. This command is run on new hosts, so as to create the implmentation objects in the proper place. Implementation objects for specific binary executables can be created with the legion_create_implementation utility.

List the domains currently connected to your current Legion domain. The output will list the binding for your current domain and any domains linked to your current domain. Please see legion_combine_domains for information about connecting Legion domains.

Displays the contents of a Legion domain cookie file (required for using legion_combine_domains). By default the command displays the contents of the file LegionDomainCookie.<current-domain-id>, but any input file name can be specified using the -i option.

Changes the current working context to the context named in <context path>. Note that the path name can be relative or absolute. This command is identical to the legion_set_context command and analogous to the Unix cd command .

Creates a new context in Legion context space, and assigns it the name given in <context path>. This command is analogous to the Unix mkdir command. The new context will be placed in your current context. The output will contain the new context's location and its LOID.

Copies the file named in <source file> (named as either a context path or a local path) to a new, duplicate, file object named in <destination file> (named as either a context path or a local path). The command is analogous to the Unix cp command.

The following optional parameters are supported:

-v

Verbose mode. Prints information about which files and directories the command is currently working on.

-r

Recursive mode. If the <source path> is a directory, all of its contents are copied recursively. Only files and contexts/directories are handled. If other objects are encountered, they are skipped and legion_cp prints a warning message. Note that recursive mode automatically detects cycles in context space and prevents the recursive copy from revisiting context nodes in the cycle. A warning message is printed in the event that cycles are detected.

-localsrc

Indicates that the source path (<source path>) is in the local files system

-localdest

Indicates that the target path (<destination path>) is in the local file system.

-V <vault context path>

Specify a vault restriction for new objects created by this command. Supply the context path of the vault that should manage new objects created as legion_cp runs.

-m

Match-class mode. This mode indicates that when files or contexts are created by this command, they should match the class of their source context or file. By default, new files and contexts are created using the default file and context classes for your current Legion environment. This mode can only be used when copying within Legion context space (i.e., when no -localsrc or -localdest options are specified).

-p

Print out the size, transfer time, and transfer rate for each file copied.

Destroys all instances of the class named in <class context path> or <class LOID>. If any instances are active, they are deactivated.

This command will remove the LOIDs of the specified class' instances in all contexts, not just the current context. However, it will not remove the context names: you must use the legion_rm command to the object's name(s), or you will get binding errors. (You can use legion_ls -A to check for multiple context names).

Causes the object named in <object path> or <LOID> to direct its output (standard out and standard error) to the Legion tty object named by <tty LOID> or <tty context path>. Note, this command can only be invoked on objects that have dynamic output redirection enabled. If the command is invoked on an object that does not have redirection enabled, neither the object nor the tty is affected and an error message is displayed.

The legion_export_dir command allows a complete directory tree in the local file system to be linked into Legion context space without requiring the creation of file copies. A matching context will be created to match the local directory tree, and the context names will match the local directory's file names. However, the command executes for the duration of time that you wish to use the exported files and directories: if you pause the command the tree's context space will not be available. Once you resume the command, however, the context space will be available. To pause the command, press "Control-C". To resume using the exported files, re-execute the command, specifying the same local base directory path and target context path.

Use of exported files and directories while the command is not active will cause binding errors. The context space will not be automatically removed when the command is paused or stopped. To delete an exported directory tree's context space, use legion_rm -r while legion_export_dir is active.

For best results, do make any changes to the exported directory tree or to the tree's context. Any changes that you make to the context, such as changing or removing context names, will not be reflected in the local directory tree (and vice versa). For this same reason you should delete the tree's context space when you are finished.

Optional parameters do the following:

-v

Verbose mode. Prints information about which files and directories the command is currently exporting.

-fc

Specify the context path of the class to use for file objects. This class should be an instance of the metaclass "/class/ProxyBindingMetaClass", since the style of file object used by legion_export_dir requires specialized binding services. The default is "/class/ContextProxyClass".

-cc

Specify the context path of the class to use for context objects. This class should also be an instance of "/class/ProxyBindingMetaClass". The default used is "/class/FileProxyClass".

Recursively copies a local directory tree in Unix space, named by <unix directory path>, into a Legion context, named by <legion context path>. The output will include the new context's LOID and location. Pathnames can be relative or absolute. Default values are the current working directory and the current working context.

Assigns an additional name, given in <new alias>, to the object named in <context path>. Analogous to the Unix ln command. Path names can be relative or absolute.

An object can have multiple context names, assigned by one or more users. The same context name can be assigned to different objects or to the same object so long as the contexts names are in different contexts (just as the same file names can be used in different levels of a Unix directory).

Lists the contents of a named Legion context in ascii-alphabetical order. Note that the pathname can be relative or absolute. The command is analogous to the Unix ls command. The default setting lists the current context. You can include a context path in the <context path> parameter to list the contents of that context. For example:

$ legion_ls /hosts
BootstrapHost
my.host.DNS.name
$

Optional parameters do the following:

-l

List object type and information, if available. Objects of unknown type will be listed as object and faulty objects will be listed as not available.

-a

List "hidden" objects in the context, i.e. those objects whose names begin with a "." character. Examples would be the "." (current) and ".." (parent) contexts.

-L

Lists LOIDs associated with names.

-R

Print a recursive listing of the current context.

-A

List all known context aliases for each listed object.

-d

List contexts like other objects, rather than listing their contents.

-q

When creating a long listing, do not activate inactive objects.

-v

Run command in verbose mode.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

You can get more information about the objects in the current or a selected object or about a particular object by including one or more flags and a context path name. The output below combines the -l, -a, and -A flags to get a list of all objects in the /hosts context, their type, and all of their context names.

According to this, there are four names listed in /hosts, two referring to contexts and two to objects. We can see from the alternative context names, though, that BootstrapHost and my.host.DNS.name refer to the same object.

Creates a new context in Legion context space, and assigns it the name given in <context path>. This command is analogous to the Unix mkdir command (it is also identical to the legion_context_create command). The new context will be placed in your current context. The output will contain the new context's location and its LOID.

This command will set an environment variable to indicate which tty object should be used by subsequent programs. By selecting a new current tty object, users can redirect the output to any window or file.

$ legion_set_tty /context_path/my-tty

Note that program output does not have to be directed to the same window in which the program is run. By setting a new current tty object, the output can be redirected to any window, or even a file. For example:

This command can be used to direct all output from a particular shell back to that shell--i.e., create and set a tty object for a shell--in one step, rather than running legion_create_object, legion_set_tty, and legion_tty_watch. If no tty object exists at the path named in <context path> it creates a new object, sets it as the target tty, and starts the legion_tty_watch process in the background of the shell in which the command was run. If a tty object already exists at the named context path, the command sets that tty object as the target tty.

Causes the Legion tty object currently set in the shell environment to stream directly into the file object named in <context path>. If the file does not already exist the system creates it. Existing files are appended to, not truncated. A single tty object can be simultaneously directed into any number of files (as well as watched from any number of terminal windows).

Causes the Legion tty object currently set in the shell environment to stop streaming into the file object named in <context path>. If the tty object is not currently directing output to the named file the command is ignored.

Causes output written to a Legion tty object to be printed to standard output. If no command line parameters are specified, the current tty object set for the shell session is selected. Otherwise, the tty object named by <LOID> or <context path> is selected. Note, the command will not self-terminate: to stop the program send it a SIGINT (i.e., using ^C or "kill -INT"). Any number of legion_tty_watch sessions smay simultaneously watch the same Legion tty object.

This command is used on PCD host objects. Adds a mapping between a Legion account and a Unix account and adds this mapping to a PCD host object's list of available accounts. The user's Unix user id is named in the <Unix user id> parameter. The host object is named in the <host object LOID>/<host object context path> parameter. The user's Legion user id can be given in the <owner LOID>/<owner context path> parameter.

Destroy a given vault object. Legion will attempt to move all of the vault's current OPRs off of the vault object and then destroy the vault object. If any OPRs cannot be successfully moved the process will abort and an error message will be displayed.

Populates the Legion system with basic classes and implementations. This command should be run after a Legion system is started for the first time (using legion_startup). On subsequent activations of the system, the state created by this utility will already exist, so this command should not be run again.

This command is used on PCD host objects. It removes one or more account mappings from the host object's list of available accounts. The parameter is the user's Unix user id. If no host is named in the <host object LOID>/<host object context path> parameter, your current host object will be the default host.

Specify the basename for the resulting setup scripts (default is /home/xxxx/OPR/setup). This command will generate two setup scripts, one for /bin/sh derivative users and one for csh-derivative users. The scripts will be named <script basename>.sh and <script basename>.csh, respectively.

-OPR <OPR dir name>

Specify the OPR directory name that will be set up when the resulting scripts are run. This directory will contain the user's local copy of Legion-Class.config (default is "Legion-OPR"). The user's local version of the directory will be placed in the user's $HOME.

-L <$LEGION dir name>

Specify the value of $LEGION, which is the directory where the resulting scripts are run. The default is the current value of $LEGION.

Shuts down a running Legion system, preserving the state of all objects for subsequent reactivation of the system. Optional parameters allow users to shut down individual hosts and to specify an interactive shutdown.

Optional parameters do the following:

-local

Shuts down only a local host or vault.

-f

Forces the termination of a system, may leave processes running and prevent a system restart.

-i

Puts the shutdown in an interactive mode, which will provide prompts for user actions.

Deactivates the class object named in <class LOID> or <context path> and all of its instances. This command operates recursively: if applied to a metaclass, for example, it would deactivate the metaclass, all of its class instances, all of their instances, etc.

Creates a new host object on the specified <new host name>, using the legion_create_object_r command (which is automatically invoked on the host class). The <new host name> is the host's DNS name. The legion_starthost command selects the following default values for the new object:

<$LEGION_OPA>

= $LEGION_OPR/Host-$HOST.OPA

<binary path>

= $LEGION/bin/$LEGION_ARCH/UnixHostObject

Optional parameters do the following:

-L <$LEGION>

Specify $LEGION for host
(default is "/home/Legion")

-O <$LEGION_OPR>

Specify $LEGION_OPR for host
(default is current $LEGION_OPR)

-A <$LEGION_ARCH>

Specify the architecture type for the host
(default is current $LEGION_ARCH)

-B <path>

Specify the basename of the host binary
(default is "UnixHostObject")

-N <context name>

Specify the context name for the host object
(default is "/hosts/<host name>")

Manipulates the list of hosts upon which the class named in <class context path> or <class LOID> can place its instances. The list of acceptable hosts for a given class consists only of hosts that have been added to the list. The list therefore may not necessarily include all possible hosts. If there are no hosts listed as acceptable the user can assume that all hosts are acceptable.

The following optional parameters are supported:

-c

Use context paths to specify class and host

-l

Use dotted hex LOIDs to specify class and host

-a

Add named host to the class's acceptable host list

-d

Delete named host from the class's acceptable host list

-t

Test whether or not a host is on the class's acceptable host list

-p

Display the class's acceptable host list

-u

Print usage

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

The example below adds a new host to the list of acceptable hosts of BasicFileClass, using the -a flag.

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new hosts, then deleting old hosts, then testing any hosts, and finally printing out the results. Note also that if you give the class's context name in the first parameter (i.e., with the -c flag) you must use the hosts' context names in the <host1>, <host2>, ...<hostn> parameter. Similarly, if you give the class's LOID (with the -l flag) you must use the hosts' LOIDs. In other words, if you were to enter:

$ legion_class_host_list -c /class/myClass \
-t 1.01.07.d59d...

You would get an error message. Legion will treat the host's LOID as a context name.

Manipulates the list of vaults upon which the class named in <class context path> or <class LOID> can place its instances' OPRs. Optional parameters are:

-c

Use context paths to specify class and vault

-l

Use LOIDs to specify class and vault

-a

Add named vault to the class's acceptable vault list

-d

Delete named vault from the class's acceptable vault list

-t

Test whether or not a vault is on the class's acceptable vault list

-p

Display the class's acceptable vault list

-u

Print usage

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new vaults, then deleting old vaults, then testing any vaults, and finally printing out the results. Note also that if you give the class's context name in the first parameter (i.e., with the -c flag) you must use the vaults' context names in the <vault1>, <vault2>, ...<vaultn> parameter. Similarly, if you give the class's LOID (with the -l flag) you must use the vaults' LOIDs. In other words, if you were to enter:

$ legion_class_vault_list -c /class/myClass \
-t 1.01.07.01000...

You would get an error message. Legion will treat the vault's LOID as a context name.

This command can be used to query or configure the helper objects used by a basic Legion scheduler. Basic Legion Scheduler objects use a Collection helper object to obtain information about available resources upon which they can schedule objects. After constructing a schedule, basic Legion Schedulers use an Enactor helper object to implement scheduling decisions (to actually start up the scheduled objects). Use legion_config_scheduler to assign a particular Collection and Enactor to a basic Legion Scheduler or vice versa.

The following optional parameters are supported:

-get_enactor

Print the LOID of a basic Legion Scheduler's currently assigned Enactor helper object

-get_collection

Print the LOID of a basic Legion Scheduler's currently assigned Collection helper object

-set_enactor

Set the Enactor named in <Enactor LOID> or <Enactor path> to the Scheduler

-set_collection

Set the Collection named in <Collection LOID> or <Collection path> to the Scheduler

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new vaults, then deleting old vaults, then testing any vaults, and finally printing out the results. Note also that if you give the host's context name in the first parameter (i.e., with the -c flag) you must use the vaults' context names in the <vault1>, <vault2>, ...<vaultn> parameter. Similarly, if you give the host's LOID (with the -l flag) you must use the vaults' LOIDs. In other words, if you were to enter:

$ legion_host_vault_list -c /host/HostName \
-t 1.01.03.d49...

You would get an error message. Legion will treat the vault's LOID as a context name.

Manipulates the list of acceptable hosts upon which the instance named in <instance LOID> or <instance context path> can be placed.

The following optional parameters are supported:

-c

Use context paths to specify instance and host

-l

Use LOIDs to specify instance and host

-a

Add named host to the instance's acceptable host list

-d

Delete named host from the instance's acceptable host list

-t

Test whether or not a host is on the instance's acceptable host list

-p

Display the instance's acceptable host list

-u

Print usage

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new hosts, then deleting old hosts, then testing any hosts, and finally printing out the results. Note also that if you give the instance's context name in the first parameter (i.e., with the -c flag) you must use the hosts' context names in the <host1>, <host2>, ...<hostn> parameter. Similarly, if you give the instance's LOID (with the -l flag) you must use the hosts' LOIDs. In other words, if you were to enter:

$ legion_instance_host_list -c myInstance \
-t 1.01.07.01000...

You would get an error message. Legion will treat the host's LOID as a context name.

Manipulates the list of acceptable vaults upon which the instance named in <instance LOID> or <instance context path> can be placed.

The following optional parameters are supported:

-c

Use context paths to specify instance and vault

-l

Use LOIDs to specify instance and vault

-a

Add named vault to the instance's acceptable vault list

-d

Delete named vault from the instance's acceptable vault list

-t

Test whether or not a vault is on the instance's acceptable vault list

-p

Display the instance's acceptable vault list

-u

Print usage

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new vaults, then deleting old vaults, then testing any vaults, and finally printing out the results. Note also that if you give the instance's context name in the first parameter (i.e., with the -c flag) you must use the vaults' context names in the <vault1>, <vault2>, ...<vaultn> parameter. Similarly, if you give the instance's LOID (with the -l flag) you must use the vaults' LOIDs. In other words, if you were to enter:

This command searches for information of the Collection object named in <Collection LOID> or <Collection path>. The format of the <query> string is described in the paper "Constructing Distributed Schedulers Using the MESSIAHS Interface Language," by Steve J. Chapin and Eugene H. Spafford.

Examples of query strings are:

'true'

This query would return the list of all objects contained in the Collection.

'match($host_os_name,"SunOS")'

This query would return the list of all objects contained in the Collection with an attribute of the form (host_os_name,"SunOS").

'match($host_os_name,"SunOS")' or'match($host_os_name,"Linux")'

This collection would return the list of all objects contained in the Collection with an attribute of either (host_os_name,"SunOS") or (host_os_name,"Linux").

The following options are available:

-v

Run in verbose mode. The resulting list of objects matching the query will be displayed along with the attributes of each object. Otherwise, only the list of matching objects (without their attributes) will be displayed.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

The example below uses the default Collection (found in the /etc context), would be:

Sets the default placement for objects of the class named in <class LOID> or <class context name> to the given host/vault pair. Default placement is used when a class has no associated Scheduler object or cannot contact its associated Scheduler object. When a default placement is set the user should take care to ensure that an implementation for the default placement host's architecture is available.

This commands sets the Scheduler named in <Scheduler LOID> or <Scheduler context path> for the class named in <class LOID> or <class context path>. This will be the default scheduler for that class. The class will then use the scheduler to determine which hosts and vaults should manage its instances (i.e., determine placements for the class's instances).

This command can be used to set a class object's policy for using its default scheduler. See also legion_set_scheduler.

The legal values for <policy> are:

0

This policy value specifies that the class named in <class LOID> or <class context path> should use its default scheduler if the scheduler is currently active. It is intended to protect bootstrap classes, which may be involved in activating Schedulers and Scheduler helper objects. Typically, this policy is not recommended for user class objects.

This policy value specifies that the class should always use its default Scheduler, even if the Scheduler is not active. This is recommended for user classes, which usually require help from a Scheduler object when making placement decisions.

Set a virtual host object's architecture. A virtual host object lives on host A (the physical host) but actually represents host B (the virtual host). If the legion_set_varch command is not run, Legion will assume that the virtual host object's architecture is the same as its physical host.

This command configures a virtual host object. A virtual host object lives on host A (the physical host) but actually represents host B (the virtual host). Running this command indicates where the physical host can find scripts for starting and managing jobs on the virtual host. The <path> parameter is the local path for those scripts.

To configure a T3E virtual host object, you could run something like this:

You can use the -a, -d, and -t flags more than once when running the command but regardless of how you list them on the command line Legion will process them in a specific order when you run the command: first adding any new hosts, then deleting old hosts, then testing any hosts, and finally printing out the results. Note also that if you give the vault's context name in the first parameter (i.e., with the -c flag) you must use the hosts' context names in the <host1>, <host2>, ...<hostn> parameter. Similarly, if you give the vault's LOID (with the -l flag) you must use the hosts' LOIDs. In other words, if you were to enter:

$ legion_vault_host_list -c /vaults/VaultName \
-t 1.01.07...

You would get an error message. Legion will treat the host's LOID as a context name.

Checks the status of the key elements of your Legion system: LegionClass, host objects, root context object, etc. The output will include a summary of warnings and errors currently running in your system.

The following options are supported:

-v

Run the command in a verbose mode.

-q

Run the command in a quiet mode, i.e., print only the summary of warnings and errors.

This command returns a specified object's host and vault object. That is, the output gives the context path of the host and vault objects where the object and the object's persistent state are located. If the host or vault objects have been assigned aliases Legion will randomly return one of the context paths. Your output will look something like this:

Adds an access control list to the object named in <object LOID> or <object context path> or, if no object is named, the current environment. This command resembles legion_set_acl, but it merges in a new access control list. For example, if the current access control set contains access control lists for methods A and B of class XYZ's instances, adding new access control lists for class XYZ's methods B and C will not change A, replace B, and add C.

Add an implicit parameter to the AuthenticationObject named in <AuthenticationObject LOID> or <AuthenticationObject context path> or, if no AuthenticationObject is named, the current environment. The arguments take the same input format as legion_set_implicit_params. New parameters merge into the existing implicit parameter set (i.e., new parameters override old ones of the same name). There is no way to remove or unset selected implicit parameters.

Changes an object's read, write, and execute permissions so that you can allow the user or group named in <group/user context path> to use the object named in <target context path>. This tool manipulates an object's access control list (ACL) so that other users can call methods on your objects. For our purposes, "read" methods are defined as methods that obtain but do not modify an object's state, "write" methods are methods that modify an object's state, and "execute" methods are methods that run an object.

This command works on common Legion object types: context, file, class, tty, implementation, host, and vault objects all fall into this category.

The following optional parameters are supported:

-r

Deny read permissions to the target object.

+r

Grant read permissions to the target object.

-w

Deny write permissions to the target object.

+w

Grant write permissions to the target object.

-x

Deny execute permissions to the target object (note that this option is for class objects only).

+x

Grant execute permissions to the target object (note that this option is for class objects only).

This command is actually a simple wrapper around the legion_create_user_object command. The full command give more control to the creation of AuthenticationObjects.

The user id is the context name of an AuthenticationObject: the legion_create_object utility creates the object and assigns it the context name given in <user id>. The command will prompt for a password for the new user, and will return the new object's LOID. Note that the context in which the user id is placed has nothing to do with that user's privileges in that context. Once a user is created, the legion_login command is used to log in.

Creates a new object to represent a new Legion user id. The new object can be an instance of the AuthenticationObjectClass or another class that implements AuthenticationObjects.

The following optional parameters are supported:

-h <host for new object>

Specify where the new object should be created.

-v <vault for new object>

Specify which vault should store the new object's persistent state.

-f <implicit parameter file>

This option names a file containing implicit parameters to be stored in the newly created AuthenticationObject (handed out on legion_login). The filename can be "-", in which case the command reads the parameters from the standard input.

Note that these are *not* the implicit parameters that control the behavior of the new AuthenticationObject. Upon login, the user's environment will be set to contain the latter set of implicit parameters, and they will affect the creation of all subsequent objects.

This option is intended to make it easier to administer the system. In particular, admin can create user accounts that include implicit parameters that by default give the admin access rights to all of the users' subsequently created objects.

-z <password>

Include the user id's password in the command line arguments. This option is not recommended for casual use, as the password is potentially visible to other users in the system while the command is executing.

Returns the access control list of the object named in <object LOID> or <object context path>, or, if no object is named, the default access control set associated with the current logged-in Legion session. This command returns 2 as its exit status if the object/session has no access control list.

Get the implicit parameters of the object named in <object LOID> or <object context path>, or, if no object is named, the current logged-in Legion session. The former is analogous to looking in a Unix .profile or .cshrc for which environment variables get set at login and the latter is analogous to Unix printenv.

Creates the initial user (called by default /user/admin) in a new Legion system. This command should be run immediately after legion_initialize when you are starting your system. The script creates a new context called /users, a new user object called admin. The context name admin is placed in the new /users context. You will be asked to give a password. You can change the admin's password with the legion_passwd command.

After running legion_init_security you must login as admin in order to use the system. Use the legion_login command, with /user/admin as the <user name> parameter. This command only needs to be run once, when the system is first started. Only one /user/admin should exist in a system.

Allows user to log in to the Legion system as a user, and sets up implicit parameters and security credentials for the user. Note that the command can be run without any arguments (although it will prompt for a user name if a user LOID or user id is not given). User names are context names for AuthenticationObjects (special objects that contain a user password, initial implicit parameters, and other information), created with the legion_create_user command. On a successful login, a credentials file (a user read-only file) is created in the local /tmp directory. The user's shell must be able to see the file, so that his/her command-line utilities can use it. The file will be removed when the user logs out with legion_logout.

This logs out a user out of Legion. This command removes the credentials file that is created by the legion_login utility and has the effect of logging the user out of a secure Legion system.

We strongly recommend that users insert this command into a .logout file or some other script that is run when a user logs out. This ensures that credential files do not remain in the system for unnecessarily long periods.

Sets the access control list of the Legion object named in <object context path> or <object LOID>. The default will set the access control set for the current environment. The input file should be an implicit parameters file (see $LEGION/src/UserObjects/Security/SampleImpli-citParams for an example). The implicit parameters file will be scanned only for access control information pertaining to the specified object or environment; all other entries in the file will be ignored. This access control list is inherited objects newly created in the current login session (it roughly corresponds to a Unix umask).

Set the implicit parameters of a specified AuthenticationObject or, if no object is named, the current environment. Any parameters that were previously set are cleared. These are the parameters that the user inherits when he logs into Legion--they are passed along as different Legion commands are executed and are similar to environment variables that user might set up in a Unix .profile of .cshrc file. If no AuthenticationObject is specified, the current Legion login session's implicit parameters are modified (the changes will not persist to the next login session). The command reads the implicit parameters from a file (or the standard input). A sample file can be found in $LEGION/src/UserObjects/Security/SampleImplicitParams.

This command generates Legion stub files for CORBA input IDL files. Optional flags allow you to include information about the preprocessor and the back end and to specify whether or not trans code, client stubs, and head files should be created. If you run the command with no flags, Legion will generate client-side and server-side stubs. For example:

$ legion_generate_idl your_file_in.idl

On the other hand, the example below will generate client-side stubs, a trans file, and header files.

$ legion_generate_idl -trans -client_stubs -header your_file_in.idl

The following options are supported:

-A...

Provide an implementation-specific escape.

-D<name>

Define a name for the preprocessor.

-E

Run the input file on the preprocessor only, print results to stdout.

-Idir <directory name>

Specify a directory to included in the search path for the preprocessor.

-U<name>

Undefine a name for the preprocessor.

-v

Run the command in a verbose setting. This will show the compilation stages.

Executes java applications that use the Legion-Java interface. The command relies on the ability to call other Legion command-line tools, so it should be run only on machines that have Legion-supported platforms and have Legion installed and running. Note that you must include $LEGION/src/Java/client in your CLASSPATH environment variable in order for the command to run correctly.

The <java options> argument can include any command-line options accepted by the locally installed "java" interpreter. This set of options will always include the Java class to be executed.

Compiles programs on a remote host. The command tars your current directory, copies it to a remote host, untars it, and executes a make command. The resulting compiled binaries can be registered with Legion via the directory's makefile or can be copied back to your current directory with one or more -OUT options. Be aware that legion_makewill tar everything in and below your current directory, so be sure that you are in the correct directory before running it.

If no remote host or architecture is specified (with the -h or -a flags) the command will run on a random host. For example, the following command would build the tar file on a random Alpha Linux host:

$ legion_make -a alpha_linux

To be more specific, use the -h flag:

$ legion_make -h /hosts/HostFoo

The following options are supported:

-v

Run in verbose mode (up to four of these flags may be used).

-a <architecture>

Specify what kind of platform should be used to execute the command.

-h <host context path>

Specify which host should execute the programd.

-e <make command>

Specify an executable command (other than make) to be run on the remote host

-OUT <result file>

Specifies the local path name of a file that should be copied out of the remote program's current working directory after the program terminates. The default setting does not copy anything back to your current directory.

<arg1> <arg2> ... <argn>

Optional arguments passed to the make commands: they can specify make targets or other build parameters.

This command compiles Legion stubs and implementation code of CORBA client and server classes. The resulting binary executable files can be run in Legion systems. You can use the -run option to compile and execute your code in one step. Unless specified, Legion will compile client-side and class code and will register the resulting binary executable files with Legion (with legion_mplc_reg_impl).

The following options are supported:

-notrans

Make client-side code only.

-noclient

Make class code only.

-v

Run command in verbose mode.

-noreg

Specify that the resulting binary executable should not be registered with Legion.

-s <suffix string>

Attach a suffix to the client and/or class names (i.e., a date, run number, etc.).

-run

Run the application in Legion. Note that this will override the -noreg option.

Compile a program on multiple platforms. Like the legion_make command, this tars the current directory, copies it to a remote host, untars it, and executes a make command on it. The resulting compiled binaries can be registered with Legion via the directory's makefile. Optional flags let you specify different architectures and make commands.

The following options are supported:

-v

Verbose mode. Print actions as command executes.

-a <architecture>

Specify an architecture on which to run make. This option can be specified multiple times to request concurrent builds on multiple platforms. If no architectures are specified, a remote make for the current architecture ($LEGION_ARCH) is performed.

-e <make command>

Specify the make-command for the remote build (default is "make").

<arg1> <arg2> ... <argn>

These optional arguments are passed to the remote "make" command. They can specify make targets or other build parameters.

Compiles MPL (Mentat Programming Language) programs. There are several possible parameters to this command: please see the MPL Manual for more information (the MPL Manual is available from the Legion web site at http://legion.virginia.edu).

Registers the given binary, named in <binary path>, as a stateful, stateless, or sequential Mentat object for the architecture named in <arch&gt; and under the class object named in <class name>. This command is automatically run when you use the legion_mplc command (without the -nolegion option) to compile an MPL program.

In the example below, MentatObject is a stateful Mentat object in the local path /home/legion/bin on a linux or alpha_linux machine. To register it as belonging to a class with the context path name /ClassObject/MentatObject in linux or alpha_linux architectures, you would enter:

This command uses a special output device for debugging and information reporting. When output is sent using this mechanism, the object(s) will decide whether that type of information is to be displayed and where to display it. Users will be given a series of options to selectively filter what output is displayed to the screen. The output levels include:

There are two ways to use this command. You can dynamically change which of a specified object's output types are filtered out and which are displayed. This option also allows the user to change the location of the output (from stderr, stdout, and any Unix file they want).

Or, you can use the StartupState option, in which case the command will print instructions for bringing up a new system with the desired output state.

Please note: if you use StartupState, legion_output_state does not contact Legion and therefore does not run as a Legion program. I.e., you can execute it outside of a running Legion system. Otherwise, it runs as a normal Legion command-line tool.

Executes the application named in <client application> in record mode so that it can later be played back with the legion_replay tool. All objects started by the application will record all relevant event activity in a local file, named in <local storage file name>, or in a previously started Legion recorder object, named in <recorder context path> (see below). The utility also monitors the application and reports if it dies. Any application can be started with legion_record, but the command is most useful for Legion applications.

Only one execution of the application will be recorded in the storage file at a time. If you record again to the same storage file you will overwrite previous data.

If you wish to use a Legion recorder object to record your application's activity, you must start the recorder object separately (i.e., legion_create_object -c /class/RecorderObject).

If you wish to record a server object (i.e., one that is not created by the client application, but instead exists on its own), you must start the server object in record mode independently of the client application.

The following options are supported:

-name <session name>

Specify a name for the debug session. If this option is not used, a random name will be chosen.

-t <interval>

Specifies how much time (in seconds) the legion_record utility waits between health checks on its objects. These health checks are used to poll the recorder object to learn about object death. The default setting is 30 seconds.

Begins a replay or playback session for a recorded object. This command is used in tandem with the legion_record tool to debug a particular application. The legion_replay tool starts a debugging session for an object started in the application. If used with the -list option, the command returns a list of the sessions stored in the storage file, the session number for each object that was started, and the final states of the objects. These session numbers can then be used to debug the objects one at a time, by rerunning the command with the correct session number.

The following options are supported:

-list

Display the sessions in the storage file.

-cmd <debugger name>

Specify a debugging program (i.e. gdb, xdb, etc.) to run on the storage file. Default is gdb.

-local

Indicates that the debugging session should be replayed on your local machine. The default will start a remote session on the machine which executed the original object.

Creates additional MPL stateless object workers. By default, when a stateless class is created or registered in context space it instantiates a single worker. That worker is used by all other objects wishing to call a remote method invocation on that class. Adding more workers allows message calls to be handled more efficiently.

The <class name> parameter should be the stateless class object's context name. The <worker name> parameters should be the desired context name of the new worker objects. Note that you can use full or relative path names.

This command configures stateless Legion classes so that requests sent to a stateless class are first routed to a proxy object, which selects a worker to service the requests. You can use flags to control the number of replica workers, their placement, and the number of work requests that a worker may service at a given time.

The current version of the proxy object uses a self-scheduling algorithm. When N work requests have been farmed out, the proxy will store any pending requests in an internal queue: when a worker is available, the proxy assigns it a request from the queue. N here is given by the following formula:

N = <number of replicas> * <max number of workers>

The following options are supported:

-n <number of replicas>

Specify the number of workers to be used. Default is 1.

-Ch <context containing list of hosts>

Name a host where the work requests should be executed.

-w <max number of work requests>

Specify the maximum number of work requests that each worker should service at a time. Default is 5.

Removes MPL stateless object workers. The <class name> parameter should be the stateless class object's context name. The <worker name> parameters should be the context name of the unwanted worker objects. Note that you can use full or relative path names.

This command, similar to the Unix ld command, links together a set of object files and libraries to produce an executable program. The legion_link command automatically binds the produced executables to the Legion libraries. It can be used with object files and libraries created from C, C++, or Fortran source code. If any Fortran object files are linked, the -Fortran flag must be included.

The following options are available with this command:

-CC <compiler>

Select a C++ compiler to perform linkage. The default value is based on the default compiler used by the Legion system on your platform.

-Fortran

If any Fortran object files are linked, the -Fortran flag must be included.

-pvm

Link the produced executable to the Legion PVM compatibility library.

-mpi

Link the produced executable to the Legion MPI compatibility library.

-l<library path>

Include the in the set of directories searched for libraries.

-l<library>

Link against the specified library.

-v

Provide a verbose output as the command is running

-o <output path>

Specify the local path of the resulting program. The default is a.out.

-bfs

Link the produced executable to the Legion Basic Fortran Support (BFS) library.

A utility program that allows the user to examine the state of MPI objects and print out their message queues. This is a handy way to debug a deadlock.

There are a few limitations in legion_mpi_debug: If an MPI object doesn't respond, it will hang, and it won't go on to query additional objects. An MPI object can only respond when it enters the MPI library; if it is in an endless computational loop, it will never reply.

MPI implementation generally require that MPI executables reside in a given place on a disk. Legion's implementation objects have a similar requirement. The legion_mpi_register command registers the executables of different architectures for use with Legion's MPI. The command creates MPI-specific contexts, a class object, and an implementation for the program, and registers the name in Legion context space. If Legion security has been enabled the newly created contexts will be placed in the user's /home/<user_name>/mpi context except if the user is the admin or not logged in. If Legion security has not been enabled, the newly created contexts will be placed in the /mpi context.

The command can be executed several times, if you have compiled your program on several architecture.

Starts an MPI program. Note that if the -f flag is used, the -n flag, program name, and any <arguments> will be ignored. Any <flags> used with -f will be treated as defaults and applied to all processes executed by this command, unless otherwise specified in the options file. The legion_mpi_run utility will expect one binary per line in the options file, each line including any necessary arguments as they would appear on the command line. Each line can also contain any of the legion_mpi_run flags except the -f flag.

If the -f flag is not used, the MPI application named in the legion_mpi_run command will then be started with the given flags.

The <command> argument is the Legion context name for the class created by legion_mpi_register.

If you use either the -HF or -hf flag you must create a list of hosts. List one host and one optional integer (indicating the number of objects the host can create--default is 1) per line. List the host by its Legion context name. A host can be listed multiple times in one file, in which case the integer values accumulate. E.g.:

Allows userse to run multiple MPI binaries with a common MPI_COMM_WORLD.

-n <number of processes>

Specify the number of hosts on which the program will run.

The following optional <flags> are supported:

-h <host set context path>

Specify the set of hosts on which the program will run. The context path should not resolve to a particular host but to a context containing the names of one or more hosts. The default setting is the system's default placement: i.e., the system will pick a compatible host pick and try to run the object. If it fails the system will try another compatible host.

-Ø <legion context name>

Runs the first process (i.e., process zero) on this node (note that this flag is a zero, not a capital "o")

-p <PID context>

Specify a name for PIDs. Default is /mpi/instances/program_name. If the context does not exist it will be created.

-S

Print statistics at exit

-v

Verbose option. Up to four of these may be used to specify increasing levels of detail.

-d <Unix path name>

Specify that all children change to the specified directory before they begin to run.

-D <variable_name>=<value>

Set the environment variable named in <variable_name> to a specified value on all MPI processes after they have called MPI_Init(). This option may be repeated multiple times to set additional environment variables.

-HF <local file name;

Reads the local file named in <local file name>. This file must contain a list of hosts and optional integers indicating the number of Legion objects that can be scheduled on those hosts. You must use a specific format when creating this file (see above for an example). This list is then used for scheduling the objects from the current execution of a Legion MPI program. All of the objects from this Legion MPI run will be created using vector creates.

-hf <FileObject context path>

Reads the Legion FileObject named in <FileObject context path>. This file must contain a list of hosts and optional integers indicating the number of Legion objects that can be scheduled on those hosts. You must use a specific format when creating this file (see above for an example). This list is then used for scheduling the objects from the current execution of a Legion MPI program. All of the objects from this Legion MPI run will be created using vector creates.

-debug

Catch and print Legion exceptions.

-help

Print command syntax and exit.

An example, here running MPI program "vdelay" on two hosts, would be:

$ legion_mpi_run -n 2 /mpi/programs/vdelay

You can examine the running objects of your application with

$ legion_ls /mpi/instances/program_name

This context will have an entry for each object in your application.

There is a set of special legion_mpi_run flags that can be used when running in a fault tolerant mode (please see section 10.10 on page 51 in the Basic User Manual). These flags are used in specific combinations. You must use the -ft in all cases and you must use either -s or -R. The -g and -r flags are optional.

-ft

Turn on fault tolerance.

-s <checkpoint server>

Specifies the checkpoint server to use.

-g <pingInterval>

Ping interval. Default is 90 seconds.

-r <reconfigurationInterval>

When failure is detected (i.e. an object has not responded in the last <reconfigurationInterval> seconds) restart the application from the last consistent checkpoint. Default value is 360 seconds.

Register a native MPI program with your Legion system. The example below registers /myMPIprograms/charmm (the binary path) as using a Linux architecture.

$ legion_native_ mpi_register charmm /myMPIprograms/charmm linux

You can run register a program multiple times, perhaps with different architectures or different platforms. If you have not registered this program before, this will create a context in the current context path (the context's name will be the program's class name -- in this case, charmm) and registers the name in Legion context space.

Start a native MPI program. The following parameters are used for this command:

-h <host context path>

Specify the host on which the program will run. The default setting is the system's default placement, which is to pick a compatible host and try to run the object. If the host fails, the system will try another compatible host.

-v

Verbose option.

-a <architecture>

Specify the architecture on which to run.

-IN <local input file>

Specify an input file that should be copied to the remote run from the local file system.

-OUT <local result file>

Specify a result file that should be copied back from the remote run to the local file system.

-in <Legion input file>

Specify an input file that should be copied to the remote run from the Legion context space.

-out <Legion result file>

Specify a result file that should be copied out from the remote run into Legion context space.

-n <nodes>

Specify the number of nodes for the remote MPI run.

-t <minutes>

Specify the amount of time requested for the remote MPI run. This option is only meaningful if the host selected to run the remote program enforces time limits for jobs.

Registers a PVM task implementation. This setup is not necessary for tasks that will only be started from the command line (tasks that will not be "spawned"). Given the class named in <class path name>, the binary named in <binary local path register>, and the architecture type (currently Linux, Solaris, or SGI), this command creates an implementation object that can then be used by the Legion PVM Library.

Once you've registered an application, you can run it. If necessary, you can examine Legion context space with either

$ legion_ls /pvm

to list the Tids of running PVM tasks, or

$ legion_ls /pvm/tasks

to list the registered task classes. You can also use Legion class utilities to examine the class state (e.g., legion_list_instances).

This command allows uses to register a non-Legion executable program (specified by the <executable path> argument) and make the program available for use within the Legion system. The registered program will be associated with a Legion class object, named in <program class>: the class and the context path will be created, if the class was not already created by a previous execution of legion_register_program. The registered program will execute only on hosts of the architecture specified in .

Programs registered through legion_register_program can be executed with the legion_run command. See also legion_register_runnable for information about registering Legion programs.

The following parameters are used with this command:

<program class>

The Legion context path name of the class with which the registered program should be associated

<executable path>

The local file path of the executable program to register. This can be any program that could be run from the shell command prompt, including scripts, and binary executable generated by any programming language.

The legion_register_runnable command is similar to the legion_register_program command in that it allows programs to be registered for execution through the legion_run utility. However, whereas the legion_register_program tool is used to register non-Legion programs, legion_register_runnable is used to register programs that are linked against the Legion libraries and export the "runnable" object interface.

The following parameters are used with this command:

<program class>

The Legion context space path of the class with which the registered program should be associated

<executable path>

The local file path of the executable program to register. This program should be a valid Legion object implementation that has been linked with the Legion library, and that exports the Legion "runnable" interface.

The legion_run command executes a single instance of a program associated with the program class specified in the <program class> argument. The command will randomly select a host to execute the program (observing the restriction that only hosts with an acceptable architecture may be selected). The user can specify the host's architecture with the -a flag. If the desired platform type is unavailable the command will fail and return an error message. Support for directing scheduling (e.g. selecting a given host for remote execution) will be added in future releases. Arbitrary command-line arguments may be specified for the remote program.

Note that any number of input and output files may be specified for a single execution of legion_run (i.e., the -in/-out and -IN/-OUT options can be repeated). The -f flag can be used to specify legion_run options in the file named in <options file>, rather than on the command line.

The following parameter is used with this command:

<program class>

Specifies the program class of which an instance should be executed. This program class should have been previously created with the legion_register_program or legion_register_runnable command.

The following optional parameters are supported:

-w

Directs legion_run's output to your current tty object. If you have not created and set a tty object for your current window you will not be able to see any output and an error message will appear.

-v

Run command in verbose mode.

-a <architecture>

Allows users to specify what kind of architecture the program should be executed on.

-h <host context path name>

Specify which host should execute program.

-in <context path name>

Context path of a Legion file object whose contents should be copied into the remote program's current working directory before execution begins. The local file will have the same name as the <context path name> basename.

-out <context path name>

Context path of a Legion file object whose contents should be copied out of the remote program's current working directory after the program terminates. The local source file will have the same name as the <context path name> basename. Note that output files are copied out regardless of the cause of program termination. Partial results will be available if the program crashes. Output files that are not found in the program's current working directory are skipped.

-IN <local file name>

Similar to the -in option, but operates on a file in the local execution environment of legion_run (i.e., the file named in <local file name>).

-OUT <local file name>

Similar to the -out option, but operates on a file in the local execution environment of legion_run (i.e., the file named in <local file name>).

-f <options file>

Allows users to specify options for running legion_run in a separate file rather than listing them on the command line. This is useful for programs that make extensive use of the -in/-out or -IN/-OUT options. The file can contain one or more options, delimited by spaces, tabs, or blank lines. The program class name and arbitrary command-line arguments may not be included in this file. No other information should be included.

-t <minutes>

Specifies the amount of time (in minutes) needed to run the program. If this option is not used, the host will assign the job its default time block. This option is only meaningful if the host selected to run the remote program enforces time limits for jobs: otherwise this option is not required.

-n <nodes>

If the remote program is a native parallel job (e.g., a program written to use the local vendor MPI implementation), use this option to specify the number of nodes that should be allocated to the job. This option is not meaningful if the host selected to run the remote program is a uniprocessor or does not support multi-node allocations.

This program runs a previously registered serial program, named in <program class name>, using each of the input files named in a simple specification file, named in <specification filename>. The specification file describes the names of the expected input and output files.

The specification file might look something like this:

IN in.dat in.dat.*
constant const.dat
OUT out.dat

In this example, IN identifies the line as a description of the input files (so it is a keyword). in.dat is the file name that the serial program expects for its input file. The final string, in.dat.*, is a pattern that the command will use to match all the different input files in the current directory that will be individually fed to different runs of the serial program. The constant keyword names a single input file that is fed to each run. OUT is a keyword indicating the output file specification, and out.dat is the name of the output file from the serial program. If in.dat.123 is an input file, the command will direct the output to out.dat.123.

Note that if your program prints to standard output you must direct your output to a Legion tty object with the legion_tty_watch command (if you have not yet created a tty object, see the tty tutorial).

The following parameters are used with this command:

-n <number of processors>

Specify the number of processors used to run the program

-f <specification file name>

The Unix path name of the specification file

The following options are available with this command:

-s <schedule file name>

Specify a Legion schedule for running the program. The schedule contains a list of Legion host context names, followed by an integer specifying how many jobs can be run at once on a host (e.g., /hosts/Foo 3 to run up to three jobs on host object Foo).

-v

Provide a verbose output as the command is running (you can use up to four of these to get increasing levels of detail)

<arg1> <arg2> ... <argn>

Allows users to include arbitrary command-line arguments for the program