MPI_GRAPH_GET(3)
π¦ NAME π¦
MPI_Graph_get β okay so, this one retrieves the graph topology information that's been vibing with a communicator. That's the whole thing. (You're reading the Open MPI manual page for it, section 3, bestie π)
β¨ SYNTAX β¨
πΈ C Syntax πΈ
#include <mpi.h>
int MPI_Graph_get(MPI_Comm comm, int maxindex, int maxedges,
int index[], int edges[])
π Fortran Syntax π
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_GRAPH_GET(COMM, MAXINDEX, MAXEDGES, INDEX, EDGES, IERROR)
INTEGER COMM, MAXINDEX, MAXEDGES, INDEX(*)
INTEGER EDGES(*), IERROR
π§ Fortran 2008 Syntax π§
USE mpi_f08
MPI_Graph_get(comm, maxindex, maxedges, index, edges, ierror)
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, INTENT(IN) :: maxindex, maxedges
INTEGER, INTENT(OUT) :: index(maxindex), edges(maxedges)
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π INPUT PARAMETERS π
commβ the communicator that's got the graph structure, aka the handle πmaxindexβ how long yourindexvector is in the calling program (integer).maxedgesβ how long youredgesvector is in the calling program (integer).
π«Ά OUTPUT PARAMETERS π«Ά
indexβ an array of integers holding the graph structure. For all the deets on what that structure even is, go look at the definition ofMPI_Graph_create, iykyk.edgesβ an array of integers holding the graph structure.ierrorβ Fortran only: the error status (integer).
π DESCRIPTION π
So MPI_Graphdims_get and MPI_Graph_get are literally the duo that retrieves the graph-topology information that some communicator got hooked up with by MPI_Graph_create. β¨
And the info you get from MPI_Graphdims_get? You use it to dimension your index and edges vectors correctly before you call MPI_Graph_get. That's the pipeline, bestie β dims first, then get. Periodt.
π ERRORS π
Almost every MPI routine hands back an error value, no cap: for C routines it's the return result of the function, and for Fortran routines it's chillin' in the last argument.
Before that error value comes back, the current MPI error handler that's attached to the communication object (like, a communicator, window, or file, for example) gets called. And if there's no communication object tied to the MPI call? Then the call counts as attached to MPI_COMM_SELF and it'll call the associated MPI error handler. And when MPI_COMM_SELF isn't 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 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 gets called for MPI I/O functions, and MPI_ERRORS_ABORT gets called for all the other MPI functions.
Open MPI ships three predefined error handlers you can use, and they are:
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 it's called on a communicator, it acts as ifMPI_Abortwas called on that communicator. If it's 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. And if it's called on a session, it aborts only the local process.MPI_ERRORS_RETURNβ returns an error code to the application.
MPI applications can also implement their own error handlers by calling:
MPI_Comm_create_errhandlerand thenMPI_Comm_set_errhandlerMPI_File_create_errhandlerand thenMPI_File_set_errhandlerMPI_Session_create_errhandlerand thenMPI_Session_set_errhandler, or atMPI_Session_initMPI_Win_create_errhandlerand thenMPI_Win_set_errhandler
Heads up bestie: MPI does not guarantee that an MPI program can continue past an error. Like, at all. π
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_Graph_create
π Copyright π
2003-2026, The Open MPI Community
And that's a wrap, my love π this was MPI_GRAPH_GET(3) from the Open MPI crew, dated Sep 10, 2026 β go forth and query those graph dims, you absolute icon ππ
π¦ 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