MPI_GROUP_FROM_SESSION_PSET(3)
π MPI_GROUP_FROM_SESSION_PSET(3) β Open MPI π
okay bestie, sit down, hydrate, and let's talk about MPI_Group_from_session_pset β the glow-up moment where a session handle and a process set name link up and make a whole new group. it's giving matchmaker energy fr fr π«Ά
β¨ SYNTAX β¨
πΈ C Syntax
#include <mpi.h>
int MPI_Group_from_session_pset(MPI_Session session, const char *pset_name, MPI_Group *newgroup)
πΈ Fortran Syntax
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_GROUP_FROM_SESSION_PSET(SESSION, PSET_NAME, NEWGROUP, IERROR)
INTEGER SESSION, NEWGROUP, IERROR
CHARACTER*(*) PSET_NAME
πΈ Fortran 2008 Syntax
USE mpi_f08
MPI_Group_from_session_pset(session, pset_name, newgroup, ierror)
TYPE(MPI_Session), INTENT(IN) :: session
CHARACTER(LEN=*), INTENT(IN) :: pset_name
TYPE(MPI_Group), INTENT(OUT) :: newgroup
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π₯ INPUT PARAMETERS π₯
sessionβ the Session (handle). your main character credential πpset_nameβ name of process set to use to create the new group (string). yes it's a string, treat it with respect.
π€ OUTPUT PARAMETERS π€
newgroupβ New group derived from supplied session and process set (handle). the new baby, welcome to the world πierrorβ Fortran only: Error status (integer).
π DESCRIPTION π
So MPI_Group_from_session_pset creates a group called newgroup using the provided session handle and process set. that's it, that's the whole vibe β¨
BUT β and this is the part you cannot skip, bestie β the process set name must be one returned from an invocation of MPI_Session_get_nth_pset using the supplied session handle. you can't just make one up, it's not a nickname situation, it's a government-name situation.
And if pset_name does not exist? then MPI_GROUP_NULL gets returned in the newgroup argument. no pset, no group, empty-handed, tragic but documented π
π NOTE π
As with other group constructors, MPI_Group_from_session_pset is a local function. no cross-process chit-chat happening here, it's a solo activity π§
π ERRORS π
Almost all MPI routines return an error value β C routines hand it back as the return result of the function, and Fortran routines tuck it into the last argument. lowkey universal.
Before that error value comes back to you, the current MPI error handler associated with the communication object (like a communicator, window, or file) gets called. If there's no communication object associated with the MPI call, then the call counts as attached to MPI_COMM_SELF and it'll call that associated MPI error handler. When MPI_COMM_SELF isn't initialized (i.e. before MPI_Init / MPI_Init_thread, after MPI_Finalize, or when you're out here 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 in the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, or the info key to MPI_Comm_spawn / MPI_Comm_spawn_multiple. And if no other appropriate error handler has been set? then MPI_ERRORS_RETURN is called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all the other MPI functions. slay, consistent.
Open MPI includes three predefined error handlers you can use, bestie:
MPI_ERRORS_ARE_FATALβ Causes the program to abort all connected MPI processes. nuclear option, no cap π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 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 to the application. the polite one π«Ά
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
Note that MPI does not guarantee that an MPI program can continue past an error. so like⦠don't count on it bouncing back, bestie.
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_Session_init
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, periodt. written by the Open MPI girlies, dated Sep 10, 2026, manual page MPI_GROUP_FROM_SESSION_PSET(3) β go forth and construct groups responsibly πβ¨π
π¦ 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