mpi-forum / mpi-issues

Tickets for the MPI Forum
http://www.mpi-forum.org/
67 stars 8 forks source link

Clarification of `mpi_memory_alloc_kinds` key behavior with `MPI_INFO_ENV` #810

Closed raffenet closed 1 month ago

raffenet commented 1 year ago

Problem

In the latest MPI-4.1 draft (page 509, section 11.4.3), it states:

When returned in MPI_INFO_ENV, this info key indicates the memory allocation kinds supported by the MPI library for all objects derived from the World Model. [...] The "mpi_memory_alloc_kinds" info key must also be contained in the info object returned by MPI_COMM_GET_INFO, MPI_WIN_GET_INFO, and MPI_FILE_GET_INFO. If the communicator, window, or file is derived from the World Model, the value of this info key must be identical to the value of this info key in MPI_INFO_ENV unless the user has asserted that support for memory allocation kinds can be restricted by setting "mpi_assert_memory_alloc_kinds" on that communicator, window, or file.

However this is a change in the way values are reported in MPI_INFO_ENV. Historically, MPI_INFO_ENV returned values that corresponded to the "requested" value for a particular setting. That is, the values passed to the startup mechanism (mpiexec, MPI_COMM_SPAWN, MPI_COMM_SPAWN_MULTIPLE, etc).

The following keys are predefined for this object, corresponding to the arguments of MPI_COMM_SPAWN or of mpiexec: [...] Advice to users. The values passed in MPI_INFO_ENV are the values of the arguments passed to the mechanism that started the MPI execution—not the actual value provided. Thus, the value associated with "maxprocs" is the number of MPI processes requested; it can be larger than the actual number of processes obtained, if the soft option was used. (End of advice to users.)

Proposal

Option 1: Further clarify that MPI_INFO_ENV reports the provided mpi_memory_alloc_kinds. This will require dealing with corner cases caused by MPI_Info_create_env where the MPI library is not yet initialized; where the sessions model is in use and sessions exist with differing alloc kinds; or where sessions and world models are combined.

Option 2: Clarify that MPI_INFO_ENV reports the requested memory allocation kinds and that the memory allocation kinds supported by the MPI library can be checked by querying the mpi_memory_alloc_kinds info key from MPI_COMM_WORLD in the world model or from a session in the sessions model.

Changes to the Text

TBD

Impact on Implementations

None.

Impact on Users

Little to none. mpi_memory_alloc_kinds is not yet standard. No known examples of this usage are in existence.

References and Pull Requests

PR https://github.com/mpi-forum/mpi-standard/pull/946

raffenet commented 1 year ago

Updated this ticket to reflect the current discussion in the working group. It is added to the agenda for the October 2023 meeting.

Wee-Free-Scot commented 1 year ago

In Option (2), we could/should use MPI_COMM_SELF instead of MPI_COMM_WORLD, or use all three built-in/predefined communicators (MPI_COMM_SELF, MPI_COMM_WORLD, and the communicator returned by MPI_COMM_PARENT, if it is not MPI_COMM_NULL).

wesbland commented 1 month ago

This passed a no-no vote on 2023-12-04.

Yes No Abstain
27 0 3
wesbland commented 1 month ago

This passed an errata vote on 2023-12-05.

Yes No Abstain
24 0 6