Skip to content
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

mpi4: support MPI_INFO_ENV before MPI_Init #4915

Closed
hzhou opened this issue Nov 16, 2020 · 3 comments · Fixed by #5008
Closed

mpi4: support MPI_INFO_ENV before MPI_Init #4915

hzhou opened this issue Nov 16, 2020 · 3 comments · Fixed by #5008
Assignees

Comments

@hzhou
Copy link
Contributor

hzhou commented Nov 16, 2020

link:

@raffenet
Copy link
Contributor

One piece of background for this ticket: Sessions introduces the ability to manipulate Info objects before init (and after finalize) of MPI. MPI_T also will take advantage of this capability.

Because of the requirement to be available outside of initialization, all related Info manipulation functions must always be thread-safe.

@shintaro-iwasaki shintaro-iwasaki self-assigned this Nov 17, 2020
@shintaro-iwasaki
Copy link
Contributor

If it is the case, the problem would be using atomic operations for "thread-safety" before MPI_Init().

@hzhou
Copy link
Contributor Author

hzhou commented Jan 5, 2021


\begin{mpi-binding}
    function_name("MPI_Info_create_env")

    parameter(
        "argc",
        "ARGUMENT_COUNT",
        direction="inout",
        pointer=False,
        suppress="lis_parameter f08_parameter f90_parameter",
    )
    parameter(
        "argv",
        "ARGUMENT_LIST",
        length="argc",
        pointer=False,
        direction="inout",
        suppress="lis_parameter f08_parameter f90_parameter",
    )

    parameter("info", "INFO", direction="out", desc="info object")
\end{mpi-binding}

This routine produces an output object \mpiarg{info} with the same construction as
\const{MPI\_INFO\_ENV} as created during \mpifunc{MPI\_INIT} or \mpifunc{MPI\_INIT\_THREAD} when the
same arguments are used.
This construction is described in Section~\ref{sec:inquiry-startup};
however, this function can be called when not using the \wpm{}, e.g., when using the \spm{}.
This object is not a direct
copy or alias of the \const{MPI\_INFO\_ENV} object and could contain different values based on the
input arguments and other sources.  Multiple calls to this procedure that are given the same input
arguments will produce \mpiarg{info} objects consistent with the definition of
\const{MPI\_INFO\_ENV}.  The version for ISO C accepts the \mpiarg{argc} and \mpiarg{argv} that are
provided by the arguments to \code{main} or \code{0} for \mpiarg{argc} and \code{NULL} for
\mpiarg{argv}.  The user is responsible for freeing the \mpiarg{info} object via
\mpifunc{MPI\_INFO\_FREE}.  This procedure is local.

This procedure must always be thread-safe, as defined in Section~\ref{sec:dynamic:threads}.  It is
one of the few routines that may be called before \MPI/ is initialized or after \MPI/ is finalized.

\begin{users}

    In some circumstances (e.g., when passing \code{0} to \mpiarg{argc} and \code{NULL} to
    \mpiarg{argv} in C or in Fortran where such arguments do not exist), the \mpiarg{info} object
    may not be populated or may be populated incompletely because this procedure is local and the
    implementation may not be able to determine the correct values. Note that this could result in
    different values in the resulting \mpiarg{info} object at different \MPI/ processes.

\end{users}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants