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(..., MPI_THREAD_SERIALIZED) hangs under OSX 10.8.4 if compiled with OpenMPI 1.7.1
From: Hans Ekkehard Plesser (hans.ekkehard.plesser_at_[hidden])
Date: 2013-06-14 18:12:45


I use OpenMPI 1.7.1 from MacPorts (+threads +gcc47). When compiling a simple hello world program calling

MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);

the program hangs if run on more than one process. All works fine if I

- either use MPI_THREAD_SINGLE
- or use OpenMPI 1.6.4.

The actual compiler invocation and compiler version are

[Macintosh:~/tmp/hw] hep% openmpicc -o hw_mpi hw_mpi.c --showme
/usr/bin/clang -o hw_mpi hw_mpi.c -I/opt/local/include/openmpi -L/opt/local/lib -lmpi

[Macintosh:~/tmp/hw] hep% /usr/bin/clang --version
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix

The full program code is shown below. I have also reported this to the MacPorts bug tracker.

Best regards,
Hans E Plesser

#include <stdio.h>

#include <mpi.h>

int main(int argc, char **argv)
 int provided;
 MPI_Init_thread(&argc, &argv, MPI_THREAD_SERIALIZED, &provided);

 printf("Provided threading level: %d.\n", provided);

 int rank;
 MPI_Comm_rank(MPI_COMM_WORLD, &rank);

 printf("Hello, world! This is rank %d.\n", rank);

 return 0;

Dr. Hans Ekkehard Plesser, Associate Professor
Head, Basic Science Section
Dept. of Mathematical Sciences and Technology
Norwegian University of Life Sciences
PO Box 5003, 1432 Aas, Norway
Phone +47 6496 5467
Fax   +47 6496 5401
Email hans.ekkehard.plesser_at_[hidden]