Legion: A Worldwide Virtual Computer
Home General Documentation Software Testbeds Et Cetera Map/Search

legion_native_mpi_run FAQ

1. What does this command do?[go]
2. What is native MPI?[go]
3. Can I run a Legion MPI program as a native MPI program?[go]
4. What are the prerequisites?[go]
5. I need to call the Legion libraries: how do I edit my makefile?[go]
6. Why do I have to register my program with Legion?[go]
7. How does this command work?[go]
8. Can I specify a host?[go]
9. Can I set a time limit?[go]
10. My program expects input files -- how do I get them to the remote host?[go]
11. My program will produce output files -- how do I get them back?[go]
12. Can I use an options file?[go]

What does this command do?

This command starts native MPI jobs on remote hosts. The syntax is:
legion_native_mpi_run 
         [-v] [-a <architecture>] [-h <host context path>]
         [-IN <local input file>] [-OUT <local result file>]
         [-in <Legion input file>] [-out <Legion result file>]
         [-n <nodes>] [-t <minutes>] [-legion] [-help] 
         <program context path> [<arg 1> <arg 2> ... <arg n>]
It is fully documented here.
What is native MPI?
There are two ways to run MPI programs on Legion: Legion MPI and native MPI. Legion MPI programs uses code adapted to run in Legion and to link to Legion libraries. They can only be run on machines with Legion binaries installed. A native MPI program does not need to be edited for or compiled in Legion, nor does it need to be linked to the Legion libraries (although you can if you wish). In other words, you can run any MPI program as native MPI without changing the program.
Can I run a Legion MPI program as a native MPI program?
Yes, but you cannot run a native MPI program as a Legion MPI program.
What are the prerequisites?
You need a working MPI program, previously registered in Legion with legion_native_mpi_register, and a Legion host. If your code makes Legion calls, you'll need to link your program to the Legion libraries in your makefile and use the -legion flags when running legion_native_mpi_run.
I need to call the Legion libraries: how do I edit my makefile?
You do not need to edit your makefile unless your program makes Legion calls (see section 10.2.5 in the Basic User Manual). If you do need to call the libraries, a sample makefile is below:
CC      =       mpiCC
MPI_INC =  /usr/local/mpich/include

mpimixed:       mpimixed.c
        $(CC) -g -I$(MPI_INC) -I$(LEGION)/include -D$(LEGION_ARCH) -DGNU \
             $(LEGION)/lib/$(LEGION_ARCH)/$(CC)/libLegion1.$(LEGION_LIBRARY_VERSION).so \
             $(LEGION)/lib/$(LEGION_ARCH)/$(CC)/libLegion2.$(LEGION_LIBRARY_VERSION).so \
             $(LEGION)/lib/$(LEGION_ARCH)/$(CC)/libLegion1.$(LEGION_LIBRARY_VERSION).so \
             $(LEGION)/lib/$(LEGION_ARCH)/$(CC)/libBasicFiles.so $> -o $@
Why do I have to register my program with Legion?
Native MPI implementations usually want MPI implementations to reside in a specific place on disk. When you register your executable, you are telling Legion where the executable is located, as well as its architecture and class name. You can register a program several times, with different architectures and platforms or just as you update the program.
How does this command work?
It is similar to legion_run: it copies the program and any input files to a remote host, starts the program, copies any output files back to your host or context space, then cleans up after itself on the remote host.
Can I specify a host?
Yes, you can use the -h flag to choose a host. If you do not use this flag, Legion will randomly select a compatible host and try to start your program. If the program fails, Legion will choose another compatible host and try again.

The -n flag specifies how many of the remote host's nodes should be allocated for running your program.

Can I set a time limit?

If the remote host enforces time limits for outside jobs, the -t flag specifies how many minutes the program needs to run.

My program expects input files -- how do I get them to the remote host?

You must make sure that these files are visible from either local file space or context space and you must use either -IN or -in to tell Legion to copy the contents of your input files to the remote host. The copied files will be placed in the local directory of the remote host and given the same file name. Once the program is finished, the copied files are deleted.

My program will produce output files -- how do I get them back?

Use either -OUT or -out to tell Legion to look for these files after the program has finished and to copy them back to your local file space or context space. If the program crashes midway through, any existing output files will be available.
Can I use an options file?
No, this command doesn't use options files.

Other FAQs

Last modified: Wed Jun 20 11:07:23 2001

 

[Home] [General] [Documentation] [Software]
[Testbeds] [Et Cetera] [Map/Search]

This work partially supported by DOE grant DE-FG02-96ER25290, Logicon (for the DoD HPCMOD/PET program) DAHC 94-96-C-0008, DOE D459000-16-3C, DARPA (GA) SC H607305A, NSF-NGS EIA-9974968, NSF-NPACI ASC-96-10920, and a grant from NASA-IPG.

legion@Virginia.edu
http://legion.virginia.edu/