Deprecated: please see new documentation site.


Contents


How to compile your MPI code

MPI codes can be compiled in the same way as serial codes, with the only difference being to use the compilers with a "mp" prefix. See Listing of Compilers and Libraries for details on the available compilers on LONI p575 systems.

Example:

mpxlf test_MPI.f90 -o test

How to run your MPI code

To run a MPI code, you have two options: run it interactively or submit it using a Loadleveler script.

For information on how to run interactively, see Using Poe and the Interactive Queue .

For information on how to write a Loadlevel script, see Submitting a Batch Job in LoadLeveler.

How to set up PE environment

Parallel Environment (PE) on AIX is an environment for the development of parallel applications written in MPI. It provides a great number of environmental variables to let users to control how parallel programs are executed. Below you can find a few of them that are most frequently used (and probably most useful). To set an environment variable, you can set it either as a shell variable or as a command line flag. For example, first 'export MP_RMPOOL=1' then executing the program is equivalent to executing the program with '-rmpool 1' at the command line.

MP_PROCS (-procs)

The number of program tasks.

MP_RMPOOL (-rmpools)

The name or number of the pool that should be used for nonspecific node allocation.

MP_NODES (-nodes)

To specify the number of processor nodes on which to run the parallel tasks.

MP_STDOUTMODE (-stdoutmode)

Sometimes it is nice to have the output in the order of processors. To do this, you need to set MP_STDOUTMODE=ordered (the default is MP_STDOUTMODE=unordered).

Example: Before MP_STDOUTMODE is set to ordered, the output looks like (note the output from process 2 is ahead of that from process 1):

lyan1@l1f1n01$ ./hello -rmpool 1 -nodes 1 -procs 4

Hello, world!
This is the master process.
The number of processes is 4
Normal end of execution.

Hello, world!
This is process 2

Hello, world!
This is process 1

Hello, world!
This is process 3

After MP_STDOUTMODE is set to ordered, the output changes to:

lyan1@l1f1n01$ export MP_STDOUTMODE=ordered
lyan1@l1f1n01$ ./hello -rmpool 1 -nodes 1 -procs 4

Hello, world!
This is the master process.
The number of processes is 4
Normal end of execution.

Hello, world!
This is process 1

Hello, world!
This is process 2

Hello, world!
This is process 3

Also, if for some reason you want the output from process 2 only, you can set MP_STDOUTMODE=2:

lyan1@l1f1n01$ export MP_STDOUTMODE=2      
lyan1@l1f1n01$ ./hello -rmpool 1 -nodes 1 -procs 4

Hello, world!
This is process 2

MP_LABELIO (-labelio)

When this variable is set to yes, the output from the parallel tasks is labeled by task id. The default is no.

lyan1@l1f1n01$ export MP_LABELIO=yes
lyan1@l1f1n01$ ./hello -rmpool 1 -nodes 1 -procs 4
  0: 
  0: Hello, world!
  0: This is the master process.
  0: The number of processes is 4
  0: 
  0: Normal end of execution.
  1: 
  1: Hello, world!
  1: This is process 1
  2: 
  2: Hello, world!
  2: This is process 2
  3: 
  3: Hello, world!
  3: This is process 3

MP_INFOLEVEL (-infolevel)

This variable controls the level of message reporting.

There are seven levels available (1 is the default):

0: error only
1: error and warning
2: error, warning and information
3-6: all for level 2 plus diagnostic messages for use by the IBM Support Center.


An example of output when MP_INFOLEVEL is set to 2.

lyan1@l1f1n01$ ./hello -rmpool 1 -nodes 1 -procs 4 -infolevel 2 \
               -stdoutmode ordered -labelio yes
INFO: 0031-364  Contacting LoadLeveler to set and query information for ...
INFO: 0031-380  LoadLeveler step ID is l1f1n01.6343.0
INFO: 0031-119  Host l1f1n01 allocated for task 0
INFO: 0031-120  Host address 208.100.64.13 allocated for task 0
INFO: 0031-119  Host l1f1n01 allocated for task 1
INFO: 0031-120  Host address 208.100.64.13 allocated for task 1
INFO: 0031-119  Host l1f1n01 allocated for task 2
INFO: 0031-120  Host address 208.100.64.13 allocated for task 2
INFO: 0031-119  Host l1f1n01 allocated for task 3
INFO: 0031-120  Host address 208.100.64.13 allocated for task 3
  0:INFO: 0031-724  Executing program: <./hello>
  1:INFO: 0031-724  Executing program: <./hello>
  2:INFO: 0031-724  Executing program: <./hello>
  3:INFO: 0031-724  Executing program: <./hello>
  0:INFO: 0031-619  64bit(ip)  ppe_rsan, rsan0537a MPCI shared object was ...
  0: 
  1:LAPI version #7.17 2005/08/15 1.157 src/rsct/lapi/lapi.c, lapi, ...
  3:LAPI version #7.17 2005/08/15 1.157 src/rsct/lapi/lapi.c, lapi, ...
  1:LAPI is using lightweight lock.
  3:LAPI is using lightweight lock.
  2:LAPI version #7.17 2005/08/15 1.157 src/rsct/lapi/lapi.c, lapi, ...
  2:LAPI is using lightweight lock.
  0:LAPI version #7.17 2005/08/15 1.157 src/rsct/lapi/lapi.c, lapi, ...
  0:LAPI is using lightweight lock.
  0:The MPI shared memory protocol is used for the job
  1:The MPI shared memory protocol is used for the job
  2:The MPI shared memory protocol is used for the job
  3:The MPI shared memory protocol is used for the job
  0:INFO: 0031-306  pm_atexit: pm_exit_value is 0.
  3:INFO: 0031-306  pm_atexit: pm_exit_value is 0.
  2:INFO: 0031-306  pm_atexit: pm_exit_value is 0.
  1:INFO: 0031-306  pm_atexit: pm_exit_value is 0.
INFO: 0031-656  I/O file STDOUT closed by task 1
INFO: 0031-656  I/O file STDERR closed by task 1
INFO: 0031-656  I/O file STDOUT closed by task 0
INFO: 0031-656  I/O file STDERR closed by task 0
INFO: 0031-656  I/O file STDOUT closed by task 2
INFO: 0031-656  I/O file STDERR closed by task 2
INFO: 0031-656  I/O file STDOUT closed by task 3
INFO: 0031-656  I/O file STDERR closed by task 3
INFO: 0031-251  task 0 exited: rc=0
INFO: 0031-251  task 1 exited: rc=0
INFO: 0031-251  task 2 exited: rc=0
INFO: 0031-251  task 3 exited: rc=0
  0: 
  0: Hello, world!
  0: This is the master process.
  0: The number of processes is 4
  0: 
  0: Normal end of execution.
  1: 
  1: Hello, world!
  1: This is process 1
  2: 
  2: Hello, world!
  2: This is process 2
  3: 
  3: Hello, world!
  3: This is process 3
INFO: 0031-639  Exit status from pm_respond = 0

References


Users may direct questions to sys-help@loni.org.

Powered by MediaWiki