-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libpmi: add spinlock, use count on global context
Problem: multiple threads cannot make PMI calls using the global context without potentially breaking the wire protocol over the shared file descriptor. Protect the global context with a spinlock, implemented using gcc builtin atomics (which also work on Clang). If two threads happen to make PMI API calls concurrently, one will spin while the other completes its wire protocol operation. Add a usecount on the global PMI context so that each thread may independently call PMI_Init() and PMI_Finalize(). Update DPRINTF(), DRETURN() macros so they need not access the global PMI context under lock. Instead stash the debug level and rank in globals pmi_debug_level and pmi_debug_rank.
- Loading branch information
Showing
1 changed file
with
110 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters