root/ompi/mpi/c/dist_graph_neighbors_count.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Dist_graph_neighbors_count

   1 /*
   2  * Copyright (c) 2008      The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2011-2013 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
   9  * Copyright (c) 2012-2013 Inria.  All rights reserved.
  10  * Copyright (c) 2015      Research Organization for Information Science
  11  *                         and Technology (RIST). All rights reserved.
  12  * $COPYRIGHT$
  13  *
  14  * Additional copyrights may follow
  15  *
  16  */
  17 #include <assert.h>
  18 #include <stdlib.h>
  19 
  20 #include "ompi_config.h"
  21 
  22 #include "ompi/mpi/c/bindings.h"
  23 #include "ompi/runtime/params.h"
  24 #include "ompi/communicator/communicator.h"
  25 #include "ompi/errhandler/errhandler.h"
  26 #include "ompi/memchecker.h"
  27 #include "ompi/mca/topo/topo.h"
  28 #include "ompi/mca/topo/base/base.h"
  29 
  30 #if OMPI_BUILD_MPI_PROFILING
  31 #if OPAL_HAVE_WEAK_SYMBOLS
  32 #pragma weak MPI_Dist_graph_neighbors_count = PMPI_Dist_graph_neighbors_count
  33 #endif
  34 #define MPI_Dist_graph_neighbors_count PMPI_Dist_graph_neighbors_count
  35 #endif
  36 
  37 static const char FUNC_NAME[] = "MPI_Dist_graph_neighbors_count";
  38 
  39 
  40 int MPI_Dist_graph_neighbors_count(MPI_Comm comm, int *inneighbors,
  41                                    int *outneighbors, int *weighted)
  42 {
  43     int err;
  44 
  45     MEMCHECKER(
  46         memchecker_comm(comm);
  47     );
  48 
  49     if (MPI_PARAM_CHECK) {
  50         OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
  51         if (ompi_comm_invalid(comm)) {
  52             return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COMM,
  53                                           FUNC_NAME);
  54         } else if (NULL == inneighbors || NULL == outneighbors ||
  55                    NULL == weighted) {
  56             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
  57         }
  58     }
  59 
  60     if (!OMPI_COMM_IS_DIST_GRAPH(comm)) {
  61         return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_TOPOLOGY,
  62                                        FUNC_NAME);
  63     }
  64     err = comm->c_topo->topo.dist_graph.dist_graph_neighbors_count(comm, inneighbors,
  65                                                                    outneighbors, weighted);
  66     OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
  67 }
  68 

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