MPI_Dist_graph_neighbors function

Returns the list of neighbors having edges into and out of the calling process, as well as the corresponding weights on the incoming and outgoing edges in a distributed graph topology.

Syntax

int WINAPI MPI_Dist_graph_neighbors(
  _In_ MPI_Comm              comm,
       _In_range_(>=,0)  int maxindegree,
       _Out_writes_opt int   sources[],
       _Out_writes_opt int   sourceweights[],
       _In_range_(>=,0)  int maxoutdegree,
       _Out_writes_opt int   destinations[],
       _Out_writes_opt int   destweights[]
);

Parameters

  • comm [in]
    The handle of the communicator with the distributed graph topology.

  • maxindegree
    Size of the sources and sourceweights arrays (non-negative integer).

  • sources[]
    Ranks of processes in the communicator for which, the calling process is the destination in the distributed graph topology (array of non-negative integers).

  • sourceweights[]
    Weights of the corresponding edges into the calling process (array of non-negative integers).

  • maxoutdegree
    Size of the destinations and destweights arrays (non-negative integer).

  • destinations[]
    Ranks of processes in the communicator for which the calling process is the source in the distributed graph topology (array of non-negative integers).

  • destweights[]
    Weights of the corresponding edges out of the calling process (array of non-negative integers).

Return value

Returns MPI_SUCCESS on success. Otherwise, the return value is an error code.

In Fortran, the return value is stored in the IERROR parameter.

Fortran

    MPI_DIST_GRAPH_NEIGHBORS (COMM, MAXINDEGREE, SOURCES, SOURCEWEIGHTS,
    MAXOUTDEGREE, DESTINATIONS, DESTWEIGHTS, IERROR)
        INTEGER COMM, MAXINDEGREE, SOURCES (*), SOURCEWEIGHTS (*), MAXOUTDEGREE,
    DESTINATIONS (*), DESTWEIGHTS (*), IERROR

Remarks

The incoming and outgoing edge count and the weight information can be obtained by calling MPI_Dist_graph_neighbors_count prior to calling this method. If maxindegree and maxoutdegree are less than the number of incoming and outgoing edges returned by MPI_Dist_graph_neighbors_count, then only the first part of the full list is returned.

The incoming and outgoing edge weights are returned only if the graph was created as a weighted distributed graph by the MPI_Dist_graph_create_adjacent or the MPI_Dist_graph_create methods and if MPI_UNWEIGHTED is not supplied as an argument in place of sourceweights or destweights.

Requirements

Product

Microsoft MPI v6

Header

Mpi.h; Mpif.h

Library

Msmpi.lib

DLL

Msmpi.dll

See also

MPI Process Topology Functions

MPI_Dist_graph_create

MPI_Dist_graph_neighbors_count

MPI_Dist_graph_create_adjacent