@@ -59,6 +59,49 @@ ompi_osc_sm_rput(const void *origin_addr,
5959 return OMPI_SUCCESS ;
6060}
6161
62+ int
63+ ompi_osc_sm_rput_with_notify (const void * origin_addr ,
64+ size_t origin_count ,
65+ struct ompi_datatype_t * origin_dt ,
66+ int target ,
67+ ptrdiff_t target_disp ,
68+ size_t target_count ,
69+ struct ompi_datatype_t * target_dt ,
70+ int notify ,
71+ struct ompi_win_t * win ,
72+ struct ompi_request_t * * ompi_req )
73+ {
74+ int ret ;
75+ ompi_osc_sm_module_t * module =
76+ (ompi_osc_sm_module_t * ) win -> w_osc_module ;
77+ void * remote_address ;
78+
79+ OPAL_OUTPUT_VERBOSE ((50 , ompi_osc_base_framework .framework_output ,
80+ "rput_notify: 0x%lx, %zu, %s, %d, %d, %zu, %s, %d, 0x%lx" ,
81+ (unsigned long ) origin_addr , origin_count ,
82+ origin_dt -> name , target , (int ) target_disp ,
83+ target_count , target_dt -> name ,
84+ notify ,
85+ (unsigned long ) win ));
86+
87+ remote_address = ((char * ) (module -> bases [target ])) + module -> disp_units [target ] * target_disp ;
88+
89+ ret = ompi_datatype_sndrcv ((void * )origin_addr , origin_count , origin_dt ,
90+ remote_address , target_count , target_dt );
91+ if (OMPI_SUCCESS != ret ) {
92+ return ret ;
93+ }
94+
95+ /* the only valid field of RMA request status is the MPI_ERROR field.
96+ * ompi_request_empty has status MPI_SUCCESS and indicates the request is
97+ * complete. */
98+ * ompi_req = & ompi_request_empty ;
99+
100+ opal_atomic_wmb ();
101+ opal_atomic_add (& module -> notify_counters [target ][notify ], 1 );
102+
103+ return OMPI_SUCCESS ;
104+ }
62105
63106int
64107ompi_osc_sm_rget (void * origin_addr ,
@@ -99,6 +142,49 @@ ompi_osc_sm_rget(void *origin_addr,
99142 return OMPI_SUCCESS ;
100143}
101144
145+ int
146+ ompi_osc_sm_rget_with_notify (void * origin_addr ,
147+ size_t origin_count ,
148+ struct ompi_datatype_t * origin_dt ,
149+ int target ,
150+ ptrdiff_t target_disp ,
151+ size_t target_count ,
152+ struct ompi_datatype_t * target_dt ,
153+ int notify ,
154+ struct ompi_win_t * win ,
155+ struct ompi_request_t * * ompi_req )
156+ {
157+ int ret ;
158+ ompi_osc_sm_module_t * module =
159+ (ompi_osc_sm_module_t * ) win -> w_osc_module ;
160+ void * remote_address ;
161+
162+ OPAL_OUTPUT_VERBOSE ((50 , ompi_osc_base_framework .framework_output ,
163+ "rget_notify: 0x%lx, %zu, %s, %d, %d, %zu, %s, %d, 0x%lx" ,
164+ (unsigned long ) origin_addr , origin_count ,
165+ origin_dt -> name , target , (int ) target_disp ,
166+ target_count , target_dt -> name ,
167+ notify ,
168+ (unsigned long ) win ));
169+
170+ remote_address = ((char * ) (module -> bases [target ])) + module -> disp_units [target ] * target_disp ;
171+
172+ ret = ompi_datatype_sndrcv (remote_address , target_count , target_dt ,
173+ origin_addr , origin_count , origin_dt );
174+ if (OMPI_SUCCESS != ret ) {
175+ return ret ;
176+ }
177+
178+ /* the only valid field of RMA request status is the MPI_ERROR field.
179+ * ompi_request_empty has status MPI_SUCCESS and indicates the request is
180+ * complete. */
181+ * ompi_req = & ompi_request_empty ;
182+
183+ opal_atomic_rmb ();
184+ opal_atomic_add (& module -> notify_counters [target ][notify ], 1 );
185+
186+ return OMPI_SUCCESS ;
187+ }
102188
103189int
104190ompi_osc_sm_raccumulate (const void * origin_addr ,
@@ -236,6 +322,44 @@ ompi_osc_sm_put(const void *origin_addr,
236322}
237323
238324
325+ int
326+ ompi_osc_sm_put_with_notify (const void * origin_addr ,
327+ size_t origin_count ,
328+ struct ompi_datatype_t * origin_dt ,
329+ int target ,
330+ ptrdiff_t target_disp ,
331+ size_t target_count ,
332+ struct ompi_datatype_t * target_dt ,
333+ int notify ,
334+ struct ompi_win_t * win )
335+ {
336+ int ret ;
337+ ompi_osc_sm_module_t * module =
338+ (ompi_osc_sm_module_t * ) win -> w_osc_module ;
339+ void * remote_address ;
340+
341+ OPAL_OUTPUT_VERBOSE ((50 , ompi_osc_base_framework .framework_output ,
342+ "put_notify: 0x%lx, %zu, %s, %d, %d, %zu, %s, %d, 0x%lx" ,
343+ (unsigned long ) origin_addr , origin_count ,
344+ origin_dt -> name , target , (int ) target_disp ,
345+ target_count , target_dt -> name ,
346+ notify ,
347+ (unsigned long ) win ));
348+
349+ remote_address = ((char * ) (module -> bases [target ])) + module -> disp_units [target ] * target_disp ;
350+
351+ ret = ompi_datatype_sndrcv ((void * )origin_addr , origin_count , origin_dt ,
352+ remote_address , target_count , target_dt );
353+ if (OMPI_SUCCESS != ret ) {
354+ return ret ;
355+ }
356+
357+ opal_atomic_wmb ();
358+ opal_atomic_add (& module -> notify_counters [target ][notify ], 1 );
359+
360+ return ret ;
361+ }
362+
239363int
240364ompi_osc_sm_get (void * origin_addr ,
241365 size_t origin_count ,
@@ -294,7 +418,9 @@ ompi_osc_sm_get_with_notify(void *origin_addr,
294418
295419 ret = ompi_datatype_sndrcv (remote_address , target_count , target_dt ,
296420 origin_addr , origin_count , origin_dt );
297- // TODO: do the same for put_with_notify
421+ if (OMPI_SUCCESS != ret ) {
422+ return ret ;
423+ }
298424 opal_atomic_rmb ();
299425 opal_atomic_add (& module -> notify_counters [target ][notify ], 1 );
300426
@@ -472,5 +598,5 @@ ompi_osc_sm_fetch_and_op(const void *origin_addr,
472598 done :
473599 opal_atomic_unlock (& module -> node_states [target ].accumulate_lock );
474600
475- return OMPI_SUCCESS ;;
601+ return OMPI_SUCCESS ;
476602}
0 commit comments