Questions tagged [mpi]

MPI is the Message Passing Interface, a library for distributed memory parallel programming and the de facto standard method for using distributed memory clusters for high-performance technical computing. Questions about using MPI for parallel programming go under this tag; questions on, eg, installation problems with MPI implementations are best tagged with the appropriate implementation-specific tag, eg MPICH or OpenMPI.

MPI is the Message Passing Interface, a library for distributed memory parallel programming and the de facto standard method for using distributed memory clusters for high-performance technical computing. Questions about using MPI for parallel programming go under this tag; questions on, eg, installation problems with MPI implementations are best tagged with the appropriate implementation-specific tag, e.g. MPICH or OpenMPI.

The official documents for MPI can be found at the webpages of the MPI forum; a useful overview is given on the Wikipedia page for MPI. The current version of the MPI standard is 3.0; the Forum is currently working on versions 3.1, which will have smaller updates and errata fixes, and 4.0, which will have significant additions and enhancements.

Open source MPI Libraries that implement the current standard include

Versions for most common platforms can be downloaded from the links above. Platform specific implementations are also available from various vendors.

A number of excellent tutorials for learning the basics of MPI programming can be found online, typically at the websites of supercomputing centres; these include (in no particular order):

Definitive Book Guide

  1. An Introduction to Parallel Programming - Peter Pacheco.
  2. Parallel Programming in C with MPI and OpenMP - Michael J. Quinn
  3. MPI: The Complete Reference (Volume 2) - William Gropp, Steven Huss-Lederman, Andrew Lumsdaine, Ewing L. Lusk, Bill Nitzberg, William Saphir, Marc Snir
  4. Using MPI: Portable Parallel Programming with the Message-Passing Interface - William Gropp, Ewing Lusk, Anthony Skjellum
6963 questions
160
votes
5 answers

MPICH vs OpenMPI

Can someone elaborate the differences between the OpenMPI and MPICH implementations of MPI ? Which of the two is a better implementation ?
lava
  • 1,945
  • 2
  • 14
  • 15
155
votes
19 answers

How do I debug an MPI program?

I have an MPI program which compiles and runs, but I would like to step through it to make sure nothing bizarre is happening. Ideally, I would like a simple way to attach GDB to any particular process, but I'm not really sure whether that's possible…
Jay Conrod
  • 28,943
  • 19
  • 98
  • 110
103
votes
2 answers

Display a MPI typemap

The type map is an important but confounding concept in MPI. I would like a routine to display or print a type map for me. For example (taken from the MPI-3 standard), MPI_TYPE_CREATE_RESIZED(MPI_INT, -3, 9, type1) results in the typemap…
Rob Latham
  • 5,085
  • 3
  • 27
  • 44
86
votes
2 answers

Using MPI_Bcast for MPI communication

I'm trying to broadcast a message from the root node to all other nodes using MPI_Bcast. However, whenever I run this program it always hangs at the beginning. Does anybody know what's wrong with it? #include #include int main(int…
David
  • 2,080
  • 5
  • 29
  • 44
85
votes
5 answers

MPI: blocking vs non-blocking

I am having trouble understanding the concept of blocking communication and non-blocking communication in MPI. What are the differences between the two? What are the advantages and disadvantages?
lamba
  • 1,581
  • 5
  • 18
  • 29
81
votes
2 answers

fork: retry: Resource temporarily unavailable

I tried installing Intel MPI Benchmark on my computer and I got this error: fork: retry: Resource temporarily unavailable Then I received this error again when I ran ls and top command. What is causing this error? Configuration of my machine: Dell…
user1260391
  • 1,237
  • 2
  • 10
  • 6
73
votes
2 answers

mpiexec vs mpirun

As per my little knowledge mpirun and mpiexec both are launcher. Can anybody tell the exact difference between mpiexec and mpirun?
DEV
  • 2,106
  • 3
  • 25
  • 40
72
votes
2 answers

What are the differences between MPI and OpenMP?

I would like to know (in a few words) what are the main differences between OpenMP and MPI.
elli
  • 1,109
  • 1
  • 13
  • 20
60
votes
11 answers

fatal error: mpi.h: No such file or directory #include

when I compile my script with only #include it tells me that there is no such file or directory. But when i include the path to mpi.h as #include "/usr/include/mpi/mpi.h" (the path is correct) it returns: In file included from…
user2804865
  • 976
  • 2
  • 9
  • 15
55
votes
2 answers

sending blocks of 2D array in C using MPI

How do you send blocks of 2-D array to different processors? Suppose the 2D array size is 400x400 an I want to send blocks of sizes 100X100 to different processors. The idea is that each processor will perform computation on its separate block and…
Sundevil
  • 651
  • 1
  • 7
  • 5
48
votes
9 answers

Error when installing mpi4py

I'm trying to install mpi4py using pip install mpi4py, but I'm getting the following error: error: Cannot find 'mpi.h' header. Check your configuration!!! Earlier in the same error report I have, clang: error: linker command failed with exit code…
nargles324
  • 613
  • 1
  • 6
  • 10
43
votes
1 answer

HPC cluster: select the number of CPUs and threads in SLURM sbatch

The terminology used in the sbatch man page might be a bit confusing. Thus, I want to be sure I am getting the options set right. Suppose I have a task to run on a single node with N threads. Am I correct to assume that I would use --nodes=1 and…
Tanash
  • 461
  • 1
  • 5
  • 8
42
votes
4 answers

struct serialization in C and transfer over MPI

I have defined a custom struct which I need to send over to another MPI process using the MPI_Bsend (or MPI_Send). Here is the struct: struct car{ int shifts; int topSpeed; }myCar; The issue is that apart from primitive types MPI doesn't seem…
stratis
  • 7,750
  • 13
  • 53
  • 94
41
votes
1 answer

What is "Signal 15 received"

What might cause a C, MPI program using a library called SUNDIALS/CVODE (a numerical ODE solver) running on a Gentoo Linux cluster to give me repeated Signal 15 received.? Is that code being issued by MPI, Sundials, Linux, C or who? Note that I am…
Jeff
  • 747
  • 3
  • 8
  • 17
41
votes
1 answer

ld: undefined reference to symbol 'log2@@GLIBC_2.2.5'

Whats wrong with for (level = 1; level <= log2((double)size); level++) ^ Seems like its from using log2() but whats wrong? I am using it with OpenMPI code actually, but commenting this line fixes things. Full…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
1
2 3
99 100