|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?
What is native MPI?
- This command starts native MPI jobs on remote hosts. The syntax is:
[-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.
Can I run a Legion MPI program as a native MPI program?
- 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.
What are the prerequisites?
- Yes, but you cannot run a native MPI program as a Legion MPI program.
I need to call the Legion libraries: how do I edit my makefile?
- 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.
Why do I have to register my program with Legion?
- 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
$(CC) -g -I$(MPI_INC) -I$(LEGION)/include -D$(LEGION_ARCH) -DGNU \
$(LEGION)/lib/$(LEGION_ARCH)/$(CC)/libBasicFiles.so $> -o $@
How does this command work?
- 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.
Can I specify a host?
- 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.
- 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?
Can I use an options file?
- 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.
- No, this command doesn't use options files.