Skip to content

Commit 012c680

Browse files
committed
First draft and TODOs for notified comm
Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
1 parent 5fba783 commit 012c680

4 files changed

Lines changed: 43 additions & 0 deletions

File tree

ompi/mca/osc/osc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ typedef int (*ompi_osc_base_module_flush_local_all_fn_t)(struct ompi_win_t *win)
370370
* free to create a structure that inherits this one for use as the
371371
* module structure.
372372
*/
373+
374+
// TODO: extend the struct and add pointers to put/get_with_notify functions
373375
struct ompi_osc_base_module_4_0_0_t {
374376
ompi_osc_base_module_win_shared_query_fn_t osc_win_shared_query;
375377

ompi/mca/osc/sm/osc_sm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ struct ompi_osc_sm_module_t {
7979
size_t *sizes;
8080
void **bases;
8181
ptrdiff_t *disp_units;
82+
uint64_t **notify_counters;
83+
8284

8385
ompi_group_t *start_group;
8486
ompi_group_t *post_group;
@@ -105,6 +107,8 @@ int ompi_osc_sm_detach(struct ompi_win_t *win, const void *base);
105107

106108
int ompi_osc_sm_free(struct ompi_win_t *win);
107109

110+
// TODO: add put/get_with_notify prototypes
111+
108112
int ompi_osc_sm_put(const void *origin_addr,
109113
size_t origin_count,
110114
struct ompi_datatype_t *origin_dt,

ompi/mca/osc/sm/osc_sm_comm.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,41 @@ ompi_osc_sm_get(void *origin_addr,
267267
}
268268

269269

270+
int
271+
ompi_osc_sm_get_with_notify(void *origin_addr,
272+
size_t origin_count,
273+
struct ompi_datatype_t *origin_dt,
274+
int target,
275+
ptrdiff_t target_disp,
276+
size_t target_count,
277+
struct ompi_datatype_t *target_dt,
278+
int notify,
279+
struct ompi_win_t *win)
280+
{
281+
int ret;
282+
ompi_osc_sm_module_t *module =
283+
(ompi_osc_sm_module_t*) win->w_osc_module;
284+
void *remote_address;
285+
286+
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
287+
"get: 0x%lx, %zu, %s, %d, %d, %zu, %s, 0x%lx",
288+
(unsigned long) origin_addr, origin_count,
289+
origin_dt->name, target, (int) target_disp,
290+
target_count, target_dt->name,
291+
(unsigned long) win));
292+
293+
remote_address = ((char*) (module->bases[target])) + module->disp_units[target] * target_disp;
294+
295+
ret = ompi_datatype_sndrcv(remote_address, target_count, target_dt,
296+
origin_addr, origin_count, origin_dt);
297+
// TODO: do the same for put_with_notify
298+
opal_atomic_rmb();
299+
opal_atomic_add(&module->notify_counters[target][notify], 1);
300+
301+
return ret;
302+
}
303+
304+
270305
int
271306
ompi_osc_sm_accumulate(const void *origin_addr,
272307
size_t origin_count,

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ ompi_osc_sm_component_t mca_osc_sm_component = {
7070
MCA_BASE_COMPONENT_INIT(ompi, osc, sm)
7171

7272

73+
// TODO: extend the struct and add pointers to put/get_with_notify functions
74+
// TODO: extend it to rput/rget_with_notify as well
7375
ompi_osc_sm_module_t ompi_osc_sm_module_template = {
7476
{
7577
.osc_win_shared_query = ompi_osc_sm_shared_query,

0 commit comments

Comments
 (0)