OpenMPI  0.1.1
base.h
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-2005 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$
15  *
16  * Additional copyrights may follow
17  *
18  * $HEADER$
19  */
20 
21 #ifndef MCA_TOPO_BASE_H
22 #define MCA_TOPO_BASE_H
23 
24 #include "ompi_config.h"
25 
26 #include "opal/class/opal_list.h"
27 #include "opal/mca/mca.h"
28 #include "ompi/mca/topo/topo.h"
29 #include "ompi/proc/proc.h"
30 #include "ompi/communicator/communicator.h"
31 
32 /*
33  * All stuff goes in here
34  */
35 
36 BEGIN_C_DECLS
37 
38 
39 OMPI_DECLSPEC int mca_topo_base_open(void);
40 
41 OMPI_DECLSPEC int mca_topo_base_close(void);
42 
43 int mca_topo_base_comm_select(ompi_communicator_t *comm,
44  mca_base_component_t *preferred);
45 
46 int mca_topo_base_comm_unselect(ompi_communicator_t *comm);
47 
48 int mca_topo_base_find_available (bool enable_progress_threads,
49  bool enable_mpi_threads);
50 
51 
52 OMPI_DECLSPEC int mca_topo_base_init_comm (ompi_communicator_t *comm);
53 
54 OMPI_DECLSPEC int mca_topo_base_get_param (ompi_communicator_t *comm, int keyval);
55 
56  /*
57  * All the glue functions which we will provide to the users by
58  * default. The component authors need to only write back-end
59  * functions for graph_map() and cart_map() for their topology
60  * components. But they can implement these glue functions if
61  * they want.
62  */
63 OMPI_DECLSPEC int mca_topo_base_cart_coords (ompi_communicator_t *comm,
64  int rank,
65  int maxdims,
66  int *coords);
67 
68 OMPI_DECLSPEC int mca_topo_base_cart_create (mca_topo_base_comm_t *topo_data,
69  int *proc_count,
70  ompi_proc_t **proc_pointers,
71  int *new_rank,
72  int ndims,
73  int *dims,
74  int *periods,
75  bool reorder);
76 
77 OMPI_DECLSPEC int mca_topo_base_cartdim_get (ompi_communicator_t *comm,
78  int *ndims);
79 
80 OMPI_DECLSPEC int mca_topo_base_cart_get (ompi_communicator_t *comm,
81  int maxdims,
82  int *dims,
83  int *periods,
84  int *coords);
85 
86 OMPI_DECLSPEC int mca_topo_base_cart_rank (ompi_communicator_t *comm,
87  int *coords,
88  int *rank);
89 
90 OMPI_DECLSPEC int mca_topo_base_cart_shift (ompi_communicator_t *comm,
91  int direction,
92  int disp,
93  int *rank_source,
94  int *rank_dest);
95 
96 OMPI_DECLSPEC int mca_topo_base_cart_sub (ompi_communicator_t *comm,
97  int *remain_dims,
98  ompi_communicator_t **new_comm);
99 
100 OMPI_DECLSPEC int mca_topo_base_graph_create (mca_topo_base_comm_t *topo_data,
101  int *proc_count,
102  ompi_proc_t **proc_pointers,
103  int *new_rank,
104  int nnodes,
105  int *index,
106  int *edges,
107  bool reorder);
108 
109 OMPI_DECLSPEC int mca_topo_base_graphdims_get (ompi_communicator_t *comm,
110  int *nodes,
111  int *nedges);
112 
113 OMPI_DECLSPEC int mca_topo_base_graph_get (ompi_communicator_t *comm,
114  int maxindex,
115  int maxedges,
116  int *index,
117  int *edges);
118 
119 OMPI_DECLSPEC int mca_topo_base_graph_neighbors (ompi_communicator_t *comm,
120  int rank,
121  int maxneighbors,
122  int *neighbors);
123 
124 OMPI_DECLSPEC int mca_topo_base_graph_neighbors_count (ompi_communicator_t *comm,
125  int rank,
126  int *nneighbors);
127 
128 
129 /*
130  * Globals
131  */
132 OMPI_DECLSPEC extern int mca_topo_base_output;
133 extern int mca_topo_base_param;
134 
135 OMPI_DECLSPEC extern opal_list_t mca_topo_base_components_available;
136 OMPI_DECLSPEC extern opal_list_t mca_topo_base_components_opened;
137 
138 extern bool mca_topo_base_components_opened_valid;
139 extern bool mca_topo_base_components_available_valid;
140 
141 END_C_DECLS
142 
143 #endif /* MCA_BASE_TOPO_H */
Definition: topo.h:110
Common type for all MCA components.
Definition: mca.h:250
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
Process identification structure interface.
Remote Open MPI process structure.
Definition: proc.h:56
Top-level interface for all MCA components.
Definition: opal_list.h:147
Definition: communicator.h:118