root/ompi/mca/topo/base/topo_base_graphdims_get.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mca_topo_base_graphdims_get

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2013 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2012-2013 Inria.  All rights reserved.
  13  * Copyright (c) 2014      Research Organization for Information Science
  14  *                         and Technology (RIST). All rights reserved.
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 
  22 #include "ompi_config.h"
  23 #include "ompi/mca/topo/base/base.h"
  24 #include "ompi/communicator/communicator.h"
  25 
  26 /*
  27  * function - Retrieves graph topology information associated with a
  28  *            communicator
  29  *
  30  * @param comm - communicator for group with graph structure (handle)
  31  * @param nodes - number of nodes in graph (integer)
  32  * @param nedges - number of edges in graph (integer)
  33  *
  34  * @retval MPI_SUCCESS
  35  * @retval MPI_ERR_TOPOLOGY
  36  * @retval MPI_ERR_COMM
  37  * @retval MPI_ERR_ARG
  38  */
  39 int mca_topo_base_graphdims_get (ompi_communicator_t* comm,
  40                                  int *nodes,
  41                                  int *nedges)
  42 {
  43     mca_topo_base_comm_graph_2_2_0_t* graph = comm->c_topo->mtc.graph;
  44     *nodes = ompi_comm_size(comm);
  45     *nedges = graph->index[*nodes -1];
  46 
  47     return MPI_SUCCESS;
  48 }

/* [<][>][^][v][top][bottom][index][help] */