MPI_GRAPH_NEIGHBORS_COUNT(3)
π MPI_GRAPH_NEIGHBORS_COUNT(3) π
ok so bestie, welcome to the Open MPI manual, section 3 β this is MPI_Graph_neighbors_count, and she's basically the girl who tells you how many friends a node has in a graph topology. Main character energy fr fr π
β¨ NAME β¨
MPI_Graph_neighbors_count β returns the number of neighbors of a node associated with a graph topology. that's it, that's the whole vibe π¦
πΈ SYNTAX πΈ
π C Syntax π
#include <mpi.h>
int MPI_Graph_neighbors_count(MPI_Comm comm, int rank,
int *nneighbors)
π Fortran Syntax π
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_GRAPH_NEIGHBORS_COUNT(COMM, RANK, NNEIGHBORS, IERROR)
INTEGER COMM, RANK, NNEIGHBORS, IERROR
π§ Fortran 2008 Syntax π§
USE mpi_f08
MPI_Graph_neighbors_count(comm, rank, nneighbors, ierror)
TYPE(MPI_Comm), INTENT(IN) :: comm
INTEGER, INTENT(IN) :: rank
INTEGER, INTENT(OUT) :: nneighbors
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
π«Ά INPUT PARAMETERS π«Ά
commβ the communicator that's carrying the graph topology, bestie. it's a handle πrankβ the rank of the process inside the group ofcomm. an integer, no cap β
π OUTPUT PARAMETERS π
nneighborsβ the number of neighbors of the specified process. an integer, and yes she's the whole point of the call πierrorβ Fortran only, babe: the error status, also an integer π
π DESCRIPTION π
ok so MPI_Graph_neighbors_count and MPI_Graph_neighbors are the duo that hands you adjacency info for a general, graph topology. iconic behavior honestly.
MPI_Graph_neighbors_count returns the number of neighbors for the process signified by rank β like, it's giving headcount of your node's besties π₯
π ERRORS π
almost all MPI routines return an error value, bestie. C routines? it's the return result of the function. Fortran routines? it's in the last argument. that's just how she moves.
heads up π¨ before the error value gets returned, the current MPI error handler associated with the communication object (e.g., communicator, window, file) gets called. so like, something will happen first.
if no communication object is associated with the MPI call, then the call is considered attached to MPI_COMM_SELF and will call the associated MPI error handler. when MPI_COMM_SELF is not initialized (i.e., before MPI_Init/MPI_Init_thread, after MPI_Finalize, or when using the Sessions Model exclusively) the error raises the initial error handler. the initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or the mpi_initial_errhandler CLI argument to mpiexec or info key to MPI_Comm_spawn/MPI_Comm_spawn_multiple. 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. periodt.
Open MPI includes three predefined error handlers that can be used, and they are:
MPI_ERRORS_ARE_FATALβ causes the program to abort all connected MPI processes. like, everyone. gone. π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. very situational queen πMPI_ERRORS_RETURNβ returns an error code to the application. the chill 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. like, she might just not recover, and that's the tea.
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. iykyk π
π¦ SEE ALSO π¦
MPI_Graph_neighbors
π COPYRIGHT π
2003-2026, The Open MPI Community
and that's the whole page, bestie π she was documented in the Open MPI manual, dated Sep 11, 2026 β go forth and count those neighbors, slay β¨πΈπ«Ά
π¦ where this page comes from
- arch rolling: openmpi 5.0.11-1 Β· BSD-3-Clause AND LicenseRef-MPICH
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms