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

stack smashing detected when use MPI_Reduce

I have learned to use some MPI functions. When I try to use MPI_Reduce, I get stack smashing detected when I run my code: #include #include #include void main(int argc, char **argv) { int i, rank, size; int…
Bui Minh Duc
  • 112
  • 1
  • 11
2
votes
1 answer

MPI job on Rocks cluster (SGE scheduler) doesn't run over multiple nodes

I'm trying to run a parallel MPI job using the Sun Grid Engine scheduler on a Rocks v5.4.3 cluster. The cluster has a queue named "all.q" that has 22 compute nodes: 21 of which have 8 CPUs and 1 which has 4 CPUs. When a parallel job runs, however,…
Brian
  • 21
  • 2
2
votes
1 answer

Fortran mpi runtime error

I am trying to understand parallel data writing from Fortran code with MPI. I came across a simple program from here. I compiled and run the program with MPI compiler and getting the following error: sathish@HP-EliteBook:~/Desktop$ mpif90 test.F90…
SKPS
  • 5,433
  • 5
  • 29
  • 63
2
votes
1 answer

ISend & Recv in MPI: Different value received?

In my Matrix Addition code, I am transmitting the lower bound to the other processes with ISend and Tag 1, but when I compile the code all other slave processes claim to have the same lower bound. I don't understand why? The Output: I am process 1…
Marcel
  • 335
  • 1
  • 2
  • 10
2
votes
0 answers

How to deal with Valgrind reporting leaks in MPICH MPI library calls?

I am using MPICH 3.2, built with: ./configure --prefix=/usr/local --enable-g=mem,dbg,meminit I am using valgrind 3.11.0. When I run valgrind on one of my MPI programs, I get a large number of reported leaks for PMPI_Bcast(). Am I doing something…
Edward Hartnett
  • 882
  • 7
  • 16
2
votes
1 answer

How to send the data in an Eigen::MatrixXd with MPI

I want to use MPI to send matrces between machines. The following are my test code #include #include #include using std::cin; using std::cout; using std::endl; using namespace Eigen; int main(int argc, char **…
GoingMyWay
  • 16,802
  • 32
  • 96
  • 149
2
votes
1 answer

Cannot compile function that returns object of type MPI::Comm

To run my software with MPI, I need to create a simple method that will return MPI::COMM_WORLD. So in my class, we have: #include class Parallel{ public: MPI::Comm getCommunicator(){ return MPI::COMM_WORLD; …
Karl
  • 51
  • 1
  • 3
2
votes
0 answers

MPI: Efficient exchange of different amounts of data between all nodes

I'm totally new to MPI and have absolutely no idea as to what is efficient. I have x (x = 2, 4, 8, 16, ...) nodes, each of them with large text files of more than 4 million lines. I want to sort these lines using bucket sort, and for that, I want…
2
votes
1 answer

What does "Got unknown event 17 ... continuing ..." mean with MPI

I am running an MPI job and am getting this warning message: [comet-05-08.sdsc.edu:mpi_rank_10][async_thread] Got unknown event 17 ... continuing ... I am compiling with icc (ICC) 15.0.2 20150121 using MVAPICH 2.1. What does the message mean? Is it…
Richard
  • 56,349
  • 34
  • 180
  • 251
2
votes
2 answers

How does MPI_Reduce with MPI_MIN work?

if I have this code: int main(void) { int result=0; int num[6] = {1, 2, 4, 3, 7, 1}; if (my_rank != 0) { MPI_Reduce(num, &result, 6, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD); } else { MPI_Reduce(num, &result, 6, MPI_INT,…
sam
  • 169
  • 2
  • 10
2
votes
1 answer

py.test and mpi test cases

I just created a package with sequential test cases running with py.test. But, now, I would like to run the same test cases in a distributed MPI context. For example to run a test case on 4 processors : $> mpirun -np 4 python test1.py So, I would…
2
votes
1 answer

Using MPI I/O to extract a part of a C structure

I am working on a C MPI code. It has a structure: typedef struct mystruct_s{ double interesting_data; int boring_data; int trivial_data; }mystruct; Now, each process has an array of these structures, say mystruct…
bob.sacamento
  • 6,283
  • 10
  • 56
  • 115
2
votes
1 answer

MPI Shared Memory for Complex Object

I have a large-scale code that runs on many CPU cores, potentially across a number of compute nodes. The code is in C++ and is parallelized with OpenMPI. My code has a very large object (~10GB RAM usage) that is read from by each MPI process. This…
davewy
  • 1,781
  • 1
  • 16
  • 27
2
votes
1 answer

MPI_Barrier - Only some processes passes the barrier

I'm facing a situation where only some processes bypass the MPI_Barrier function. The problem appears in this fragment of code: printf("[%d] Before barrier\n", mpi_rank); fflush(stdout); MPI_Barrier(MPI_COMM_WORLD); printf("[%d] After barrier\n",…
dv_
  • 169
  • 10
2
votes
1 answer

Sharing data between processes when using MPI on windows

I have done a significant amount of testing trying to use windows named shared memory between multiple independently run programs, across two MPI hosts. The result has been MPI with admin rights not having windows privileges to access the Global\…
Greg X
  • 61
  • 4