root/ompi/mca/topo/base/base.h

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

INCLUDED FROM


   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) 2008      Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
  14  * Copyright (c) 2012-2013 Los Alamos National Security, Inc.  All rights reserved.
  15  * Copyright (c) 2012-2013 Inria.  All rights reserved.
  16  * Copyright (c) 2014-2015 Research Organization for Information Science
  17  *                         and Technology (RIST). All rights reserved.
  18  * Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
  19  * $COPYRIGHT$
  20  *
  21  * Additional copyrights may follow
  22  *
  23  * $HEADER$
  24  */
  25 
  26 #ifndef MCA_TOPO_BASE_H
  27 #define MCA_TOPO_BASE_H
  28 
  29 #include "ompi_config.h"
  30 
  31 #include "opal/class/opal_list.h"
  32 #include "ompi/mca/mca.h"
  33 #include "ompi/mca/topo/topo.h"
  34 #include "ompi/proc/proc.h"
  35 #include "ompi/communicator/communicator.h"
  36 #include "ompi/info/info.h"
  37 
  38 /*
  39  * All stuff goes in here
  40  */
  41 
  42 BEGIN_C_DECLS
  43 
  44 /* Lazily initialize the framework (if it wasn't already) */
  45 OMPI_DECLSPEC int mca_topo_base_lazy_init(void);
  46 
  47 /*
  48  * MCA Framework
  49  */
  50 OMPI_DECLSPEC extern mca_base_framework_t ompi_topo_base_framework;
  51 
  52 /* Select a topo module for a particular type of topology */
  53 OMPI_DECLSPEC int
  54 mca_topo_base_comm_select(const ompi_communicator_t*  comm,
  55                           mca_topo_base_module_t*     preferred_module,
  56                           mca_topo_base_module_t**    selected_module,
  57                           uint32_t                    type);
  58 
  59 /* Find all components that want to be considered in this job */
  60 OMPI_DECLSPEC int
  61 mca_topo_base_find_available(bool enable_progress_threads,
  62                              bool enable_mpi_threads);
  63 
  64 /*
  65  * All the glue functions which we will provide to the users by
  66  * default. The component authors need to only write back-end
  67  * functions for cart_create(), graph_create(), graph_map(), and
  68  * cart_map() for their topology components.  But they can implement
  69  * these glue functions if they want.
  70  *
  71  * These glue functions
  72  */
  73 OMPI_DECLSPEC int
  74 mca_topo_base_cart_create(mca_topo_base_module_t *topo_module,
  75                           ompi_communicator_t* old_comm,
  76                           int ndims,
  77                           const int *dims,
  78                           const int *periods,
  79                           bool reorder,
  80                           ompi_communicator_t** comm_topo);
  81 
  82 OMPI_DECLSPEC int
  83 mca_topo_base_cart_coords(ompi_communicator_t *comm,
  84                           int rank,
  85                           int maxdims,
  86                           int *coords);
  87 
  88 OMPI_DECLSPEC int
  89 mca_topo_base_cartdim_get(ompi_communicator_t *comm,
  90                           int *ndims);
  91 
  92 OMPI_DECLSPEC int
  93 mca_topo_base_cart_get(ompi_communicator_t *comm,
  94                        int maxdims,
  95                        int *dims,
  96                        int *periods,
  97                        int *coords);
  98 
  99 OMPI_DECLSPEC int
 100 mca_topo_base_cart_map(ompi_communicator_t * comm,
 101                        int ndims,
 102                        const int *dims, const int *periods, int *newrank);
 103 
 104 OMPI_DECLSPEC int
 105 mca_topo_base_cart_rank(ompi_communicator_t *comm,
 106                         const int *coords,
 107                         int *rank);
 108 
 109 OMPI_DECLSPEC int
 110 mca_topo_base_cart_shift(ompi_communicator_t *comm,
 111                          int direction,
 112                          int disp,
 113                          int *rank_source,
 114                          int *rank_dest);
 115 
 116 OMPI_DECLSPEC int
 117 mca_topo_base_cart_sub(ompi_communicator_t *comm,
 118                        const int *remain_dims,
 119                        ompi_communicator_t **new_comm);
 120 
 121 OMPI_DECLSPEC int
 122 mca_topo_base_graphdims_get(ompi_communicator_t *comm,
 123                             int *nodes,
 124                             int *nedges);
 125 
 126 OMPI_DECLSPEC int
 127 mca_topo_base_graph_create(mca_topo_base_module_t *topo_module,
 128                            ompi_communicator_t* old_comm,
 129                            int nnodes,
 130                            const int *index,
 131                            const int *edges,
 132                            bool reorder,
 133                            ompi_communicator_t** new_comm);
 134 
 135 OMPI_DECLSPEC int
 136 mca_topo_base_graph_get(ompi_communicator_t *comm,
 137                         int maxindex,
 138                         int maxedges,
 139                         int *index,
 140                         int *edges);
 141 
 142 OMPI_DECLSPEC int
 143 mca_topo_base_graph_map(ompi_communicator_t * comm,
 144                         int nnodes,
 145                         const int *index, const int *edges, int *newrank);
 146 
 147 OMPI_DECLSPEC int
 148 mca_topo_base_graph_neighbors(ompi_communicator_t *comm,
 149                               int rank,
 150                               int maxneighbors,
 151                               int *neighbors);
 152 
 153 OMPI_DECLSPEC int
 154 mca_topo_base_graph_neighbors_count(ompi_communicator_t *comm,
 155                                     int rank,
 156                                     int *nneighbors);
 157 
 158 /**
 159  * Efficiently distribute the information about the distributed graph as
 160  * submitted through the distributed graph interface.
 161  */
 162 OMPI_DECLSPEC int
 163 mca_topo_base_dist_graph_distribute(mca_topo_base_module_t* module,
 164                                     ompi_communicator_t *comm,
 165                                     int n, const int nodes[],
 166                                     const int degrees[], const int targets[],
 167                                     const int weights[],
 168                                     mca_topo_base_comm_dist_graph_2_2_0_t** ptopo);
 169 
 170 OMPI_DECLSPEC int
 171 mca_topo_base_dist_graph_create(mca_topo_base_module_t* module,
 172                                 ompi_communicator_t *old_comm,
 173                                 int n, const int nodes[],
 174                                 const int degrees[], const int targets[], const int weights[],
 175                                 opal_info_t *info, int reorder,
 176                                 ompi_communicator_t **new_comm);
 177 
 178 OMPI_DECLSPEC int
 179 mca_topo_base_dist_graph_create_adjacent(mca_topo_base_module_t* module,
 180                                          ompi_communicator_t *old_comm,
 181                                          int indegree, const int sources[],
 182                                          const int sourceweights[], int outdegree,
 183                                          const int destinations[], const int destweights[],
 184                                          opal_info_t *info, int reorder,
 185                                          ompi_communicator_t **comm_dist_graph);
 186 
 187 OMPI_DECLSPEC int
 188 mca_topo_base_dist_graph_neighbors(ompi_communicator_t *comm,
 189                                    int maxindegree,
 190                                    int sources[], int sourceweights[],
 191                                    int maxoutdegree, int destinations[],
 192                                    int destweights[]);
 193 
 194 OMPI_DECLSPEC int
 195 mca_topo_base_dist_graph_neighbors_count(ompi_communicator_t *comm,
 196                                          int *inneighbors, int *outneighbors, int *weighted);
 197 
 198 
 199 int mca_topo_base_neighbor_count (ompi_communicator_t *comm, int *indegree, int *outdegree);
 200 
 201 END_C_DECLS
 202 
 203 #endif /* MCA_BASE_TOPO_H */

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