open-mpi/ompi-release — pull request #82 by jsquyres (2014-11-07 15:31:15+00:00)
Title: Fixes for MPI_THREAD_MULTIPLE on v1.8 branch

This PR contains three main things:

1. Revert 01b41a4653e5215dbff1c53d1acbacad16adcd53 and bc16fa81a99c8f4d3268b0790b86fd778ed2e707. Those 2 commits actually *removed* a valuable MPI_THREAD_MULTIPLE fix and only fixed the performance problem of always enabling locks indirectly. Hence, we need to revert these commits and put back the valuable MPI_THREAD_MULTIPLE fix, and fix the performance issue a different way.
1. Improve the performance of free lists by only using atomics in MPI_THREAD_MULTIPLE scenarios
1. Move the OPAL thread level setup earlier in ompi_mpi_init() so that *everything* is setup with the same thread level infrastructure

The first 2 commits are just reverts; they clearly needed to happen. Nathan wrote the last 2 commits; Jeff reviewed them (and made very minor style changes). There are no corresponding master commits because this is a v1.8-specific issue.

@hjelmn please sanity check this PR/commits to ensure I got it all correct.