This source file includes following definitions.
- ompi_osc_pt2pt_attach
- ompi_osc_pt2pt_detach
- ompi_osc_pt2pt_free
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 "osc_pt2pt.h"
27
28
29 int ompi_osc_pt2pt_attach(struct ompi_win_t *win, void *base, size_t len)
30 {
31 return OMPI_SUCCESS;
32 }
33
34
35 int
36 ompi_osc_pt2pt_detach(struct ompi_win_t *win, const void *base)
37 {
38 return OMPI_SUCCESS;
39 }
40
41
42 int ompi_osc_pt2pt_free(ompi_win_t *win)
43 {
44 int ret = OMPI_SUCCESS;
45 ompi_osc_pt2pt_module_t *module = GET_MODULE(win);
46 ompi_osc_pt2pt_peer_t *peer;
47 uint32_t key;
48 void *node;
49
50 if (NULL == module) {
51 return OMPI_SUCCESS;
52 }
53
54 if (NULL != module->comm) {
55 opal_output_verbose(1, ompi_osc_base_framework.framework_output,
56 "pt2pt component destroying window with id %d",
57 ompi_comm_get_cid(module->comm));
58
59
60 if (ompi_group_size(win->w_group) > 1) {
61 (void) module->comm->c_coll->coll_barrier (module->comm,
62 module->comm->c_coll->coll_barrier_module);
63 }
64
65
66 OPAL_THREAD_SCOPED_LOCK(&mca_osc_pt2pt_component.lock,
67 opal_hash_table_remove_value_uint32(&mca_osc_pt2pt_component.modules,
68 ompi_comm_get_cid(module->comm)));
69 }
70
71 win->w_osc_module = NULL;
72
73 OBJ_DESTRUCT(&module->outstanding_locks);
74 OBJ_DESTRUCT(&module->locks_pending);
75 OBJ_DESTRUCT(&module->locks_pending_lock);
76 OBJ_DESTRUCT(&module->cond);
77 OBJ_DESTRUCT(&module->lock);
78 OBJ_DESTRUCT(&module->all_sync);
79
80
81
82 OPAL_LIST_DESTRUCT(&module->pending_acc);
83 OBJ_DESTRUCT(&module->pending_acc_lock);
84
85 osc_pt2pt_gc_clean (module);
86 OPAL_LIST_DESTRUCT(&module->buffer_gc);
87 OBJ_DESTRUCT(&module->gc_lock);
88
89 ret = opal_hash_table_get_first_key_uint32 (&module->peer_hash, &key, (void **) &peer, &node);
90 while (OPAL_SUCCESS == ret) {
91 OBJ_RELEASE(peer);
92 ret = opal_hash_table_get_next_key_uint32 (&module->peer_hash, &key, (void **) &peer, node,
93 &node);
94 }
95
96 OBJ_DESTRUCT(&module->peer_hash);
97 OBJ_DESTRUCT(&module->peer_lock);
98
99 if (NULL != module->recv_frags) {
100 for (unsigned int i = 0 ; i < module->recv_frag_count ; ++i) {
101 OBJ_DESTRUCT(module->recv_frags + i);
102 }
103
104 free (module->recv_frags);
105 }
106
107 free ((void *) module->epoch_outgoing_frag_count);
108
109 if (NULL != module->comm) {
110 ompi_comm_free(&module->comm);
111 }
112
113 free ((void *) module->free_after);
114
115 free (module);
116
117 return OMPI_SUCCESS;
118 }