Skip main navigation

Execution and data model in MPI

In MPI, a parallel program is executed as a set of independent processes. Watch Jussi Enkovaara explain the execution and data model in MPI.
11.6
Let’s look briefly into execution and data model in MPI. In MPI parallel program is executed as a set of independent, identical process. That is, when program is launched for example with mpirun, the runtime creates N copies of the program which all execute the same program code. These processes are often called MPI tasks. How the N copies of the program can then perform different tasks? The MPI runtime assigns each process an unique id number which in MPI terminology is called rank.
54
The ranks start always from zero and go up to N-1. Based on the rank, the different processes can, for example, branch into different path of the program execution. Identical processes means thus that all the processes execute the same if statement, however, how they branch then depends on the rank. As the MPI tasks are process, they have their own memory space which are distinct from the other processes. Thus, the MPI tasks cannot directly access the data of the other tasks. In MPI, as the name message passing suggests, the tasks exchange data by sending and receiving messages. In the normal use case, the communication is two sided, there is always both sending and receiving involded, and sends and receives need to match.
108.3
To summarize, in MPI one launches multiple processes which all execute the same program code. Based on the rank, these multiple processes can perform different tasks. Processes communicate by sending and receiving messages.

In MPI, a parallel program is executed as a set of independent processes.

In this video we illustrate in more detail the execution and data model in MPI.

This article is from the free online

Python in High Performance Computing

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now