MPI defines functions for parallel computing. Parallel computing refers to programs that can execute tasks concurrently in runtime environments that support the parallel execution of tasks. Such runtime environments are usually based on multiple processors. Because a single processor can only execute code sequentially, linking multiple processors creates a runtime environment that can execute tasks in parallel. If thousands of processors are linked, the result is a parallel computer – a type of architecture usually found only in supercomputers. MPI comes from the search to find methods for programming supercomputers more easily.
If you want to use MPI, you need an implementation of the standard. While MPI defines many functions, they are usually not supported by operating systems out of the box. For example, the desktop editions of Windows aren’t shipped with MPI support.
The most important MPI implementations are MPICH and Open MPI. MPICH is one of the earliest MPI implementations. It has existed since the mid 1990s. MPICH is a mature and portable implementation that is actively maintained and updated. The first version of Open MPI was released 2005. Because Open MPI is a collaborative effort that includes many developers who were responsible for earlier MPI implementations, Open MPI is seen as the future standard. However, that doesn’t mean that MPICH can be ignored. There are several MPI implementations that are based on MPICH. For example, Microsoft ships an MPI implementation called Microsoft HPC Pack that is based on MPICH.
MPICH provides installation files for various operating systems, such as Windows, Linux, and OS X. If you need an MPI implementation and don’t want to build it from source code, the MPICH installation files are the fastest path to start using MPI.
The MPICH installation files contain the required header files and libraries to develop MPI programs. Furthermore, they contain an MPI runtime environment. Because MPI programs execute tasks on several processors concurrently, they run in several processes. An MPI program is started multiple times, not just once. Several instances of the same MPI program run on multiple processors and communicate through functions defined by the MPI standard.
You can’t start an MPI program with a double click. You use a helper program, which is usually called mpiexec. You pass your MPI program to mpiexec, which starts your program in the MPI runtime environment. Command line options determine how many processes are started and how they communicate – for example, through sockets or shared memory. Because the MPI runtime environment takes care of these details, you can concentrate on parallel programming.
If you decided to use the installation files from MPICH, note that MPICH only provides a 64-bit version. You must use a 64-bit compiler to develop MPI programs with MPICH and build a 64-bit version of Boost.MPI.