@@ -26,6 +26,94 @@ void ompi_osc_rdma_atomic_complete(mca_btl_base_module_t *btl, struct mca_btl_ba
2626 void * context , void * data , int status );
2727
2828
29+ static inline int
30+ ompi_osc_rdma_btl_put (ompi_osc_rdma_module_t * module , uint8_t btl_index ,
31+ struct mca_btl_base_endpoint_t * endpoint ,
32+ void * local_address , uint64_t remote_address ,
33+ struct mca_btl_base_registration_handle_t * local_handle ,
34+ struct mca_btl_base_registration_handle_t * remote_handle ,
35+ size_t size , int flags , int order ,
36+ mca_btl_base_rdma_completion_fn_t cbfunc ,
37+ void * cbcontext , void * cbdata )
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 );
44+ }
45+
46+
47+ static inline int
48+ ompi_osc_rdma_btl_get (ompi_osc_rdma_module_t * module , uint8_t btl_index ,
49+ struct mca_btl_base_endpoint_t * endpoint ,
50+ void * local_address , uint64_t remote_address ,
51+ struct mca_btl_base_registration_handle_t * local_handle ,
52+ struct mca_btl_base_registration_handle_t * remote_handle ,
53+ size_t size , int flags , int order ,
54+ mca_btl_base_rdma_completion_fn_t cbfunc ,
55+ void * cbcontext , void * cbdata )
56+ {
57+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
58+
59+ return btl -> btl_get (btl , endpoint , local_address , remote_address ,
60+ local_handle , remote_handle , size , flags , order ,
61+ cbfunc , cbcontext , cbdata );
62+ }
63+
64+
65+ static inline int
66+ ompi_osc_rdma_btl_atomic_op (ompi_osc_rdma_module_t * module , uint8_t btl_index ,
67+ struct mca_btl_base_endpoint_t * endpoint ,
68+ uint64_t remote_address , struct mca_btl_base_registration_handle_t * remote_handle ,
69+ mca_btl_base_atomic_op_t op , uint64_t operand , int flags , int order ,
70+ mca_btl_base_rdma_completion_fn_t cbfunc , void * cbcontext , void * cbdata )
71+ {
72+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , btl_index );
73+
74+ return btl -> btl_atomic_op (btl , endpoint , remote_address , remote_handle ,
75+ op , operand , flags , order ,
76+ cbfunc , cbcontext , cbdata );
77+ }
78+
79+
80+ static inline int
81+ ompi_osc_rdma_btl_atomic_fop (ompi_osc_rdma_module_t * module , uint8_t btl_index ,
82+ struct mca_btl_base_endpoint_t * endpoint ,
83+ void * local_address , uint64_t remote_address ,
84+ struct mca_btl_base_registration_handle_t * local_handle ,
85+ struct mca_btl_base_registration_handle_t * remote_handle ,
86+ mca_btl_base_atomic_op_t op , uint64_t operand , int flags , int order ,
87+ mca_btl_base_rdma_completion_fn_t cbfunc , void * cbcontext , void * cbdata )
88+
89+ {
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 );
96+ }
97+
98+
99+ static inline int
100+ ompi_osc_rdma_btl_atomic_cswap (ompi_osc_rdma_module_t * module , uint8_t btl_index ,
101+ struct mca_btl_base_endpoint_t * endpoint ,
102+ void * local_address , uint64_t remote_address ,
103+ struct mca_btl_base_registration_handle_t * local_handle ,
104+ struct mca_btl_base_registration_handle_t * remote_handle ,
105+ uint64_t compare , uint64_t value , int flags , int order ,
106+ mca_btl_base_rdma_completion_fn_t cbfunc , void * cbcontext , void * cbdata )
107+ {
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 );
114+ }
115+
116+
29117static inline int
30118ompi_osc_rdma_btl_fop (ompi_osc_rdma_module_t * module , uint8_t btl_index ,
31119 struct mca_btl_base_endpoint_t * endpoint , uint64_t address ,
@@ -62,10 +150,10 @@ ompi_osc_rdma_btl_fop(ompi_osc_rdma_module_t *module, uint8_t btl_index,
62150 }
63151
64152 if (NULL != pending_op -> op_frag ) {
65- ret = selected_btl -> btl_atomic_fop ( selected_btl , endpoint , pending_op -> op_buffer ,
66- (intptr_t ) address , pending_op -> op_frag -> handle , address_handle ,
67- op , operand , flags , MCA_BTL_NO_ORDER , ompi_osc_rdma_atomic_complete ,
68- (void * ) pending_op , NULL );
153+ ret = ompi_osc_rdma_btl_atomic_fop ( module , btl_index , endpoint , pending_op -> op_buffer ,
154+ (intptr_t ) address , pending_op -> op_frag -> handle , address_handle ,
155+ op , operand , flags , MCA_BTL_NO_ORDER , ompi_osc_rdma_atomic_complete ,
156+ (void * ) pending_op , NULL );
69157 }
70158
71159 if (OPAL_LIKELY (!ompi_osc_rdma_oor (ret ))) {
@@ -129,9 +217,9 @@ ompi_osc_rdma_btl_op(ompi_osc_rdma_module_t *module, uint8_t btl_index,
129217
130218 /* spin until the btl has accepted the operation */
131219 do {
132- ret = selected_btl -> btl_atomic_op ( selected_btl , endpoint , (intptr_t ) address , address_handle ,
133- op , operand , flags , MCA_BTL_NO_ORDER , ompi_osc_rdma_atomic_complete ,
134- (void * ) pending_op , NULL );
220+ ret = ompi_osc_rdma_btl_atomic_op ( module , btl_index , endpoint , (intptr_t ) address , address_handle ,
221+ op , operand , flags , MCA_BTL_NO_ORDER , ompi_osc_rdma_atomic_complete ,
222+ (void * ) pending_op , NULL );
135223
136224 if (OPAL_LIKELY (!ompi_osc_rdma_oor (ret ))) {
137225 break ;
@@ -167,7 +255,6 @@ ompi_osc_rdma_btl_cswap(ompi_osc_rdma_module_t *module, uint8_t btl_index,
167255 int64_t compare , int64_t value , int flags , int64_t * result )
168256{
169257 ompi_osc_rdma_pending_op_t * pending_op ;
170- mca_btl_base_module_t * selected_btl = ompi_osc_rdma_selected_btl (module , btl_index );
171258 int ret ;
172259
173260 pending_op = OBJ_NEW (ompi_osc_rdma_pending_op_t );
@@ -184,7 +271,7 @@ ompi_osc_rdma_btl_cswap(ompi_osc_rdma_module_t *module, uint8_t btl_index,
184271 ret = ompi_osc_rdma_frag_alloc (module , 8 , & pending_op -> op_frag , (char * * ) & pending_op -> op_buffer );
185272 }
186273 if (NULL != pending_op -> op_frag ) {
187- ret = selected_btl -> btl_atomic_cswap ( selected_btl , endpoint , pending_op -> op_buffer ,
274+ ret = ompi_osc_rdma_btl_atomic_cswap ( module , btl_index , endpoint , pending_op -> op_buffer ,
188275 address , pending_op -> op_frag -> handle , address_handle , compare ,
189276 value , flags , 0 , ompi_osc_rdma_atomic_complete , (void * ) pending_op ,
190277 NULL );
0 commit comments