/ LLNL Specific Information and Recommendations
LLNL Specific Information and Recommendations
This section describes details specific to Livermore Computing’s systems.
All LC production systems include a Pthreads implementation that follows draft 10 (final) of the POSIX standard. This is the preferred implementation.
Implementations differ in the maximum number of threads that a process may create. They also differ in the default amount of thread stack space.
LC maintains a number of compilers, and usually several different versions of each - see the LC’s Supported Compilers web page.
The compiler commands described in the Compiling Threaded Programs section apply to LC systems.
Mixing MPI with Pthreads:
This is the primary motivation for using Pthreads at LC.
Each MPI process typically creates and then manages N threads, where N makes the best use of the available cores/node.
Finding the best value for N will vary with the platform and your application’s characteristics.
In general, there may be problems if multiple threads make MPI calls. The program may fail or behave unexpectedly. If MPI calls must be made from within a thread, they should be made only by one thread.
Use the appropriate MPI compile command for the platform and language of choice
Be sure to include the required Pthreads flag as shown in the Compiling Threaded Programs section.
An example code that uses both MPI and Pthreads is available below. The serial, threads-only, MPI-only and MPI-with-threads versions demonstrate one possible progression.
MPI with pthreads
Lawrence Livermore National Laboratory
7000 East Avenue • Livermore, CA 94550 | LLNL-WEB-458451
Operated by the Lawrence Livermore National Security, LLC for the
Department of Energy's National Nuclear Security Administration
Learn about the Department of Energy's Vulnerability Disclosure Program