@@ -36,11 +36,17 @@ ompi_osc_rdma_btl_put(ompi_osc_rdma_module_t *module, uint8_t btl_index,
36
36
mca_btl_base_rdma_completion_fn_t cbfunc ,
37
37
void * cbcontext , void * cbdata )
38
38
{
39
- mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
40
-
41
- return btl -> btl_put (btl , endpoint , local_address , remote_address ,
42
- local_handle , remote_handle , size , flags , order ,
43
- cbfunc , cbcontext , cbdata );
39
+ if (module -> use_accelerated_btl ) {
40
+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
41
+ return btl -> btl_put (btl , endpoint , local_address , remote_address ,
42
+ local_handle , remote_handle , size , flags , order ,
43
+ cbfunc , cbcontext , cbdata );
44
+ } else {
45
+ mca_btl_base_am_rdma_module_t * am_rdma = ompi_osc_rdma_selected_am_rdma (module , btl_index );
46
+ return am_rdma -> am_btl_put (am_rdma , endpoint , local_address , remote_address ,
47
+ local_handle , remote_handle , size , flags , order ,
48
+ cbfunc , cbcontext , cbdata );
49
+ }
44
50
}
45
51
46
52
@@ -54,11 +60,18 @@ ompi_osc_rdma_btl_get(ompi_osc_rdma_module_t *module, uint8_t btl_index,
54
60
mca_btl_base_rdma_completion_fn_t cbfunc ,
55
61
void * cbcontext , void * cbdata )
56
62
{
57
- mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
58
63
59
- return btl -> btl_get (btl , endpoint , local_address , remote_address ,
60
- local_handle , remote_handle , size , flags , order ,
61
- cbfunc , cbcontext , cbdata );
64
+ if (module -> use_accelerated_btl ) {
65
+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
66
+ return btl -> btl_get (btl , endpoint , local_address , remote_address ,
67
+ local_handle , remote_handle , size , flags , order ,
68
+ cbfunc , cbcontext , cbdata );
69
+ } else {
70
+ mca_btl_base_am_rdma_module_t * am_rdma = ompi_osc_rdma_selected_am_rdma (module , btl_index );
71
+ return am_rdma -> am_btl_get (am_rdma , endpoint , local_address , remote_address ,
72
+ local_handle , remote_handle , size , flags , order ,
73
+ cbfunc , cbcontext , cbdata );
74
+ }
62
75
}
63
76
64
77
@@ -71,6 +84,9 @@ ompi_osc_rdma_btl_atomic_op(ompi_osc_rdma_module_t *module, uint8_t btl_index,
71
84
{
72
85
mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
73
86
87
+ /* the AM BTL interface does not currently support op calls */
88
+ assert (module -> use_accelerated_btl );
89
+
74
90
return btl -> btl_atomic_op (btl , endpoint , remote_address , remote_handle ,
75
91
op , operand , flags , order ,
76
92
cbfunc , cbcontext , cbdata );
@@ -87,12 +103,19 @@ ompi_osc_rdma_btl_atomic_fop(ompi_osc_rdma_module_t *module, uint8_t btl_index,
87
103
mca_btl_base_rdma_completion_fn_t cbfunc , void * cbcontext , void * cbdata )
88
104
89
105
{
90
- mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
91
-
92
- return btl -> btl_atomic_fop (btl , endpoint , local_address , remote_address ,
93
- local_handle , remote_handle ,
94
- op , operand , flags , order ,
95
- cbfunc , cbcontext , cbdata );
106
+ if (module -> use_accelerated_btl ) {
107
+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
108
+ return btl -> btl_atomic_fop (btl , endpoint , local_address , remote_address ,
109
+ local_handle , remote_handle ,
110
+ op , operand , flags , order ,
111
+ cbfunc , cbcontext , cbdata );
112
+ } else {
113
+ mca_btl_base_am_rdma_module_t * am_rdma = ompi_osc_rdma_selected_am_rdma (module , btl_index );
114
+ return am_rdma -> am_btl_atomic_fop (am_rdma , endpoint , local_address , remote_address ,
115
+ local_handle , remote_handle ,
116
+ op , operand , flags , order ,
117
+ cbfunc , cbcontext , cbdata );
118
+ }
96
119
}
97
120
98
121
@@ -105,12 +128,19 @@ ompi_osc_rdma_btl_atomic_cswap(ompi_osc_rdma_module_t *module, uint8_t btl_index
105
128
uint64_t compare , uint64_t value , int flags , int order ,
106
129
mca_btl_base_rdma_completion_fn_t cbfunc , void * cbcontext , void * cbdata )
107
130
{
108
- mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
109
-
110
- return btl -> btl_atomic_cswap (btl , endpoint , local_address , remote_address ,
111
- local_handle , remote_handle ,
112
- compare , value , flags , order ,
113
- cbfunc , cbcontext , cbdata );
131
+ if (module -> use_accelerated_btl ) {
132
+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
133
+ return btl -> btl_atomic_cswap (btl , endpoint , local_address , remote_address ,
134
+ local_handle , remote_handle ,
135
+ compare , value , flags , order ,
136
+ cbfunc , cbcontext , cbdata );
137
+ } else {
138
+ mca_btl_base_am_rdma_module_t * am_rdma = ompi_osc_rdma_selected_am_rdma (module , btl_index );
139
+ return am_rdma -> am_btl_atomic_cswap (am_rdma , endpoint , local_address , remote_address ,
140
+ local_handle , remote_handle ,
141
+ compare , value , flags , order ,
142
+ cbfunc , cbcontext , cbdata );
143
+ }
114
144
}
115
145
116
146
@@ -195,7 +225,10 @@ ompi_osc_rdma_btl_op(ompi_osc_rdma_module_t *module, uint8_t btl_index,
195
225
mca_btl_base_module_t * selected_btl = ompi_osc_rdma_selected_btl (module , btl_index );
196
226
int ret ;
197
227
198
- if (!(selected_btl -> btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS )) {
228
+ /* if using the AM RDMA interface with alternate BTLs or if the
229
+ accelerated BTL does not support atomic ops, emulate the atomic
230
+ op over a fetch and atomic op */
231
+ if (!module -> use_accelerated_btl || !(selected_btl -> btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS )) {
199
232
return ompi_osc_rdma_btl_fop (module , btl_index , endpoint , address , address_handle , op , operand , flags ,
200
233
NULL , wait_for_completion , cbfunc , cbdata , cbcontext );
201
234
}
0 commit comments