Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] MPI_Init_thread hangs in OpenMPI 1.7.1 when using --enable-mpi-thread-multiple
From: Elias Rudberg (elias.rudberg_at_[hidden])
Date: 2013-06-16 11:54:46


I would like to report what seems to be a bug in MPI_Init_thread in
OpenMPI 1.7.1.

The bug can be reproduced with the following test program
#include <mpi.h>
#include <stdio.h>
int main(int argc, const char* argv[]) {
   int provided = -1;
   printf("Calling MPI_Init_thread...\n");
   MPI_Init_thread(NULL, NULL, MPI_THREAD_MULTIPLE, &provided);
   printf("MPI_Init_thread returned, provided = %d\n", provided);
   return 0;

When trying to run this when OpenMPI was configured with
--enable-mpi-thread-multiple, the program hangs when trying to run
using anything more than one process.

Steps I use to reproduce this in Ubuntu:

(1) Download openmpi-1.7.1.tar.gz

(2) Configure like this:
./configure --enable-mpi-thread-multiple

(3) make

(4) Compile test program like this:
mpicc test_mpi_thread_support.c

(5) Run like this:
mpirun -np 2 ./a.out
Then you see the following two lines of output:
Calling MPI_Init_thread...
Calling MPI_Init_thread...
And then it hangs.

MPI_Init_thread did not hang in earlier OpenMPI versions (for example
it worked in 1.5.* and 1.6.*), so it seems like a bug introduced in 1.7.

The description above shows how I reproduce this in Ubuntu on my local
desktop computer, but the same problem exists for the OpenMPI 1.7.1
installation at the UPPMAX computer center where I wan to run my code
in the end. I don't know all details about how they installed it
there, but I know they set --enable-mpi-thread-multiple. So maybe it
hangs in 1.7.1 on any computer as long as you use MPI_THREAD_MULTIPLE.
At least I have not seen it work anywhere.

Do you agree that this is a bug, or am I doing something wrong?

Best regards,