- 
                Notifications
    
You must be signed in to change notification settings  - Fork 929
 
Description
While reviewing #12189 I found what seems to be a discrepancy in the info key handling between communicators created with different functions. Some communicators subscribe to the info keys, some only copy them. When subscribed, the communicator will get notified of updates when the user calls MPI_Comm_set_info. Otherwise, no such update happens and we don't even parse the info keys. Some time ago we fixed the handling of mpi_assert_allow_overtake so that it can be set once after the communicator has been created (#9843) so that is a valid use-case.
Here is the list of functions that support changing info keys through MPI_Comm_set_info:
- Anything created through 
ompi_comm_dup_with_info(https://github.com/open-mpi/ompi/blob/main/ompi/communicator/comm.c#L1348) andompi_comm_split_type_core(incl.ompi_comm_split_with_info,ompi_comm_split_unguided) (https://github.com/open-mpi/ompi/blob/main/ompi/communicator/comm.c#L995): MPI_Comm_dup_with_info,MPI_Comm_dup,MPI_Comm_split_type`, and some han, acoll, and rdma communicator. 
The list of functions that do not support it:
- Anything that is created through 
ompi_comm_create_w_info, which only copies the info objects (https://github.com/open-mpi/ompi/blob/main/ompi/communicator/comm.c#L446):MPI_Comm_create - Anything that is created through 
ompi_comm_split_with_info, which only copies the info objects (https://github.com/open-mpi/ompi/blob/main/ompi/communicator/comm.c#L703):MPI_Comm_split(throughompi_comm_split) and internal HAN and acoll communicators. 
We should probably harmonize that in some way, i.e., always subscribe to the info keys. For internal communicators that will never have other info keys set we could pass a flag to suppress. However, it's strange that setting mpi_assert_allow_overtake on a communicator created with MPI_Comm_dup would work while it wouldn't work on a communicator created with MPI_Comm_create.