MPI_Dist_graph_create function

Returns a handle to a new communicator to which the distributed graph topology information is attached.

Syntax

int WINAPI MPI_Dist_graph_create(
  _In_  MPI_Comm                comm_old,
        _In_range_(>=,0)  int   n,
        _In_reads_opt const int sources[],
        _In_reads_opt const int degrees[],
        _In_opt const int       destinations[],
        _In_opt const int       weights[],
  _In_  MPI_Info                info,
        _In_range_(0,1) int     reorder,
  _Out_ MPI_Comm                *comm_dist_graph
);

Parameters

  • comm_old [in]
    The handle of the communicator without the topology information (handle).

  • n
    Number of sources for which this process specifies outgoing edges (non-negative integer).

  • sources[]
    Array containing the n sources for which this source specifies the outgoing edges (array of non-negative integers).

  • degrees[]
    Array specifying the number of destinations for each source node in the source node array (array of non-negative integers).

  • destinations[]
    Destination nodes for the source nodes in the sources array (array of non-negative integers).

  • weights[]
    Weights for corresponding edges in the destinations array (array of non-negative integers).

  • info [in]
    Hints on optimization or interpretation of weights (handle). Currently use MPI_INFO_NULL as this variable is not being used internally.

  • reorder
    Ranks may be reordered (true) or not (false) (logical). Currently this is not used internally.

  • comm_dist_graph [out]
    Handle to the communicator with the distributed graph topology information attached (handle).

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_CREATE (COMM_OLD, N, SOURCES, DEGREES, DESTINATIONS, WEIGHTS,
    INFO, REORDER, COMM_DIST_GRAPH, IERROR)
        INTEGER COMM_OLD, N, SOURCES (*), DEGREES (*), DESTINATIONS (*),
    WEIGHTS (*), INFO, COMM_DIST_GRAPH, IERROR
        LOGICAL REORDER

Remarks

Both the sources and destinations arrays may contain the same node more than once, and the order in which nodes are listed as destinations or sources is not significant. Similarly, different processes may specify edges with the same source and destination nodes. Source and destination nodes must be process ranks of comm_old. Different processes may specify different numbers of source and destination nodes, as well as different source to destination edges. This allows a fully distributed specification of the communication graph. Isolated processes (processes with no outgoing or incoming edges, that is, processes that do not occur as source or destination node in the graph specification) are allowed.

The number of processes in comm_dist_graph is identical to the number of processes in comm_old. The call to this function is collective.

In C or FORTRAN, an application can supply MPI_UNWEIGHTED for the weights array to indicate that all edges have the same (effectively no) weight. It is erroneous to supply MPI_UNWEIGHTED for some but not all processes of comm_old. The behavior in such a case is not guaranteed. If the graph is weighted, but n = 0, then, MPI_WEIGHTS_EMPTY or any arbitrary array may be passed to weights.

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_adjacent

MPI_Dist_graph_neighbors_count

MPI_Dist_graph_neighbors