MPI_GROUP_FROM_SESSION_PSET(3)

πŸ“¦
version 5.0.10 Β· 4 versions
, in ubuntu stonking

πŸ’– 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 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. the polite one 🫢

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


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