Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable multithreading flag in openmpi in linux?

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?

like image 845
Murali krishna Avatar asked Jul 08 '16 14:07

Murali krishna


People also ask

Does MPI create threads?

When the MPI comes you need to consider how your process will communicate. MPI is not sending messages to individual threads but individual process. For that reason MPI provides four modes of interaction with threads. MPI_THREAD_FUNNELED : Can provide many threads, but only the master thread can make MPI calls.

How do I know if OpenMPI is installed?

With OpenMPI, the easiest thing to do is to run ompi_info ; the first few lines will give you the information you want. In your own code, if you don't mind something OpenMPI specific, you can look at use OMPI_MAJOR_VERSION , OMPI_MINOR_VERSION , and OMPI_RELEASE_VERSION in mpi. h.

Where should OpenMPI be installed?

./configure --prefix=/usr/local With the -- prefix option given, OpenMPI binaries are installed in the directory /usr/local/bin and shared libraries in /usr/local/lib. If you want a different installation location, replace /usr/local with your desired directory.

What is MPI thread?

MPI and Threads. • MPI describes parallelism between processes. (with separate address spaces) • Thread parallelism provides a shared-memory. model within a process.


2 Answers

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.

like image 160
HY G Avatar answered Sep 25 '22 18:09

HY G


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
like image 31
user2008020 Avatar answered Sep 23 '22 18:09

user2008020