You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due a bug in the way we sanitize user inputs on the 'requested' parameter in MPI_Init_thread the requested parameter cannot be overridden by OMPI_MPI_THREAD_LEVEL environment variable.
This feature is important when considering libraries that require a more thread-safe environment than what the legacy code of main expected.
Background information
This is related to #9332 where some of the rationale for why we want this feature is laid-out, but has additional concerns about adding MCA control parameters in addition to simple ENV. This is a more focused issue targeting only the fact that we can't override the requested param here.
What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
Allow OMPI_MPI_THREAD_LEVEL to override the requested parameter to MPI_Init_thread.
Variant1: accept OMPI_MPI_THREAD_LEVEL (if valid), even if OMPI_MPI_THREAD_LEVEL < requested (this may cause a crash, but is what user requested)
Variant2: use max(OMPI_MPI_THREAD_LEVEL, requested) (assuming both valid)
both variants are valid based on MPI standard (11.2:MPI_INIT_THREAD pp486:25), so its our choice here.
Related questions
in MPI_INIT we silently promote to MPI_THREAD_MULTIPLE if the value of OMPI_MPI_THREAD_LEVEL is invalid (silently, no warning).
in MPI_INIT_THREAD we cause mpi_init to call the fatal errh if value requested is invalid
should invalid value in OMPI_MPI_THREAD_LEVEL also be promoted silently to MPI_THREAD_MULTIPLE in init_thread (like it is in MPI_INIT? or also cause error handling?
The text was updated successfully, but these errors were encountered:
Due a bug in the way we sanitize user inputs on the 'requested' parameter in
MPI_Init_thread
therequested
parameter cannot be overridden byOMPI_MPI_THREAD_LEVEL
environment variable.This feature is important when considering libraries that require a more thread-safe environment than what the legacy code of
main
expected.Background information
This is related to #9332 where some of the rationale for why we want this feature is laid-out, but has additional concerns about adding MCA control parameters in addition to simple ENV. This is a more focused issue targeting only the fact that we can't override the
requested
param here.What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
Proposed resolution
Allow
OMPI_MPI_THREAD_LEVEL
to override therequested
parameter toMPI_Init_thread
.Variant1: accept OMPI_MPI_THREAD_LEVEL (if valid), even if OMPI_MPI_THREAD_LEVEL < requested (this may cause a crash, but is what user requested)
Variant2: use
max(OMPI_MPI_THREAD_LEVEL, requested)
(assuming both valid)both variants are valid based on MPI standard (11.2:MPI_INIT_THREAD pp486:25), so its our choice here.
Related questions
MPI_INIT
we silently promote to MPI_THREAD_MULTIPLE if the value of OMPI_MPI_THREAD_LEVEL is invalid (silently, no warning).MPI_INIT_THREAD
we cause mpi_init to call the fatal errh if valuerequested
is invalidThe text was updated successfully, but these errors were encountered: