Open
Description
This is an opening to a discussion about the OMPI_MPI_THREAD_LEVEL
environment variable. There's a few issues here:
- This env variable was added a long time ago to
MPI_Init()
as a way for the OMPI developers to set the MPI thread level for apps that callMPI_Init()
(notMPI_Init_thread()
). This allowed us to the thread code in Open MPI without updating every single OMPI test to callMPI_Init_thread()
. - We specifically did not add the same override to
MPI_Init_thread()
because the thought was that in this case, the app had asked for exactly what it wanted in therequired
param. Meaning: the env variable override was for legacy apps who still callMPI_INIT
. - Master commit babfd93 changes the behavior of
MPI_Init_thread()
to also obey the value from theOMPI_MPI_THREAD_LEVEL
environment variable. This is a behavior change. - That being said, it's possible we never documented
OMPI_MPI_THREAD_LEVEL
to end users. I honestly don't remember if it was intended to be a developer-only feature or whether we intended to allow end users to use this functionality. - If we want to make this functionality available to the end user, we might consider adding this as an MCA param and treating it like all other MCA params (vs. a one-off env variable).
- Additionally, if it's to be used by both MPI_INIT and MPI_INIT_THREAD (and MPI sessions?) it should probably be implemented back in
ompi_mpi_init()
(does the Sessions prototype useompi_mpi_init()
?) -- not handled separately in bothMPI_Init()
andMPI_Init_thread()
. - Reading MPI-4.0 description of MPI_INIT and MPI_INIT_THREAD, I'm not actually sure that the
OMPI_MPI_THREAD_LEVEL
env variable is actually compliant with the spec. It makes a few statements about how callingMPI_Init()
is the same as callingMPI_Init_thread()
withMPI_THREAD_SINGLE
. This might affect whether we want to expose this "backdoor" functionality to end users.
I think a few discussions fall out of the above points:
- Do we want to keep the ability to override the thread level at run time?
- Which functions does this functionality apply to (
MPI_INIT
,MPI_INIT_THREAD
, sessions functions, ...)? - Do we expose this functionality to the end user, or is it intended to be developer-only?
- Should this remain an env variable, or should we move it to an MCA param?