Table of Contents
What is a remote program?|
What kind of programs can Legion run?
Can Legion run only Legion-compatible
Registering Legion-compatible programs|
Running a remote program
Converting a C/C++ program
Running a remote program from the GUI
Other on-line tutorials & documentation
$ . ~legion/setup.sh or $ source ~legion/setup.csh
|Legion's remote execution allows users to run remotely executed programs from the Legion command line, taking advantage of Legion's distributed resources. The user's workload can be spread out on several processors, improving job turn-around time and performance. Users can execute multiple instances of a single program or execute several different programs in parallel.|
legion_register_program <program class> <executable path> <legion arch>The <program class> parameter is a context path name for the class that will manage Legion objects related to a particular program. Each user decides how to organize his or her own context space, so the path name can be whatever you find most convenient (although you might want to use the name of the program in the <program class> parameter, so that it will be easier to remember). The context path name can be new or can use a previously created path (if the user is registering multiple versions of the same program), and will refer to a (new or previously created) Legion object that functions as a proxy for executing a non-compatible remote program. Note also that if multiple programs are registered with the same program class and architecture, the most recently registered version will be used when the program is run on that particular architecture. Once the program has been registered, it can be run with the legion_run command. Note that you must reregister the program if you recompile it (Legion copies your executable to context space when you register it).
An example of this command might look like this:
$ legion_register_program myProgram /bin/programs/myProgram linux Program class "myProgram" does not exist. Creating class "myProgram". Registering implementation for class "myProgram" $
$ legion_register_program myProgram /bin/programs/myProgram linux Registering implementation for class "myProgram" $
legion_register_runnable <program class> <executable path> <legion arch>
$ legion_register_runnable myProgram /bin/programs/myProgram linux Program class "myProgram" does not exist. Creating class "myProgram". Registering implementation for class "myProgram" $
$ legion_register_runnable myProgram /bin/programs/myProgram linux Registering implementation for class "myProgram" $
Running a remote program
legion_run [-help] [-w] [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> [<arg1>, <arg2>, ... <argn>]
There are several optional parameters associated with this command. The -help flag displays the command's syntax and provides a brief description of how to use its options. The -w flag directs Legion to direct the command's output to your tty object. Note that if you have not created or set a tty object for your current window, you will not be able to see the command's output and an error message will appear. Use the legion_tty command to set a tty as an environmental variable:
$ legion_tty /context_path/mytty
The -a flag allows you to specify the type of platform the program requires. Note that the possible architectures are limited. At the moment they are:
|linux||corresponds to x86 running Red Hat 5.x Linux|
|solaris||corresponds to Sun workstations running Solaris 5.x|
|sgi||corresponds to SGI workstations running IRIX 5.x|
|alpha_linux||corresponds to DEC Alphas running Red Hat 4.x Linux|
|alpha_DEC||corresponds to DEC Alphas running OSF1 v4|
|t90||corresponds to Cray T90s running Unicos 10.x|
|rs6000||corresponds to IBM RS/6000s running AIX 4.2|
The -in <contex path name> option allows you to select a Legion file that should be copied into the remote program's current working directory before the program executes. The -out <context path name> option instructs Legion to copy the program's output from the remote program's current working directory to the Legion file named in <context path name>, after the program terminates (partial results will be available if the program crashes).
The other two options operate on a local file: -IN <local file name> tells Legion to copy the files named in <local file name> into the the remote program's current working directory before the program executes, and -OUT <local file name> tells Legion to copy the program's output to the file named in <local file name>.
Files that are listed with the -in/-out and -IN/-OUT options can be named with either full or relative path names. Note, however, that the remote program will use the file path's basename (i.e., as relative path names from the current working directory) to gain access to the named file. New files will be given names corresponding to the basename of the current Legion context path or local directory path.
The <arg1>, <arg2>, ... <argn> parameters are arbitrary command-line arguments.
If your program requires extensive use of these options you may want to use the -f flag, which allows user to list the options in a separate file rather than on the command line. The file can contain any of the options discussed above (except <program class> parameter or the [<arg1>, <arg2>>, ... <argn>] and can be delimited with spaces or new lines. (See also the makefile tutorial for information about using a makefile with legion_run and legion_run_multi.)
-lLegionRun -lLegion1 -lLegion2
$ legion_register_program cp /bin/cp linux Program class "cp" does not exist. Creating class "cp". Registering implementation for class "cp" $ legion_run -in /dir1/src -out /dir2/dest cp src dest $
The remote Unix program cp is first registered (with legion_register_program, since it is a non-Legion compatible program), and the program class "cp" is created in the user's local context, /bin/cp is declared to be its local executable path name, and linux is declared to be its architecture type.
The program is then remotely executed on a arbitrarily chosen linux host, and a series of events takes place: first, the -in option tells Legion to copy the Legion file /dir1/src into the remote program's cp's current working directory and call it src. The remote program cp then executes, copying src to a new Unix file, dest. Finally, once cp has terminated, Legion copies the contents of Unix file dest to a new Legion file called dest, and adds the context name dest to /dir2 (i.e., if the user runs legion_ls, dest will now be listed and will refer to the dest file).
Note that you can ask for multiple input and output files when you execute a program by repeating the -in/-out and -IN/-OUT options.
Go to the context containing the program class context name, and click the right mouse button on the icon representing the program class. A list of options will appear: click on the Run... option.
This will bring up a new window, which users should use to specify arbitrary command-line arguments for running the program and the context names of any input or output files (the -in/-out parameters). Users can use currently existing output files or create new ones. Users can also specify the program's architecture from a list of acceptable architectures at the bottom of the Run window: this list contains the names of the architectures that Legion currently accepts. The any option uses the default architecture.
A few caveats:
Other relevant on-line documents:
Other relevant on-line documents:
|Click on the to go to the page.|
Logging in to a running Legion system
Legion graphical user interface
Introduction to Legion context space
How to start remote programs in Legion
Sample makefile for remote programs
Adapting a parameter space study for Legion
Legion tty objects
Running a PVM code in Legion|
Running a Legion MPI code
Running native MPI code
Quick list of all Legion commands (1.6.4)
Usage of all Legion commands (1.6.4)
Starting a new Legion system
Using Legion security features
Legion host and vault objects
Adding host and vault objects
Brief descriptions of all on-line 1.6 tutorials
Last modified: Thu Jun 10 13:25:49 1999
[an error occurred while processing this directive]