-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init: Add thread initialization and finalization #3569
Conversation
@shintaro-iwasaki we avoid making thread library calls directly in MPICH. Instead, we should define |
0f73a88
to
c7dd13b
Compare
c7dd13b
to
770be9c
Compare
Change the flag type from |
Sanity checking the default tests. Need to add Argobots review job next. |
This was successful in manual tests. There are still further changes needed in the test suite, which we can address separately. @shintaro-iwasaki one more request. I prefer if changes to MPL are isolated into their own commit. Can you split the first commit into:
|
770be9c
to
7637600
Compare
I split the first commit into two as you suggested. |
Looks great. Testing one more time. |
Some threading libraries (e.g., Argobots) require explicit initialization and finalization. This patch adds new functions that that initialize and finalize an underlying threading library. Signed-off-by: Ken Raffenetti <[email protected]>
MPI_Init and MPI_Finalize call thread initialization and finalization functions, which some threading libraries require. Accordingly, this patch removes Argobots-specific code in MPI_Init. Signed-off-by: Ken Raffenetti <[email protected]>
When initialization of the threading library fails, it jumps to fn_fail and runs MPIR_Thread_CS_Finalize before thread_cs_init is called. This commit adds a flag to fix this issue. Signed-off-by: Ken Raffenetti <[email protected]>
Previously, if Argobots is enabled,
ABT_init
must be called beforeMPI_Init
, which is very cumbersomeNow Argobots has an initialization counter inside and therefore can be initialized multiple times.
This PR adds
ABT_init
and correspondingABT_finalize
in MPI initialization and finalization.The current implementation imposes a restriction derived from Argobots; when the Argobots option is enabled, the same thread needs to initialize and finalize the MPI runtime. See pmodels/argobots#86 for details.