Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] Using Boost::Thread for multithreading within OpenMPI processes
From: Nick Edmonds (ngedmond_at_[hidden])
Date: 2013-04-23 12:46:27


Hi Jacky,

I'm a regular reader of this list but seldom a poster. In this case however I might actually be qualified to answer some questions or provide some insight given I'm not sure how many other folks here use Boost.Thread. The first question is really what sort of threading model you want to use with MPI, which others here are probably more qualified to advise you on.

In our applications we're using Boost.Thread with MPI_THREAD_MULTIPLE, which is a not all-together enjoyable experience because the openib BTL lacks support for thread multiple (at least as of the last time I checked). That being said, Boost.Thread behaves just like any pthread code on the linux clusters we run on, as well as one BlueGene/P. With MPI_THREAD_SERIALIZED writing hybrid-parallel code is pretty painless. Most of the work required involved adding two-stage collectives such that threads first perform collectives locally and then a single thread participates in the MPI collective operation.

If you end up using Boost.MPI you could probably even write your own wrappers to encapsulate the local computation required for MPI collective operations. Unfortunately Boost.MPI currently lacks full support for even MPI-2 but if it includes the subset of functionality you need it may be worthwhile. Extensions are fairly straightforward to implement as well.

I've implemented a few different approaches to MPI + threading in the context of Boost, from explicit thread management to thread pools, and currently a complete runtime system. Most of it is research code, though there's no reason it couldn't be released, and some of it probably will be eventually. If you'd like to describe your intended use case I'm happy to offer any advice I can based on what I've learned.

Cheers,
Nick

On Apr 22, 2013, at 3:25 PM, Thomas Watson wrote:

> Hi,
>
> I would like to create a pool of threads (using Boost::Thread) within each OpenMPI process to accelerate my application on multicore CPUs. My application is already built on OpenMPI, but it currently exploits parallelism only at the process level.
>
> I am wondering if anyone can point me to some good tutorials/documents/examples on how to integrate Boost multithreading with OpenMPI applications?
>
> Thanks!
>
> Jacky
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users