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
2
votes
1 answer

Comparing CPU utilization during MPI thread deadlock using mvapich2 vs. openmpi

I noticed that when I have a deadlocked MPI program, e.g. wait.c #include #include int main(int argc, char * argv[]) { int taskID = -1; int NTasks = -1; int a = 11; int b = 22; MPI_Status Stat; /* MPI…
irritable_phd_syndrome
  • 4,631
  • 3
  • 32
  • 60
2
votes
1 answer

Signal: Segmentation fault (11) in MPI C++

I have a code, which counts the average value of integers in MPI: #include #include #include #include #include // Average method int compute_avg(int *array, int num_elements) { int sum = 0; …
mangeke
  • 23
  • 1
  • 3
2
votes
1 answer

Why MPI_Win_unlock is so low?

My application uses one-sided communications (MPI_Rget, MPI_Raccumulate) with synchronization primitives like MPI_Win_Lock and MPI_Win_Unlock for its passive target synchronization. I profiled my application and found that most of time is being…
syko
  • 3,477
  • 5
  • 28
  • 51
2
votes
1 answer

How can I see detailed work of nodes on a Rocks Cluster?

I built a Rocks Cluster for my school project, which is matrix multiplication, with one frontend and 5 other computers which are nodes. Over MPI I send them partions of matrix which they use for multiplication and then they send data back. Command…
warkovich
  • 21
  • 2
2
votes
1 answer

MPI_Recv/MPI_Send overhead

I am working on a C++ application, where I use the MPI C bindings to send and receive data over a network. I understand that sending const int VECTOR_SIZE = 1e6; std::vector vector(VECTOR_SIZE, 0.0); via // Version A MPI_Send(const_cast
Marcel
  • 616
  • 1
  • 5
  • 15
2
votes
2 answers

Using Loops in MPI

I'm trying to sort large arrays by reversal and coding with MPI on C. Basically, my program splits the array to portions for workers and each worker finds its own increasing and decreasing strips and sends strips back to root. Root makes some…
smtnkc
  • 488
  • 2
  • 9
  • 23
2
votes
2 answers

MPI_Gather gives seg fault in the most basic code

I am working on a much bigger program where I struggle with MPI_Gather. I wrote a minimal example code, see below. program test use MPI integer :: ierr, rank, size double precision, allocatable, dimension(:) :: send, recv call…
Marcel
  • 51
  • 4
2
votes
1 answer

Not enough locked memory (rdma_setup_startup_ring: cannot create cq)

I have an issue with the quantity of available memory in page locked on CentOS 7. After allocating nodes with slurm, when I launch a job with MPI (mvapich), I encounter the following error: Fatal error in MPI_Init: Other MPI error, error…
jyvet
  • 2,021
  • 15
  • 22
2
votes
0 answers

Use MPI_Type_create_struct or MPI_pack for varying data sizes?

I have four arrays, three of type float and one of type long long, which need to be communicated between nodes in each iteration of a loop. To avoid having to use multiple MPI_Sends and incur unnecessary overhead, it is better to pack the data into…
spurra
  • 1,007
  • 2
  • 13
  • 38
2
votes
1 answer

MPI_Gather() the central elements into a global matrix

This is a follow-up question from MPI_Gather 2D array. Here is the situation: id = 0 has this submatrix |16.000000| |11.000000| |12.000000| |15.000000| |6.000000| |1.000000| |2.000000| |5.000000| |8.000000| |3.000000| |4.000000|…
gsamaras
  • 71,951
  • 46
  • 188
  • 305
2
votes
0 answers

Running out of MPI Group Communicators

I am trying to parallelize a vertex-centred finite volume code on unstructured meshes. I first partition my mesh and then assign a processor to solve on each partition. Each processor/partition has vertices which it shares with one or more…
rayd
  • 104
  • 8
2
votes
1 answer

Changing MPI settings during run-time

Is it possible to change any MPI settings during runtime? The only similar thing I know about is manipulation with intra and inter-communicators (docs). Do you know about some other things? I'm thinking about changing PATH, MPIEXEC_TIMEOUT, prefix…
Eenoku
  • 2,741
  • 4
  • 32
  • 64
2
votes
2 answers

Is there an MPI_AllReduce implemenentation for sparse vectors?

I need to synchronize intermediate solutions of an optimization problem solved distributively over a number of worker processors. The solution vector is known to be sparse. I have noticed that if I use MPI_AllReduce, the performance is good compared…
Soumitra
  • 189
  • 1
  • 10
2
votes
1 answer

MPI allgatherv certain members of a structure

I have a structure of type: typedef struct{ double x; double y; double z; }bodyType; and I want to use allgatherv to exchange only the the x and y members of the structure. Is this possible using the MPI_Type_vector or it doesn't apply…
NickSar68
  • 55
  • 5
2
votes
2 answers

Passing submatrix between processes

First, I'm learning Message Passing Interface(MPI) from https://computing.llnl.gov/tutorials/mpi/ When it comes to creating your own MPI datatype, I'm having trouble with it. My program is trying to get each quadrant. Say the following 4 x 4…
leoflower
  • 563
  • 7
  • 13