I have no idea how MacPorts configures OMPI - did you check the output of ompi_info to see if threading was even enabled?
On Jun 14, 2013, at 3:12 PM, Hans Ekkehard Plesser <hans.ekkehard.ples...@umb.no> wrote: > > Hi! > > 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); > > MPI_Finalize(); > 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.ples...@umb.no > Home http://arken.umb.no/~plesser > > > _______________________________________________ > users mailing list > us...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/users