Skip to content

What to do with OMPI_MPI_THREAD_LEVEL env variable? #9332

Open
@jsquyres

Description

@jsquyres

This is an opening to a discussion about the OMPI_MPI_THREAD_LEVEL environment variable. There's a few issues here:

  1. 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 call MPI_Init() (not MPI_Init_thread()). This allowed us to the thread code in Open MPI without updating every single OMPI test to call MPI_Init_thread().
  2. 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 the required param. Meaning: the env variable override was for legacy apps who still call MPI_INIT.
  3. Master commit babfd93 changes the behavior of MPI_Init_thread() to also obey the value from the OMPI_MPI_THREAD_LEVEL environment variable. This is a behavior change.
  4. 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.
  5. 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).
  6. 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 use ompi_mpi_init()?) -- not handled separately in both MPI_Init() and MPI_Init_thread().
  7. 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 calling MPI_Init() is the same as calling MPI_Init_thread() with MPI_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:

  1. Do we want to keep the ability to override the thread level at run time?
  2. Which functions does this functionality apply to (MPI_INIT, MPI_INIT_THREAD, sessions functions, ...)?
  3. Do we expose this functionality to the end user, or is it intended to be developer-only?
  4. Should this remain an env variable, or should we move it to an MCA param?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions