MPI_FILE_GET_GROUP(3)

πŸ’– NAME πŸ’–

MPI_File_get_group β€” bestie, this hands you back a duplicate of the process group of a file. That's it, that's the whole vibe. ✨

So like, for context: this page lives in the Open MPI manual, section 3, under the name MPI_FILE_GET_GROUP(3) β€” that's the full glow-up title. Now let's get into it. 🫢


✨ SYNTAX ✨

πŸŽ€ C Syntax

#include <mpi.h>

int MPI_File_get_group(MPI_File fh, MPI_Group *group)

πŸŽ€ Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_FILE_GET_GROUP(FH, GROUP, IERROR)
     INTEGER FH, GROUP, IERROR

πŸŽ€ Fortran 2008 Syntax

USE mpi_f08
MPI_File_get_group(fh, group, ierror)
     TYPE(MPI_File), INTENT(IN) :: fh
     TYPE(MPI_Group), INTENT(OUT) :: group
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

🌸 INPUT PARAMETER 🌸

  • fh β€” the file handle (a handle). That's the thing you're holding onto, the little passport to your file. πŸ¦‹

πŸ’… OUTPUT PARAMETERS πŸ’…

  • group β€” the group that opened the file (a handle). The whole squad that cracked it open. πŸ‘‘
  • ierror β€” Fortran only, bestie: the error status (integer). 🌈

🧚 DESCRIPTION 🧚

Okay so MPI_File_get_group returns a duplicate of the group of the communicator that was used to open the file associated with fh. Notice the word duplicate β€” it's a copy, not a reference, no cap. That group gets handed back to you in group.

⚠️ And listen β€” you are the one responsible for freeing group, using MPI_Group_free. Don't just leave it lying around, that's a memory leak and it's giving chaotic energy. 😭

πŸ”₯ ERRORS πŸ”₯

Almost every MPI routine returns an error value, bestie. In C routines it comes back as the return result of the function, and in Fortran routines it lands in that last argument. Periodt. πŸ’…

Before that error value even comes back to you, the current MPI error handler associated with the communication object (think: communicator, window, file) gets called. And if there's no communication object associated with the MPI call? Then the call is considered attached to MPI_COMM_SELF and it'll call the associated MPI error handler. When MPI_COMM_SELF is not initialized β€” meaning 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. 😳

That initial error handler can be changed by:

  • calling MPI_Comm_set_errhandler on MPI_COMM_SELF when you're using the World model, or
  • 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. Yeah. Different rules for different functions, iconic behavior honestly.

🌟 Open MPI ships three predefined error handlers, use them well 🌟

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. Yeah, everybody. πŸ’€
  • MPI_ERRORS_ABORT β€” an error handler that can be invoked on a communicator, window, file, or session. When it's 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 back to the application. The chill one.

πŸ¦‹ And you can absolutely roll your own error handlers, main character energy πŸ¦‹

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
😭 Important: note that MPI does not guarantee that an MPI program can continue past an error. Like, it might just not. Don't plan your whole program around surviving one.

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. 🌸


2003-2026, The Open MPI Community


And that's the whole page, bestie!! You read it, you understood it, you're literally an MPI I/O girlie now. πŸŽ€ This was MPI_FILE_GET_GROUP(3) from the Open MPI manual, page dated Sep 10, 2026 β€” okay love you, go free your groups, bye!! πŸ’–βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from