6

I tried using MPI_THREAD_MULTIPLE option in openmpi. For that to work i found that i need to enable the multiple thread option in openmpi configuration. I don't know how to do that? Can someone please help me in this. Thank you in advance.I checked openmpi settings in my system. The settings for threads as follows:

Thread support: posix (MPI_THREAD_MULTIPLE: no, OPAL support: yes, OMPI progress: no, ORTE progress: yes, Event lib: yes) FT Checkpoint support: no (checkpoint thread: no)

How to enable MPI_THREAD_MULTIPLE flag on?

Murali krishna
  • 823
  • 1
  • 8
  • 23
  • You need to recompile Open MPI. Consult the output of `./configure --help` executed from the root of the Open MPI source tree. – Hristo Iliev Jul 08 '16 at 19:45
  • Can you mention how to recompile the openmpi. Where do i get the configure file?@HristoIliev – Murali krishna Jul 09 '16 at 03:53
  • 2
    Citing my previous comment: "Consult the output of `./configure --help` executed from **the root of the Open MPI source tree**." The source code of Open MPI is available on [its website](https://www.open-mpi.org/software/ompi/v1.10/). The option that enables full threading support is `--enable-mpi-threads`. – Hristo Iliev Jul 09 '16 at 08:47

2 Answers2

4

In openMPI 2.0.1, it is ./configure --enable-mpi-thread-multiple. Use this to recompile openmpi, and Use int ret = MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &prov); assert(ret == 0 && prov == MPI_THREAD_MULTIPLE); to init the MPI.

HY G
  • 185
  • 1
  • 14
2

Open MPI master branch by default is in MPI_THREAD_MULTIPLE, hence you wont see that option in the ./configure --help

If you wanted to configure with that try checking out to v2.x or similar and recompile with the option

  • ./configure --help | grep thread -> --enable-mpi-thread-multiple