root/ompi/mpi/c/dist_graph_neighbors.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_Dist_graph_neighbors

   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) 2012-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 
  18 #include "ompi_config.h"
  19 
  20 #include "ompi/mpi/c/bindings.h"
  21 #include "ompi/runtime/params.h"
  22 #include "ompi/communicator/communicator.h"
  23 #include "ompi/errhandler/errhandler.h"
  24 #include "ompi/memchecker.h"
  25 #include "ompi/mca/topo/topo.h"
  26 #include "ompi/mca/topo/base/base.h"
  27 
  28 #if OMPI_BUILD_MPI_PROFILING
  29 #if OPAL_HAVE_WEAK_SYMBOLS
  30 #pragma weak MPI_Dist_graph_neighbors = PMPI_Dist_graph_neighbors
  31 #endif
  32 #define MPI_Dist_graph_neighbors PMPI_Dist_graph_neighbors
  33 #endif
  34 
  35 static const char FUNC_NAME[] = "MPI_Dist_graph_neighbors";
  36 
  37 
  38 int MPI_Dist_graph_neighbors(MPI_Comm comm, int maxindegree,
  39                              int sources[], int sourceweights[],
  40                              int maxoutdegree, int destinations[],
  41                              int destweights[])
  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 (maxindegree < 0 || maxoutdegree < 0 ||
  55                    (maxindegree > 0 &&
  56                     (NULL == sources || NULL == sourceweights)) ||
  57                    (maxoutdegree > 0 &&
  58                     (NULL == destinations || NULL == destweights))) {
  59             return OMPI_ERRHANDLER_INVOKE(comm, MPI_ERR_ARG, FUNC_NAME);
  60         }
  61     }
  62 
  63     if (!OMPI_COMM_IS_DIST_GRAPH(comm)) {
  64         return OMPI_ERRHANDLER_INVOKE (comm, MPI_ERR_TOPOLOGY,
  65                                        FUNC_NAME);
  66     }
  67 
  68     err = comm->c_topo->topo.dist_graph.dist_graph_neighbors(comm, maxindegree,
  69                                                              sources, sourceweights, maxoutdegree,
  70                                                              destinations, destweights);
  71     OMPI_ERRHANDLER_RETURN(err, comm, err, FUNC_NAME);
  72 }
  73 

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