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 relevant on-line documents:
icon.
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
A quick list of just the commands' syntax is also available.
legion_exports_interface
{-l <LOID> | -c <context path>}
{-w <well-known class type> | -f <function signature>}+
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.
$ legion_exports_interface -c LegionClass -w ClassObject
1
$
$ legion_exports_interface -c /class/LegionClass -w CommandLineObject
"CommandLineObject" is not a well known class. Exiting.
usage: legion_exports_interface
{-l <class loid> | -c <legion space path>}
{-w <well known class type> | -f <function signature>}+
-1
$
$ legion_exports_interface -c LegionClass -w LegionClass -w ClassObject
1
$
$ legion_exports_interface -c /hosts/BootstrapHost -w UnixHostClass
1
$
$ legion_exports_interface -c /hosts/BootstrapHost -w ClassObject
0
$
$ legion_exports_interface -c /class/LegionClass \
-f " LegionLOID ping();"
1
$
$ legion_exports_interface -c /hosts/BootstrapHost \
-f " LegionLOID ping();" -w UnixHostClass
1
$
legion_get_interface {-l <class LOID> | -c <context path>}
This example returns the interface of the LegionClass (the metaclass for all Legion classes).
$ legion_get_interface -c class/LegionClass Getting the interface of object:1.01.01..000001fc0b325... Object Interface: void deactivate(); RestoreStateReply restoreState(); SaveStateReply saveState(SaveStateRequest); LegionLOID ping(); LegionObjectInterface getInterface(); int exportsInterface(LegionObjectInterface); int addAttribute(ObjectAttribute); int addAttributes(ObjectAttributeList); int replaceAttribute(ObjectAttribute, ObjectAttribute); int replaceAttribute_s(ObjectAttribute, ObjectAttribute); int replaceAttributes(ObjectAttributeList, ObjectAttributeList); int replaceAttributes_s(ObjectAttributeSignatureList, ObjectAttributeList); int removeAttribute(ObjectAttribute); int removeAttribute_s(ObjectAttributeSignature); int removeAttributes(ObjectAttributeList); int removeAttributes_s(ObjectAttributeSignatureList); LegionAttributeList retrieveAttributes(ObjectAttribute- List); LegionAttributeSignatureList retrieveAttributes_s(Object- AttributeSignatureList); LegionAttributeList retrieveAllAttributes(); $
legion_ping {-l <object LOID> | -c <context path>}
$ legion_ping -c foo Pinging: 1.01.66000000.14000000.000001fc0a72cd9e3... Returned: 1.01.66000000.14000000.000001fc0a72cd9e3... $
legion_list_attributes
{-l <object LOID> | -c <context path>} [-L] [<attribute name>]
| -L | Lists the LOID of each attribute |
| <attribute name> | Specify the attribute to be listed (more than one attribute can be listed) |
$ legion_list_attributes -c Foo
Foo:
(ALL)
Total attributes retrieved 1
favoritecolors('puce', 'apricot')
$
legion_list_invocations
{-l <object LOID> | -c <object context path>}
legion_object_info
{-l <object LOID> | -c <object context path>}
legion_update_attributes
{-l <object LOID> | -c <context path>}
[{-a | -d | -t} <attribute description>] [-u]
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 |
$ legion_update_attributes -c foo -a "favoritenames(bob, fred)" IN make_attr_from_input - favoritenames(bob, fred) ** ADDED 1 attributes(s) to object $
$ legion_update_attributes -c foo -d "favoritenames(bob)" IN make_attr_from_input - favoritenames(bob) ** WARNING - DELETED 0 attributes(s) from object instead of 1 specified $ legion_update_attributes -c foo -d "favoritenames(bob, fred)" IN make_attr_from_input - favoritecname(bob, fred) ** DELETED 1 attributes(s) from object $
legion_activate_object
{-l <object LOID> | -c <context path>}
legion_create_object
{-l <class LOID> | -c <class context path>}
<new object context path>
[-h <host name on which to place new object>]
[-v <vault on which to place new object>]
[-H <context path of preferred host class>]
[-V <context path of preferred vault class>]
[-Ch <context containing list of preferred hosts>]
[-Cv <context containing list of preferred vaults>]
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 (page 30 and page 31) 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 |
legion_create_object_r
{-l <class LOID> | -c <class context path>}
<context path> <host name> <host architecture>
<$LEGION> <$LEGION_OPR> <$LEGION_OPA> <binary path>
[<user id>]
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 |
| <binary path> | Binary executable path for the object on the remote host |
The optional parameter does the following:
| <user id> | Specifies the appropriate user name on the rsh host |
legion_deactivate_object
{-l <object LOID> | -c <context path>}
legion_destroy_object
{-l <object LOID> | -c <context path>}
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.)
legion_get_host {-l <object LOID> | -c <object context path>}
legion_get_vault {-l <object LOID> | -c <object context path>}
legion_list_implementations [-v] {-l <class LOID> | -c <class context path>}
The following option is supported:
| -v | Run the command in a verbose setting |
Note that if the -v flag is used Legion will use one extra method invocation per implementation object.
legion_list_instances {-l <class LOID> | -c <context path>}
$ legion_list_instances -c /class/BasicFileClass
Class 1.01.66000000..000001fc0d63e97... knows about the following instances:
LOID: 1.01.66000000.01000000.000001fc0a00...
Current oa : [xxx.xxx.xxx.xxx : 2020]
Current host : 1.01.07.30232908.000001fc0...
Current vault: 1.01.03.2e232908.000001fc0...
Status : object-running
LOID: 1.01.66000000.02000000.000001fc0edd...
Current oa : [xxx.xxx.xxx.xxx : 1895]
Current host : 1.01.07.31232908.000001fc0...
Current vault: 1.01.03.2e232908.000001fc0...
Status : object-running
$
legion_set_host {-l <object LOID> | -c <object context path>}
{-l <host LOID> | -c <host context path>}
In the example below, object Foo's host is changed from BootstrapHost to newHost.
$ legion_set_host -c Foo -c /hosts/newHost
legion_set_vault {-l <object LOID> | -c <object context path>}
{-l <vault LOID> | -c <vault context path>}
legion_add_class_mapping <metaclass LOID> <class LOID>
legion_combine_domains [-help] [-v] [-C <target domain context path>]
<OPR directory for target domain>
If other domains were previously combined with the current or target domains they will be connected to the new system as well.
Once the two domains have been joined, their objects can communicate with each other and with objects in any other domains in the multi-domain system. However, their context spaces will remain separate. Use the -C flag to avoid this: specify a name in your local domain's context space that can act as a root context for the target domain's context space. Note that if you use this option you must place a copy of the target domain's $LEGION_OPR/legion_context_env.sh configuration file in your local configuration directory (the directory named in the <OPR Directory for target domain> parameter). This file will be used to determined the target domain's root context's LOID.
The following options are supported:
| -help | Print information about using this command |
| -v | Provide a verbose output as the command is running. |
| -C <target domain context path> | Links the target domain's context space with your current domain's context space. |
The example below combines the current domain with net2:
$ legion_combine_domains -v ~/OPR-net2
Current Legion domain root:
Type 302 binding:[ 1.35d82a07.01..000001fc0c0e21f57326b6333
6de9fc4d88d7bf5a314d9f1df1079abb0938b29b3643e6c9a8413e
a6fd584f82be29b0ba56cdd0d421a609a4ba9ecf995c8ddb20b16d
6df : [128.143.63.51 : 19870 : 903621581 ] ]
Combined list of Legion 2 domain roots:
Type 302 binding:[ 1.c8.01..000001fc0a533f08413082b08857f28
3c8a0aa34193ea7478b2c608163414ca5f13939bb0e5d48788b543
d5fddd05e49735487150edf8256d78002bb04454da7eae82697 :
[128.143.63.52 : 16022 : 903624927 ] ]
Type 302 binding:[ 1.35d82a07.01..000001fc0c0e21f57326b6333
6de9fc4d88d7bf5a314d9f1df1079abb0938b29b3643e6c9a8413e
a6fd584f82be29b0ba56cdd0d421a609a4ba9ecf995c8ddb20b16d
6df : [128.143.63.51 : 19870 : 903621581 ] ]
Created 2 new domain interconnections.
$
legion_create_implementation
<binary path name> <architecture>
[-l <class LOID> | -c <context path>]
$ legion_create_implementation Legion/bin/linux/my_obj \
linux -c my_class
$
legion_init_arch
$ legion_init_arch
Initializing Legion implementations for "linux"
Creating an implementation (ContextObject) for ContextClass
Continue (y=yes, Y=yes to all, n=no, N=no to all, v=verbose,
V=verbose all)? Y
Creating an implementation (MetaClassObject) for LegionClass
Creating an implementation (ClassObject) for VanillaMetaClass
Creating an implementation (BindingAgent) for BindingAgentClass
Creating an implementation (BasicFileObject) for BasicFileClass
Creating an implementation (ttyObject) for ttyObjectClass
Creating an implementation (StatTreeObject) for StatTreeClass
$
legion_list_domains
legion_activate_instances
{-l <class LOID> | -c <class context path>}
legion_cat <context path>
$ legion_cat newFileObject This is a test, just a test, nothing more. $
legion_context_add <object LOID> <context name>
legion_context_create <context path>
legion_cp
[-help] [-r] [-v] [-m] [-p] [-localsrc] [-localdest]
[-V <vault context path>] <source file> <destination file>
The following optional parameters are supported:
| -help | Print this help message and exit. |
| -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. |
legion_deactivate_instances
{-l <class LOID> | -c <class context path>}
legion_destroy_instances
{-l <class LOID> | -c <class context path>}
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).
legion_direct_output {-l <LOID> | -c <object path>}
{-l <tty LOID> | -c <tty context path>}
legion_get_host {-l <object LOID> | -c <object context path>}
$ legion_get_host -c Foo
1.01.07.d49d1a40.000001fc0c04724...
$
legion_get_vault {-l <object LOID> | -c <object context path>}
$ legion_get_vault -c Foo
1.01.03.d49d1a40.000001fc0a69cbb8...
$
legion_import_tree [<unix directory path> [<legion context path>]]
legion_list_names {-l <object LOID> | -c <object context path>}
legion_ln <context path> <new alias>
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).
legion_ls [-laLRAdqvh] <context path>
$ 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. |
| -h | Print a help message for this command. |
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.
$ legion_ls -laA /hosts
. (context)
/hosts
.. (context)
/class/..
/hosts/..
/vaults/..
/home/..
BootstrapHost (object)
/hosts/BootstrapHost
/hosts/stonesoup01.cs.virginia.edu
stonesoup01.cs.virginia.edu (object)
/hosts/BootstrapHost
/hosts/stonesoup01.cs.virginia.edu
$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.
legion_mv <context path> <new context path>
legion_pwd
legion_rm [-r] [-f] [v] <context path list>
If the context path listed is the last (i.e., only) name mapped to a given object, the object will be destroyed. If there are other names mapped to the object, the object will be removed.
Optional parameters do the following:
| -r | Recursively remove one or more contexts and all of their contents. |
| -f | Force faulty objects (those with bad bindings) to be removed. |
| -v | Run this command in a verbose setting. This will indicate when objects are destroyed and when only names are being destroyed. |
legion_set_context <context path>
legion_set_tty <tty context path>
$ 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:
$ legion_create_object -c /class/ttyObjectClass /context_path/my-tty $ legion_set_tty /log-file
legion_tty <tty context path>
legion_tty_off
legion_tty_redirect <object context path>
legion_tty_unredirect <object context path>
legion_tty_watch [-l <tty LOID> | -c <tty context path>]
legion_create_class [-help] [-c <context path>]
[-sc <scheduler context path>] [-sl <scheduler LOID>]
| -help | Print out this help message and exit. |
| -c | Assign the new object the name given in <context path> |
| -sc <scheduler context path> | Specify the context path of the default scheduler object that the new class should use. |
| -sl <scheduler LOID> | Specify the LOID of the default scheduler object that the new class should use. |
legion_destroy_host [-help] [-v]
{-l <host LOID> | -c <host context path>}
| -help | Print a help message. |
| -v | Run in verbose mode. |
legion_destroy_vault {-l <vault LOID> | -c <vault context path>}
legion_initialize
legion_make_setup_script [-help] [-o <script basename>] [-OPR <OPR dir name>]
[-L <$LEGION dir name>]
The following options are supported:
| -help | Print a help message and exit. |
| -o <script basename> | 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. |
legion_print_config
legion_setup_state [-i]
The following optional parameter is supported:
| -i | Run the command in an interactive mode. |
legion_shutdown [-local] [-f] [-i] [-h]
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. |
| -h | Returns the command's complete syntax. |
legion_shutdown_class
{-l <class LOID> | -c <context path>}
legion_starthost
[-L <$LEGION>] [-O <$LEGION_OPR>] [-A <$LEGION_ARCH>]
[-B <path>] [-N <context name>] [-U <user id>]
<new host name> [<compatible vault list>]
| <$LEGION_OPA> | = $LEGION_OPR/Host-$HOST.OPA |
| <binary path> | = $LEGION/bin/$LEGION_ARCH/UnixHostObject |
| -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>") |
| -U <user id> | Specify the user id for host (default is current user id) |
legion_startup [-local]
The following optional parameter is supported:
| -local | starts up only a local host or vault |
legion_startvault
[-L <$LEGION>] [-O <$LEGION_OPR>] [-A <$LEGION_ARCH>]
[-N <context name>] [-U <user id>] <host name>
[<compatible host list>]
The following optional parameters are supported:
| -L <$LEGION> |
Specify $LEGION for the vaults host (default is "/home/Legion") |
| -O <$LEGION_OPR> |
Specify $LEGION_OPR for the vaults host (default is "/home/OPR") |
| -A <$LEGION_ARCH> |
Specify the architecture of the vaults host (default is current $LEGION_ARCH) |
| -N <context name> |
Specify the context name for the vault object (default is "/vaults/vault-<host name>") |
| -U <user id> |
Specify the user id to use on the vaults host (default is current user id) |
legion_class_host_list
[-l <class LOID> | -c <class context path>]
[{-a | -d | -t} <host1> <host2> ... <hostn>] [-p] [-u]
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 |
The example below adds a new host to the list of acceptable hosts of BasicFileClass, using the -a flag.
$ legion_class_host_list -c /class/BasicFileClass -a /hosts/newHost ** ADDED 1 host(s) to class's acceptable host set
$ legion_class_host_list -c /class/BasicFileClass -p ** ACCEPTIBLE HOST LISTING: ** 1.01.07.d59d1a40.000001fc094e23... $
$ legion_class_host_list -c /class/myClass -t 1.01.07.d59d...
legion_class_vault_list
{-l <class LOID> | -c <class context path>}
[{-a | -d | -t} <vault1> <vault2> ... <vaultn>] [-p] [-u]
| -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 |
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...
legion_config_scheduler
{-l <scheduler LOID> | -c <scheduler context path>}
[-get_enactor] [-get_collection]
[-set_enactor {-l <Enactor LOID> | -c <Enactor path>}]
[-set_collection {-l <Collection LOID> | -c <Collection path>}]
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 |
legion_get_candidate_hosts
{-l <object LOID> | -c <object context path>}
legion_get_candidate_placements
{-l <class LOID> <instance LOID>} | {-c <class context path>
<instance context path>} [<max placements>]
The output of this command lists the LOIDs of the instance (abbreviated as inst), host, implementation object (abbreviated as impl obj), and vault of each pairing. The instance LOID appears in each listed pairing.
The example below displays the list of pairings for instance Foo of class BasicFileClass. In this case, there are two possible vaults (BootstrapVault and NewVaultObject) but only one host (BootstrapHost): there are therefore two possible pairings, and two lists. The first pairing, of BootstrapHost and BootstrapVault, lists the LOID of Foo, BootstrapHost, BasicFileClass's implementation object, and BootstrapVault. The next pairing, of BootstrapHost and NewVaultObject) repeats the LOIDs of Foo, BootstrapHost, and the implementation object, and ends with the NewObjectVault's LOID.
$ legion_get_candidate_placements -c /class/BasicFileClass Foo
max = -99
ALL_PLACEMENTS = -99
Candidate Placements for Foo:
inst = 1.01.66000000.01000000.000001...
host = 1.01.07.d49d1a40.000001fc0c04...
impl obj = 1.01.08.d89d1a40.000... arch = 1
vault = 1.01.03.d49d1a40.000001fc0a6...
inst = 1.01.66000000.01000000.000001...
host = 1.01.07.d49d1a40.000001fc0c04...
impl obj = 1.01.08.d89d1a40.000... arch = 1
vault = 1.01.03.d69d1a40.000001fc0ac...
$
legion_get_candidate_vaults
{-l <object LOID> | -c <object context path>}
$ legion_get_candidate_hosts -c /vaults/NewVaultObject 1.01.07.d49d1a40.000001fc0c0472... 1.01.07.d59d1a40.000001fc094e23... 1.01.07.d69d1a40.000001fc0b6810... $
legion_host_vault_list
{-l <host LOID> | -c <host context path>}
[{-a | -d | -t} <vault1> <vault2> ... <vaultn>] [-p] [-u]
The following optional parameters are supported:
| -c | Use context paths to specify host and vault |
| -l | Use dotted hex LOIDs to specify host and vault |
| -a | Add named vault to the host's acceptable vault list |
| -d | Delete named vault from the host's acceptable vault list |
| -t | Test whether or not a vault is on the host's acceptable vault list |
| -p | Display the host's acceptable vault list |
| -u | Print usage |
To list the vaults that a host can operate on, for instance, you would type in:
$ legion_host_vault_list -c /hosts/HostName -p ** COMPATIBLE VAULT LISTING: ** 1.01.03.d49d1a40.000001fc0a69cbb845... $
$ legion_host_vault_list -c /host/HostName -t 1.01.03.d49...
legion_instance_host_list
{-l <LOID> | -c <context path>}
[{-a | -d | -t} <host1> <host2> ... <hostn>] [-p] [-u]
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 |
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...
legion_join_collection
{-l <Collection LOID> | -c <Collection path>}
{-l <member LOID> | -c <member path>}Use the legion_query_collection command to get information (in the form of object attributes) about the given collection.
legion_leave_collection
{-l <Collection LOID> | -c <Collection path>}
{-l <member LOID> | -c <member path>}
legion_list_oprs {-l <vault LOID> | -c <vault context path>}
legion_query_collection
{-l <Collection LOID> | -c <Collection path>} <query>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 option is 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. |
The example below uses the default Collection (found in the /etc context), would be:
$ legion_query_collection -c /etc/Collection true 2 hits: 1.36ab9e4a.03.01000000.000001fc099204... 1.36ab9e4a.07.01000000.000001fc0d6e07...
legion_vault_host_list
{-l <vault LOID> | -c <vault context path>}
[{-a | -d | -g} <host1> <host2> ... <hostn>] [-p] [-u]
The following optional parameters are supported:
| -c | use context paths to specify vault and host |
| -l | Use LOIDs to specify vault and host |
| -a | Add named host to the vault's acceptable host list |
| -d | Delete named host from the vault's acceptable host list |
| -t | Test whether or not a host is on the vault's acceptable host list |
| -p | Display the vault's acceptable host list |
| -u | Print usage |
To view the list of hosts that a given vault can operate on, you could use something like the example below.
$ legion_vault_host_list -c /vaults/VaultName -p ** COMPATIBLE HOST LISTING: ** 1.01.07.d49d1a40.000001fc0c04724... ** 1.01.07.d59d1a40.000001fc094e23c... ** 1.01.07.d69d1a40.000001fc0b68108... $
$ legion_vault_host_list -c /vaults/VaultName -t 1.01.07...
legion_check_system [-help] [-v] [-q]
The following options are supported:
| -help | Prints a help message. |
| -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. |
legion_classof
{-l <object LOID> | -c <context path>}
$ legion_classof -c Foo The class of 1.01.66000000.01000000.000001fc0... is 1.01.66000000..000001fc0d085b2c33... $
legion_create_stat_tree <base context path>
legion_host_stats {-l <host loid> | -c <host context path>}
legion_list_objects
{-l <host LOID> | -c <host context path>}
legion_version
$ legion_version VaL Legion version 1.3.5 $
legion_wellknown_class <wellknown class name>
legion_whereis
{-l <object LOID> | -c <object context path>}
$ legion_whereis -c Foo Host : /hosts/BootstrapHost Vault : /vaults/BootstrapVault $
legion_whoami
$ legion_whoami /users/nemo $

