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 freeinggroup, usingMPI_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_errhandleronMPI_COMM_SELFwhen you're using the World model, or - the
mpi_initial_errhandlerCLI argument tompiexec, 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 ifMPI_Abortwas called on that communicator. If called on a window or file, it acts as ifMPI_Abortwas 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_errhandlerthenMPI_Comm_set_errhandlerMPI_File_create_errhandlerthenMPI_File_set_errhandlerMPI_Session_create_errhandlerthenMPI_Session_set_errhandleror atMPI_Session_initMPI_Win_create_errhandlerthenMPI_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. πΈ
π Copyright π
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
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms