This source file includes following definitions.
- orte_grpcomm_base_close
- orte_grpcomm_base_open
- scon
- sdes
- ccon
- cdes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 #include "orte_config.h"
27 #include "orte/constants.h"
28
29 #include "orte/mca/mca.h"
30 #include "opal/util/output.h"
31 #include "opal/mca/base/base.h"
32
33 #include "orte/mca/rml/rml.h"
34 #include "orte/mca/state/state.h"
35
36 #include "orte/mca/grpcomm/base/base.h"
37
38
39
40
41
42
43
44
45 #include "orte/mca/grpcomm/base/static-components.h"
46
47
48
49
50 orte_grpcomm_base_t orte_grpcomm_base = {{{0}}};
51
52 orte_grpcomm_API_module_t orte_grpcomm = {
53 orte_grpcomm_API_xcast,
54 orte_grpcomm_API_allgather
55 };
56
57 static bool recv_issued = false;
58
59 static int orte_grpcomm_base_close(void)
60 {
61 orte_grpcomm_base_active_t *active;
62 void *key;
63 size_t size;
64 uint32_t *seq_number;
65
66 if (recv_issued) {
67 orte_rml.recv_cancel(ORTE_NAME_WILDCARD, ORTE_RML_TAG_XCAST);
68 recv_issued = false;
69 }
70
71
72 OPAL_LIST_FOREACH(active, &orte_grpcomm_base.actives, orte_grpcomm_base_active_t) {
73 if (NULL != active->module->finalize) {
74 active->module->finalize();
75 }
76 }
77 OPAL_LIST_DESTRUCT(&orte_grpcomm_base.actives);
78 OPAL_LIST_DESTRUCT(&orte_grpcomm_base.ongoing);
79 for (void *_nptr=NULL; \
80 OPAL_SUCCESS == opal_hash_table_get_next_key_ptr(&orte_grpcomm_base.sig_table, &key, &size, (void **)&seq_number, _nptr, &_nptr);) {
81 free(seq_number);
82 }
83 OBJ_DESTRUCT(&orte_grpcomm_base.sig_table);
84
85 return mca_base_framework_components_close(&orte_grpcomm_base_framework, NULL);
86 }
87
88
89
90
91
92 static int orte_grpcomm_base_open(mca_base_open_flag_t flags)
93 {
94 OBJ_CONSTRUCT(&orte_grpcomm_base.actives, opal_list_t);
95 OBJ_CONSTRUCT(&orte_grpcomm_base.ongoing, opal_list_t);
96 OBJ_CONSTRUCT(&orte_grpcomm_base.sig_table, opal_hash_table_t);
97 opal_hash_table_init(&orte_grpcomm_base.sig_table, 128);
98
99 return mca_base_framework_components_open(&orte_grpcomm_base_framework, flags);
100 }
101
102 MCA_BASE_FRAMEWORK_DECLARE(orte, grpcomm, "GRPCOMM", NULL,
103 orte_grpcomm_base_open,
104 orte_grpcomm_base_close,
105 mca_grpcomm_base_static_components, 0);
106
107 OBJ_CLASS_INSTANCE(orte_grpcomm_base_active_t,
108 opal_list_item_t,
109 NULL, NULL);
110
111 static void scon(orte_grpcomm_signature_t *p)
112 {
113 p->signature = NULL;
114 p->sz = 0;
115 }
116 static void sdes(orte_grpcomm_signature_t *p)
117 {
118 if (NULL != p->signature) {
119 free(p->signature);
120 }
121 }
122 OBJ_CLASS_INSTANCE(orte_grpcomm_signature_t,
123 opal_object_t,
124 scon, sdes);
125
126 static void ccon(orte_grpcomm_coll_t *p)
127 {
128 p->sig = NULL;
129 OBJ_CONSTRUCT(&p->bucket, opal_buffer_t);
130 OBJ_CONSTRUCT(&p->distance_mask_recv, opal_bitmap_t);
131 p->dmns = NULL;
132 p->ndmns = 0;
133 p->nexpected = 0;
134 p->nreported = 0;
135 p->cbfunc = NULL;
136 p->cbdata = NULL;
137 p->buffers = NULL;
138 }
139 static void cdes(orte_grpcomm_coll_t *p)
140 {
141 if (NULL != p->sig) {
142 OBJ_RELEASE(p->sig);
143 }
144 OBJ_DESTRUCT(&p->bucket);
145 OBJ_DESTRUCT(&p->distance_mask_recv);
146 free(p->dmns);
147 free(p->buffers);
148 }
149 OBJ_CLASS_INSTANCE(orte_grpcomm_coll_t,
150 opal_list_item_t,
151 ccon, cdes);