legion_add_implicit_params
[-l <AuthenticationObject LOID> | -c <AuthenticationObject context path>]
{-s | <filename>}
The following options are supported:
| -s | Read from stdin |
legion_change_owner [-h] [-v] [-r]
{-l <object LOID> | -c <object context path>}
{-l <target owner LOID> | -c <target owner context path>}
The following options are supported:
| -h | Print a help message |
| -v | Run this command in verbose mode |
| -r | Run this command in recursive mode. If the specified <object LOID> or <object context path> is a class, ownership of all instances, subinstances, etc. will change. If the specified <object LOID> or <object context path> refers to a context object, change ownership of all context entries, recursively applying the operation to sub-contexts will change. In either case, ownership of the root object referred to by <object LOID> or <object context path> is changed. |
legion_change_permissions [+-rwx] [-v] [-help]
<group/user context path> <target context path>
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). |
| -v | Run the command in verbose mode. |
| -help | Print a help message. |
legion_create_user <user id>
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.
legion_get_acl {-l <LOID> | -c <context>}
legion_get_implicit_params [-l <LOID> | -c <context>]
legion_init_security
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.
legion_login [-l <user LOID> | <user id>] [-e <command>] legion_login -x [-e <commands>]
The -e flag can be used to specify a different program to run with security credentials instead of a Unix shell. For example:
$ legion_login bob -e legion_ping -c bob
The -x flag can be used to start a subshell or (using the -e flag) to execute a command without the user's login privileges. This takes advantage of a side benefit of legion_login: command-line tools can use legion_login's special caching service to accelerate the execution of subsequent Legion commands. This service is available even if no credentials have been obtained from an authentication object. For example:
$ legion_login -x -e legion_ping -c bob
The following options are supported:
| -x | Run a command in a user's shell without the user's login privileges (i.e., do not login to an AuthenticationObject). Legion will not prompt for a password. |
| -e | Run the following argument as a command with a user's login privileges without creating a new shell. |
legion_passwd {-l <user LOID> | <user name>}
legion_set_acl {-l <object LOID> | -c <object context path>}
[-s | filename]
The following option is supported:
| -s | Read from standard input |
legion_set_implicit_params
[-l <object LOID> | -c <object context path>]
[-s | filename]
The following option is supported:
| -s | Read from standard input |
legion_bfs <file> [-o <out file>] [-BackEnd]
The following options are used:
| -o <out file> | Name of the file containing the resulting Fortran or MPL output |
| -BackEnd | Instructs the legion_bfs compiler to produce output for IDL files included in the Fortran input file (ignored when the input is a BFS IDL file) |
legion_generate_idl [<flags>] <input file local path>
$ legion_generate_idl your_file_in.idl
$ legion_generate_idl -trans -client_stubs -header your_file_in.idl
| -help | Print a help message and exit. |
| -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. |
| -w | Suppress any IDL compiler warnings. |
| -trans | Generate trans code. |
| -client_stubs | Generate client-side stubs only (i.e., not server-side stubs). |
| -header | Generate header files. |
legion_make [-help] [-v] [-a <architecture>] [-h <host context path>]
[-e <make command>] [-OUT <remote file>] [<arg1> <arg2> ... <argn>]
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
$ legion_make -h /hosts/HostFoo
| -help | Print a help message. |
| -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. |
legion_make_make_idl [-notrans] [-noclient] [-v] [-noreg] [-s <suffix string>] [-run] [-help] <application name>
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. |
| -help | Print a help message and exit. |
legion_make_multi [-help] [-v] [-a <architecture>][-e <make command>]
[<arg1> <arg2> ... <argn>]
The following options are supported:
| -help | Print a help message and exit. |
| -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. |
legion_mplc
legion_mplc_reg_impl <class name> <binary path>
<stateless | stateful | sequential> <arch>
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:
$ legion_mplc_reg_impl /ClassDirectory/MentatObject /home/legion/bin/MentatObject stateful linux
$ legion_mplc_reg_impl /ClassDirectory/MentatObject /home/legion/bin/MentatObject stateful alpha_linux
legion_java <java options>
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.
legion_stateless_add_workers <class name>
<worker name1> <worker name2> ... <worker nameN>
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.
legion_stateless_configure <stateless class context path>
[-n <number of replicas>] [-Ch <host context path>]
[-w <max number work requests>] [-FlUsH]
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>
| -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. |
| -update | Tell the proxy object that the worker interface has changed. |
| -Flush | Remove all work requests for this class. |
| -status | Display the command's status information (a tty must be on). |
legion_stateless_remove_workers <class name>
<worker name1> <worker name2> ... <worker nameN>
legion_link [-CC <compiler>] [-Fortran] [-pvm] [-mpi] [-L<library path>]
[-l<library>] [-v] [-o <output file>] [-bfs] [-help] <object file list>
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 |
| -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. |
| -help | Display the command's full syntax and options. |
legion_mpi_debug [-q] {-c <instance context path>}
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.
The following option is available with this command:
| -q | List the contents of the queues. |
legion_mpi_register
<class name> <binary local path name> <platform type>
The command can be executed several times, if you have compiled your program on several architecture.
legion_mpi_run
{-f <options file> [<flags>]} |
{-n <number of hosts> [<flags>] <command> [<arguments>]}
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.
The parameters used for this command are:
| -f <options file> | 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. |
| -h <host context path> | Specify the set of hosts on which the program will run (default is the system's default placement) |
| -Ø <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/instance/program_name) |
| -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. |
$ legion_mpi_run -n 2 /mpi/programs/vdelay
$ legion_ls /mpi/instances/program_name
legion_pvm_register
<class path name> <binary local path name> <platform type>
Once you've registered an application, you can run it. If necessary, you can examine Legion context space with either
$ legion_ls /pvm
$ legion_ls /pvm/tasks
To register a Linux binary named matmult in Legion, enter:
$ legion_pvm_register /pvm/tasks/matmult matmult linux
legion_register_program
<program class> <executable path> <legion arch>
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. |
| <legion arch> | The platform type that the program should be executed. |
legion_register_runnable
<program class> <executable path> <legion arch>
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. |
| <legion arch> | The platform type on which the program should be executed. |
legion_run [-help] [-w] [-v] [a <architecture>]
[-h <host context path name>]
[-in <context path name>] [-out <context path name>]
[-IN <local file name>] [-OUT <local file name>]
[-f <options file>] <program class>
[-t <minutes>] [-n <nodes>]
[<arg1> <arg2> ... <argn>]
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 parameters are 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: | |
| -help | Displays the command's syntax and provides a brief description of how to use its options. |
| -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. |
legion_run_multi [-v] {-n <number of processors>}
[-s <schedule file name>]
{-f <specification file name>} <program class name>
[<arg1> <arg2> ... <argn>]
The specification file might look something like this:
in in.dat in.dat.* out out.dat
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.
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 |
Alphabetical list of Legion commands