8.4.4. Communicator Info

PreviousUpNext
Up: Communicator Management Next: Motivating Examples Previous: Communicator Destructors

Hints specified via info (see Chapter The Info Object) allow a user to provide information to direct optimization. Providing hints may enable an implementation to deliver increased performance or minimize use of system resources. As described in Section The Info Object, an implementation is free to ignore all hints; however, applications must comply with any info hints they provide that are used by the MPI implementation (i.e., are returned by a call to MPI_COMM_GET_INFO) and that place a restriction on the behavior of the application. Hints are specified on a per communicator basis, in MPI_COMM_DUP_WITH_INFO, MPI_COMM_IDUP_WITH_INFO, MPI_COMM_SET_INFO, MPI_COMM_SPLIT_TYPE, MPI_DIST_GRAPH_CREATE, and MPI_DIST_GRAPH_CREATE_ADJACENT, via the opaque info object. When an info object that specifies a subset of valid hints is passed to MPI_COMM_SET_INFO, there will be no effect on previously set or defaulted hints that the info does not specify.


Advice to implementors.

It may happen that a program is coded with hints for one system, and later executes on another system that does not support these hints. In general, unsupported hints should simply be ignored. Needless to say, no hint can be mandatory. However, for each hint used by a specific implementation, a default value must be provided when the user does not specify a value for this hint. ( End of advice to implementors.)

Advice to users.

Some optimizations may only be possible when all processes in the group of the communicator provide a given info key with the same value. ( End of advice to users.)
Info hints are not propagated by MPI from one communicator to another. The following info keys are valid for all communicators.


Advice to users.

Some optimizations may only be possible when all MPI processes in the group of the communicator provide a given info key with the same value. ( End of advice to users.)

"mpi_assert_no_any_tag" (boolean, default: false):
If set to true, then the implementation may assume that the MPI process will not use the MPI_ANY_TAG wildcard on the given communicator.

"mpi_assert_no_any_source" (boolean, default: false):
If set to true, then the implementation may assume that the MPI process will not use the MPI_ANY_SOURCE wildcard on the given communicator.

"mpi_assert_exact_length" (boolean, default: false):
If set to true, then the implementation may assume that the lengths of messages received by the MPI process are equal to the lengths of the corresponding receive buffers, for point-to-point communication operations on the given communicator.

"mpi_assert_allow_overtaking" (boolean, default: false):
If set to true, then the implementation may assume that point-to-point communications on the given communicator do not rely on the nonovertaking rule specified in Section Semantics of Point-to-Point Communication. In other words, the application asserts that send operations are not required to be matched at the receiver in the order in which the send operations were posted by the sender, and receive operations are not required to be matched in the order in which they were posted by the receiver.


Advice to users.

Use of the mpi_assert_allow_overtaking info key can result in nondeterminism in the message matching order. ( End of advice to users.)

mpi_assert_strict_persistent_collective_ordering (boolean, default: false):
If set to true, then the implementation may assume that all the persistent collective operations are started in the same order across all MPI processes in the group of the communicator. It is required that if this assertion is made on one member of the communicator's group, then it must be made on all members of that communicator's group with the same value.


Advice to users.

Use of the mpi_assert_strict_persistent_collective_ordering may be needed because some optimizations may only be possible on certain systems when strict collective ordering is asserted for the underlying communicator of a persistent collective operation. ( End of advice to users.)

mpi_assert_memory_alloc_kinds (string, not set by default):
If set, the implementation may assume that the memory for all communication buffers passed to MPI operations performed by the calling MPI process on the given communicator will use only the memory allocation kinds listed in the value string. See Section Memory Allocation Info.


MPI_COMM_SET_INFO(comm, info)
INOUT commcommunicator (handle)
IN infoinfo object (handle)
C binding
int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)
Fortran 2008 binding
MPI_Comm_set_info(comm, info, ierror)

TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Info), INTENT(IN) :: info
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_COMM_SET_INFO(COMM, INFO, IERROR)

INTEGER COMM, INFO, IERROR

MPI_COMM_SET_INFO updates the hints of the communicator associated with comm using the hints provided in info. This operation has no effect on previously set or defaulted hints that are not specified by info. It also has no effect on previously set or defaulted hints that are specified by info, but are ignored by the MPI implementation in this call to MPI_COMM_SET_INFO. MPI_COMM_SET_INFO is a collective routine. The info object may be different on each MPI process, but any info entries that an implementation requires to be the same on all MPI processes must appear with the same value in each MPI process's info object.


Advice to users.

Some info items that an implementation can use when it creates a communicator cannot easily be changed once the communicator has been created. Thus, an implementation may ignore hints issued in this call that it would have accepted in a creation call. An implementation may also be unable to update certain info hints in a call to MPI_COMM_SET_INFO. MPI_COMM_GET_INFO can be used to determine whether updates to existing info hints were ignored by the implementation. ( End of advice to users.)

Advice to users.

Setting info hints on the predefined communicators MPI_COMM_WORLD and MPI_COMM_SELF may have unintended effects, as changes to these global objects may affect all components of the application, including libraries and tools. Users must ensure that all components of the application that use a given communicator, including libraries and tools, can comply with any info hints associated with that communicator. ( End of advice to users.)

MPI_COMM_GET_INFO(comm, info_used)
IN commcommunicator object (handle)
OUT info_usednew info object (handle)
C binding
int MPI_Comm_get_info(MPI_Comm comm, MPI_Info *info_used)
Fortran 2008 binding
MPI_Comm_get_info(comm, info_used, ierror)

TYPE(MPI_Comm), INTENT(IN) :: comm
TYPE(MPI_Info), INTENT(OUT) :: info_used
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_COMM_GET_INFO(COMM, INFO_USED, IERROR)

INTEGER COMM, INFO_USED, IERROR

MPI_COMM_GET_INFO returns a new info object containing the hints of the communicator associated with comm. The current setting of all hints related to this communicator is returned in info_used. An MPI implementation is required to return all hints that are supported by the implementation and have default values specified; any user-supplied hints that were not ignored by the implementation; and any additional hints that were set by the implementation. If no such hints exist, a handle to a newly created info object is returned that contains no key/value pair. The user is responsible for freeing info_used via MPI_INFO_FREE.


PreviousUpNext
Up: Communicator Management Next: Motivating Examples Previous: Communicator Destructors


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023