1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef MCA_COLL_BASE_TOPO_H_HAS_BEEN_INCLUDED
20 #define MCA_COLL_BASE_TOPO_H_HAS_BEEN_INCLUDED
21
22 #include "ompi_config.h"
23 #include <stddef.h>
24
25 #define MAXTREEFANOUT 32
26
27 #define MEMBSIZE(type, member) (sizeof(((type *)0)->member[0]))
28 #define COLL_TREE_SIZE(fanout) \
29 (offsetof(ompi_coll_tree_t, tree_next) + (fanout) * MEMBSIZE(ompi_coll_tree_t, tree_next))
30
31 BEGIN_C_DECLS
32
33 typedef struct ompi_coll_tree_t {
34 int32_t tree_root;
35 int32_t tree_fanout;
36 int32_t tree_bmtree;
37 int32_t tree_prev;
38 int32_t tree_nextsize;
39 int32_t tree_next[];
40 } ompi_coll_tree_t;
41
42 ompi_coll_tree_t*
43 ompi_coll_base_topo_build_tree( int fanout,
44 struct ompi_communicator_t* com,
45 int root );
46 ompi_coll_tree_t*
47 ompi_coll_base_topo_build_in_order_bintree( struct ompi_communicator_t* comm );
48
49 ompi_coll_tree_t*
50 ompi_coll_base_topo_build_bmtree( struct ompi_communicator_t* comm,
51 int root );
52 ompi_coll_tree_t*
53 ompi_coll_base_topo_build_in_order_bmtree( struct ompi_communicator_t* comm,
54 int root );
55
56 ompi_coll_tree_t*
57 ompi_coll_base_topo_build_kmtree(struct ompi_communicator_t* comm,
58 int root, int radix);
59
60 ompi_coll_tree_t*
61 ompi_coll_base_topo_build_chain( int fanout,
62 struct ompi_communicator_t* com,
63 int root );
64
65 int ompi_coll_base_topo_destroy_tree( ompi_coll_tree_t** tree );
66
67
68 int ompi_coll_base_topo_dump_tree (ompi_coll_tree_t* tree, int rank);
69
70 END_C_DECLS
71
72 #endif