MPI is not a programming language. MPI defines a set of library routines that can be called from C and Fortran programs. MPI programs typically employ a single-program, multiple-data approach. Multiple instances, or MPI ranks, of the same program run concurrently. Each rank computes a different part of the larger problem and uses MPI to communicate data between ranks. From the perspective of an MPI programmer, ranks may run on the same node or different nodes; the communication path may be different, but that is transparent to the MPI program.
The startup mechanisms of MPI applications are not part of the Standard. We demonstrate how to handle Intel MPI programs on Linux, but most other distributions have similar semantics and similar features. The basic way of executing an Intel MPI program is (with < N >: number of MPI ranks):
$ mpirun –n < N > ./prg.x
This will be sufficient for a shared memory node or a cluster with a standard batch management system. If you encounter the below error:
mpirun.openmpi: command not found
you may try installing below package as per your choice of distribution.
Distribution | Command |
---|---|
Debian | apt-get install openmpi-bin |
Ubuntu | apt-get install openmpi-bin |
Kali Linux | apt-get install openmpi-bin |
Raspbian | apt-get install openmpi-bin |
Summary
The MPI programming model is a natural fit for clusters containing Intel Xeon Phi coprocessors. The programmer can accelerate individual MPI ranks by offloading the key computational kernels to the coprocessor. However, care must be taken to avoid resource conflicts and to amortize the increased amount of communication. Alternatively, the coprocessor has the characteristics of just another cluster node, albeit one with different computational capabilities than the host, and MPI ranks can run natively on the coprocessor. Either approach introduces new degrees of heterogeneity and the likelihood of load imbalance as a performance bottleneck.