MPI_COMM_SET_INFO(3)

πŸ’– MPI_COMM_SET_INFO(3) πŸ’–

okay bestie, so this whole page is the Open MPI manual page MPI_COMM_SET_INFO(3), and it's all about setting communicator info hints. one routine, a whole pile of assumptions you can unlock. let's get into it 🫢


✨ SYNTAX ✨

here's how you actually call her, in all three flavours:

🌸 C Syntax

#include <mpi.h>

int MPI_Comm_set_info(MPI_Comm comm, MPI_Info info)

🌸 Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_COMM_SET_INFO(COMM, INFO, IERROR)
     INTEGER COMM, INFO, IERROR

🌸 Fortran 2008 Syntax

USE mpi_f08
MPI_Comm_set_info(comm, info, ierror)
     TYPE(MPI_Comm), INTENT(IN) :: comm
     TYPE(MPI_Info), INTENT(IN) :: info
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

πŸŽ€ INPUT PARAMETERS πŸŽ€

  • comm β€” the communicator on which we're setting the info hints πŸ’…
  • info β€” the Info object holding the hints that are gonna be set on comm ✨

πŸŽ€ OUTPUT PARAMETERS πŸŽ€

  • ierror β€” Fortran only: the error status, as an integer. she's just a number, no drama 😌

πŸ’œ DESCRIPTION πŸ’œ

MPI_Comm_set_info sets new values for the hints of the communicator associated with comm. and listen β€” MPI_Comm_set_info is a collective routine, so everybody's in this together. the info object may be different on each process, but any info entries that an implementation requires to be the same on all processes must appear with the same value in each process's info object. no sneaky mismatches bestie πŸ™ˆ

these are the info key assertions that Open MPI may accept:

  • mpi_assert_no_any_tag (boolean) β€” set it to true and the implementation may assume that the process will not use the MPI_ANY_TAG wildcard on the given communicator. bye wildcard πŸ‘‹
  • mpi_assert_no_any_source (boolean) β€” set it to true and the implementation may assume the process will not use the MPI_ANY_SOURCE wildcard on the given communicator. ok specific queen πŸ’…
  • mpi_assert_exact_length (boolean) β€” set it to true and the implementation may assume that the lengths of messages received by the process are equal to the lengths of the corresponding receive buffers, for point-to-point communication operations on the given communicator. exact-match energy, love that 🌸
  • mpi_assert_allow_overtaking (boolean) β€” set it to true and the implementation may assume that point-to-point communications on the given communicator do not rely on the non-overtaking rule specified in MPI-3.1 Section 3.5. in other words, the application is asserting that send operations are not required to be matched at the receiver in the order in which the send operations were performed by the sender, and receive operations are not required to be matched in the order in which they were performed by the receiver. she does not queue in order and that is the whole point πŸ”₯

😭 ERRORS 😭

Almost all MPI routines return an error value; C routines hand it back as the return result of the function, and Fortran routines put it in the last argument. so it's always somewhere, ok?

Before the error value is returned, the current MPI error handler associated with the communication object (like a communicator, window, or file) gets called. If no communication object is associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler. And when MPI_COMM_SELF is not initialized β€” like before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively β€” the error raises the initial error handler. you can change that initial error handler by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or with the mpi_initial_errhandler CLI argument to mpiexec, or an info key to MPI_Comm_spawn/MPI_Comm_spawn_multiple. and if no other appropriate error handler has been set? then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions. periodt.

Open MPI includes three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. πŸ’€
  • MPI_ERRORS_ABORT β€” an error handler that can be invoked on a communicator, window, file, or session. When called on a communicator, it acts as if MPI_Abort was called on that communicator. If called on a window or file, it acts as if MPI_Abort was called on a communicator containing the group of processes in the corresponding window or file. If called on a session, it aborts only the local process.
  • MPI_ERRORS_RETURN β€” returns an error code to the application. simple, polite, iconic πŸŽ€

MPI applications can also implement their own error handlers by calling:

  • MPI_Comm_create_errhandler then MPI_Comm_set_errhandler
  • MPI_File_create_errhandler then MPI_File_set_errhandler
  • MPI_Session_create_errhandler then MPI_Session_set_errhandler or at MPI_Session_init
  • MPI_Win_create_errhandler then MPI_Win_set_errhandler
note that MPI does not guarantee that an MPI program can continue past an error. big deal, pls keep that in mind fr fr 😭

See the MPI man page for a full list of MPI error codes.

See the Error Handling section of the MPI-3.1 standard for more information.

πŸ‘€ See also πŸ‘€

  • MPI_Comm_get_info
  • MPI_Info_create
  • MPI_Info_set
  • MPI_Info_free

2003-2026, The Open MPI Community


okay that's the whole page, you made it 🫢 this was the Open MPI MPI_COMM_SET_INFO(3) page, dated Sep 10, 2026, brought to you by the Open MPI crew β€” now go set those hints and slay πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from