XL compilers and Parallel Environment
AbC 0600011S8J Visits (2710)
The IBM Parallel Environment program product (PE) is a distributed memory message passing system supported on AIX and Linux. This is a separate IBM product. For detail information, refer to http
PE is designed for developing and executing parallel Fortran, C, or C++ programs. PE supports the two basic parallel programming models – SPMD and MPMD. In the SPMD (Single Program Multiple Data) model, the same program is running as each parallel task. The tasks, however, work on different sets of data. In the MPMD (Multiple Program Multiple Data) model, each task may be running a different program.
Let’s talk about how XL compilers and PE work together to exploit the parallel computing environment. A set of invocation commands are provided in PE for compiling programs that are executed in the parallel environment. The invocation command invokes the XL compiler with specific options and links in special libraries (Partition Manager and message passing interface libraries) for executing in the environment. The name of these invocation commands starts with “mp”, for example, mpcc_r for C program, mpxlf90_r for Fortran program and mpCC_r for C++ program. For executing the program in the parallel environment, the poe command is also provided to invoke the Parallel Operating Environment (POE) for loading and executing programs on remote processor nodes.
We will walk thru a few steps with a simple program to illustrate how XL compilers and PE work together. In this example, we have a C program (main.c) that calls a Fortran procedure (arr_cal.f90) for computation and then print the result in main,
On AIX, the following commands are used to compile and link the program.
The executable can be executed on a cluster of machines by using poe command. Before using the poe command, a host file needs to be created to specify on which hosts the program is executed. In addition, the same directory (with the same absolute path as the current directory on the local host) has to be created on all the remote hosts.
The command to execute the program on the listed hosts is shown as follow:
The option –procs is to specify how many tasks are created. In this case, four tasks are created to execute the same program (test1) on different hosts as specified in the host file (host.list). What the mcp command does is to copy the executable to the remote hosts. The option –labelio specifies that the output from the parallel tasks is labeled by task id.
This example is a simple program to illustrate how the XL compilers work with PE. If you need to develop a program that exploits a distributed environment, PE is an essential tool. PE also provides a parallel debugger (pdb) for debugging parallel programs.