Skip to content

Commit 6519bd0

Browse files
Joseph Antonyjoe-explr
authored andcommitted
Public APIs for:
put_with_notify get_with_notify Signed-off-by: Joseph Antony <jajoseph.antony18@gmail.com>
1 parent 50f1ba0 commit 6519bd0

12 files changed

Lines changed: 215 additions & 21 deletions

File tree

ompi/include/mpi.h.in

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ enum {
764764
#define MPI_ERR_SESSION 78
765765
#define MPI_ERR_VALUE_TOO_LARGE 79
766766
#define MPI_ERR_ERRHANDLER 80
767+
#define MPI_ERR_NOTIFY_IDX 81
767768

768769
/* Per MPI-3 p349 47, MPI_ERR_LASTCODE must be >= the last predefined
769770
MPI_ERR_<foo> code. Set the last code to allow some room for adding
@@ -1917,6 +1918,14 @@ OMPI_DECLSPEC int MPI_Get_c(void *origin_addr, MPI_Count origin_count,
19171918
MPI_Datatype origin_datatype, int target_rank,
19181919
MPI_Aint target_disp, MPI_Count target_count,
19191920
MPI_Datatype target_datatype, MPI_Win win);
1921+
OMPI_DECLSPEC int MPI_Get_notify(void *origin_addr, int origin_count,
1922+
MPI_Datatype origin_datatype, int target_rank,
1923+
MPI_Aint target_disp, int target_count,
1924+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
1925+
OMPI_DECLSPEC int MPI_Get_notify_c(void *origin_addr, MPI_Count origin_count,
1926+
MPI_Datatype origin_datatype, int target_rank,
1927+
MPI_Aint target_disp, MPI_Count target_count,
1928+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
19201929
OMPI_DECLSPEC int MPI_Get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
19211930
void *result_addr, int result_count, MPI_Datatype result_datatype,
19221931
int target_rank, MPI_Aint target_disp, int target_count,
@@ -2180,6 +2189,12 @@ OMPI_DECLSPEC int MPI_Put(const void *origin_addr, int origin_count, MPI_Dataty
21802189
OMPI_DECLSPEC int MPI_Put_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
21812190
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
21822191
MPI_Datatype target_datatype, MPI_Win win);
2192+
OMPI_DECLSPEC int MPI_Put_notify(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
2193+
int target_rank, MPI_Aint target_disp, int target_count,
2194+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
2195+
OMPI_DECLSPEC int MPI_Put_notify_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
2196+
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
2197+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
21832198
OMPI_DECLSPEC int MPI_Query_thread(int *provided);
21842199
OMPI_DECLSPEC int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
21852200
int target_rank, MPI_Aint target_disp, int target_count,
@@ -3093,6 +3108,14 @@ OMPI_DECLSPEC int PMPI_Get_c(void *origin_addr, MPI_Count origin_count,
30933108
MPI_Datatype origin_datatype, int target_rank,
30943109
MPI_Aint target_disp, MPI_Count target_count,
30953110
MPI_Datatype target_datatype, MPI_Win win);
3111+
OMPI_DECLSPEC int PMPI_Get_notify(void *origin_addr, int origin_count,
3112+
MPI_Datatype origin_datatype, int target_rank,
3113+
MPI_Aint target_disp, int target_count,
3114+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
3115+
OMPI_DECLSPEC int PMPI_Get_notify_c(void *origin_addr, MPI_Count origin_count,
3116+
MPI_Datatype origin_datatype, int target_rank,
3117+
MPI_Aint target_disp, MPI_Count target_count,
3118+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
30963119
OMPI_DECLSPEC int PMPI_Get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
30973120
void *result_addr, int result_count, MPI_Datatype result_datatype,
30983121
int target_rank, MPI_Aint target_disp, int target_count,
@@ -3356,6 +3379,12 @@ OMPI_DECLSPEC int PMPI_Put(const void *origin_addr, int origin_count, MPI_Datat
33563379
OMPI_DECLSPEC int PMPI_Put_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
33573380
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
33583381
MPI_Datatype target_datatype, MPI_Win win);
3382+
OMPI_DECLSPEC int PMPI_Put_notify(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
3383+
int target_rank, MPI_Aint target_disp, int target_count,
3384+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
3385+
OMPI_DECLSPEC int PMPI_Put_notify_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
3386+
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
3387+
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
33593388
OMPI_DECLSPEC int PMPI_Query_thread(int *provided);
33603389
OMPI_DECLSPEC int PMPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
33613390
int target_rank, MPI_Aint target_disp, int target_count,

ompi/include/mpif-values.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
'MPI_ERR_SESSION': 78,
302302
'MPI_ERR_VALUE_TOO_LARGE': 79,
303303
'MPI_ERR_ERRHANDLER': 80,
304+
'MPI_ERR_NOTIFY_IDX': 81,
304305
'MPI_ERR_LASTCODE': 92,
305306
'MPI_IDENT': 0,
306307
'MPI_CONGRUENT': 1,

ompi/mca/osc/osc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ typedef int (*ompi_osc_base_module_put_fn_t)(const void *origin_addr,
216216
struct ompi_datatype_t *target_dt,
217217
struct ompi_win_t *win);
218218

219-
typedef int (*ompi_osc_base_module_put_with_notify_fn_t)(const void *origin_addr,
219+
typedef int (*ompi_osc_base_module_put_notify_fn_t)(const void *origin_addr,
220220
size_t origin_count,
221221
struct ompi_datatype_t *origin_dt,
222222
int target,
@@ -235,7 +235,7 @@ typedef int (*ompi_osc_base_module_get_fn_t)(void *origin_addr,
235235
struct ompi_datatype_t *target_dt,
236236
struct ompi_win_t *win);
237237

238-
typedef int (*ompi_osc_base_module_get_with_notify_fn_t)(void *origin_addr,
238+
typedef int (*ompi_osc_base_module_get_notify_fn_t)(void *origin_addr,
239239
size_t origin_count,
240240
struct ompi_datatype_t *origin_dt,
241241
int target,
@@ -294,7 +294,7 @@ typedef int (*ompi_osc_base_module_rput_fn_t)(const void *origin_addr,
294294
struct ompi_win_t *win,
295295
struct ompi_request_t **request);
296296

297-
typedef int (*ompi_osc_base_module_rput_with_notify_fn_t)(const void *origin_addr,
297+
typedef int (*ompi_osc_base_module_rput_notify_fn_t)(const void *origin_addr,
298298
size_t origin_count,
299299
struct ompi_datatype_t *origin_dt,
300300
int target,
@@ -315,7 +315,7 @@ typedef int (*ompi_osc_base_module_rget_fn_t)(void *origin_addr,
315315
struct ompi_win_t *win,
316316
struct ompi_request_t **request);
317317

318-
typedef int (*ompi_osc_base_module_rget_with_notify_fn_t)(void *origin_addr,
318+
typedef int (*ompi_osc_base_module_rget_notify_fn_t)(void *origin_addr,
319319
size_t origin_count,
320320
struct ompi_datatype_t *origin_dt,
321321
int target,
@@ -418,18 +418,18 @@ struct ompi_osc_base_module_4_0_0_t {
418418
ompi_osc_base_module_free_fn_t osc_free;
419419

420420
ompi_osc_base_module_put_fn_t osc_put;
421-
ompi_osc_base_module_put_with_notify_fn_t osc_put_with_notify;
421+
ompi_osc_base_module_put_notify_fn_t osc_put_notify;
422422
ompi_osc_base_module_get_fn_t osc_get;
423-
ompi_osc_base_module_get_with_notify_fn_t osc_get_with_notify;
423+
ompi_osc_base_module_get_notify_fn_t osc_get_notify;
424424
ompi_osc_base_module_accumulate_fn_t osc_accumulate;
425425
ompi_osc_base_module_compare_and_swap_fn_t osc_compare_and_swap;
426426
ompi_osc_base_module_fetch_and_op_fn_t osc_fetch_and_op;
427427
ompi_osc_base_module_get_accumulate_fn_t osc_get_accumulate;
428428

429429
ompi_osc_base_module_rput_fn_t osc_rput;
430-
ompi_osc_base_module_rput_with_notify_fn_t osc_rput_with_notify;
430+
ompi_osc_base_module_rput_notify_fn_t osc_rput_notify;
431431
ompi_osc_base_module_rget_fn_t osc_rget;
432-
ompi_osc_base_module_rget_with_notify_fn_t osc_rget_with_notify;
432+
ompi_osc_base_module_rget_notify_fn_t osc_rget_notify;
433433
ompi_osc_base_module_raccumulate_fn_t osc_raccumulate;
434434
ompi_osc_base_module_rget_accumulate_fn_t osc_rget_accumulate;
435435

ompi/mca/osc/sm/osc_sm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int ompi_osc_sm_detach(struct ompi_win_t *win, const void *base);
107107

108108
int ompi_osc_sm_free(struct ompi_win_t *win);
109109

110-
// TODO: add put/get_with_notify prototypes
110+
// TODO: add put/get_notify prototypes
111111

112112
int ompi_osc_sm_put(const void *origin_addr,
113113
size_t origin_count,
@@ -118,7 +118,7 @@ int ompi_osc_sm_put(const void *origin_addr,
118118
struct ompi_datatype_t *target_dt,
119119
struct ompi_win_t *win);
120120

121-
int ompi_osc_sm_put_with_notify(const void *origin_addr,
121+
int ompi_osc_sm_put_notify(const void *origin_addr,
122122
size_t origin_count,
123123
struct ompi_datatype_t *origin_dt,
124124
int target,
@@ -137,7 +137,7 @@ int ompi_osc_sm_get(void *origin_addr,
137137
struct ompi_datatype_t *target_dt,
138138
struct ompi_win_t *win);
139139

140-
int ompi_osc_sm_get_with_notify(void *origin_addr,
140+
int ompi_osc_sm_get_notify(void *origin_addr,
141141
size_t origin_count,
142142
struct ompi_datatype_t *origin_dt,
143143
int target,
@@ -196,7 +196,7 @@ int ompi_osc_sm_rput(const void *origin_addr,
196196
struct ompi_win_t *win,
197197
struct ompi_request_t **request);
198198

199-
int ompi_osc_sm_rput_with_notify(const void *origin_addr,
199+
int ompi_osc_sm_rput_notify(const void *origin_addr,
200200
size_t origin_count,
201201
struct ompi_datatype_t *origin_dt,
202202
int target,
@@ -217,7 +217,7 @@ int ompi_osc_sm_rget(void *origin_addr,
217217
struct ompi_win_t *win,
218218
struct ompi_request_t **request);
219219

220-
int ompi_osc_sm_rget_with_notify(void *origin_addr,
220+
int ompi_osc_sm_rget_notify(void *origin_addr,
221221
size_t origin_count,
222222
struct ompi_datatype_t *origin_dt,
223223
int target,

ompi/mca/osc/sm/osc_sm_comm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ompi_osc_sm_rput(const void *origin_addr,
6060
}
6161

6262
int
63-
ompi_osc_sm_rput_with_notify(const void *origin_addr,
63+
ompi_osc_sm_rput_notify(const void *origin_addr,
6464
size_t origin_count,
6565
struct ompi_datatype_t *origin_dt,
6666
int target,
@@ -143,7 +143,7 @@ ompi_osc_sm_rget(void *origin_addr,
143143
}
144144

145145
int
146-
ompi_osc_sm_rget_with_notify(void *origin_addr,
146+
ompi_osc_sm_rget_notify(void *origin_addr,
147147
size_t origin_count,
148148
struct ompi_datatype_t *origin_dt,
149149
int target,
@@ -323,7 +323,7 @@ ompi_osc_sm_put(const void *origin_addr,
323323

324324

325325
int
326-
ompi_osc_sm_put_with_notify(const void *origin_addr,
326+
ompi_osc_sm_put_notify(const void *origin_addr,
327327
size_t origin_count,
328328
struct ompi_datatype_t *origin_dt,
329329
int target,
@@ -392,7 +392,7 @@ ompi_osc_sm_get(void *origin_addr,
392392

393393

394394
int
395-
ompi_osc_sm_get_with_notify(void *origin_addr,
395+
ompi_osc_sm_get_notify(void *origin_addr,
396396
size_t origin_count,
397397
struct ompi_datatype_t *origin_dt,
398398
int target,

ompi/mca/osc/sm/osc_sm_component.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ ompi_osc_sm_module_t ompi_osc_sm_module_template = {
7979
.osc_free = ompi_osc_sm_free,
8080

8181
.osc_put = ompi_osc_sm_put,
82-
.osc_put_with_notify = ompi_osc_sm_put_with_notify,
82+
.osc_put_notify = ompi_osc_sm_put_notify,
8383
.osc_get = ompi_osc_sm_get,
84-
.osc_get_with_notify = ompi_osc_sm_get_with_notify,
84+
.osc_get_notify = ompi_osc_sm_get_notify,
8585
.osc_accumulate = ompi_osc_sm_accumulate,
8686
.osc_compare_and_swap = ompi_osc_sm_compare_and_swap,
8787
.osc_fetch_and_op = ompi_osc_sm_fetch_and_op,
8888
.osc_get_accumulate = ompi_osc_sm_get_accumulate,
8989

9090
.osc_rput = ompi_osc_sm_rput,
91-
.osc_rput_with_notify = ompi_osc_sm_rput_with_notify,
91+
.osc_rput_notify = ompi_osc_sm_rput_notify,
9292
.osc_rget = ompi_osc_sm_rget,
93-
.osc_rget_with_notify = ompi_osc_sm_rget_with_notify,
93+
.osc_rget_notify = ompi_osc_sm_rget_notify,
9494
.osc_raccumulate = ompi_osc_sm_raccumulate,
9595
.osc_rget_accumulate = ompi_osc_sm_rget_accumulate,
9696

ompi/mpi/bindings/ompi_bindings/consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
'MPI_SUCCESS',
2424
'MPI_ERR_BUFFER',
2525
'MPI_ERR_COUNT',
26+
'MPI_ERR_NOTIFY_IDX'
2627
'MPI_ERR_TYPE',
2728
'MPI_ERR_TAG',
2829
'MPI_ERR_COMM',

ompi/mpi/c/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ prototype_sources = \
220220
get_accumulate.c.in \
221221
get_address.c.in \
222222
get.c.in \
223+
get_notify.c.in \
223224
get_count.c.in \
224225
get_elements.c.in \
225226
get_elements_x.c.in \
@@ -338,6 +339,7 @@ prototype_sources = \
338339
psend_init.c.in \
339340
publish_name.c.in \
340341
put.c.in \
342+
put_notify.c.in \
341343
query_thread.c.in \
342344
raccumulate.c.in \
343345
recv.c.in \

ompi/mpi/c/get_notify.c.in

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2+
/*
3+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
4+
* University Research and Technology
5+
* Corporation. All rights reserved.
6+
* Copyright (c) 2004-2020 The University of Tennessee and The University
7+
* of Tennessee Research Foundation. All rights
8+
* reserved.
9+
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
10+
* University of Stuttgart. All rights reserved.
11+
* Copyright (c) 2004-2005 The Regents of the University of California.
12+
* All rights reserved.
13+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
14+
* reserved.
15+
* Copyright (c) 2015 Research Organization for Information Science
16+
* and Technology (RIST). All rights reserved.
17+
* Copyright (c) 2024 Triad National Security, LLC. All rights
18+
* reserved.
19+
* $COPYRIGHT$
20+
*
21+
* Additional copyrights may follow
22+
*
23+
* $HEADER$
24+
*/
25+
#include "ompi_config.h"
26+
#include <stdio.h>
27+
28+
#include "ompi/mpi/c/bindings.h"
29+
#include "ompi/runtime/params.h"
30+
#include "ompi/communicator/communicator.h"
31+
#include "ompi/errhandler/errhandler.h"
32+
#include "ompi/win/win.h"
33+
#include "ompi/mca/osc/osc.h"
34+
#include "ompi/datatype/ompi_datatype.h"
35+
#include "ompi/runtime/ompi_spc.h"
36+
37+
PROTOTYPE ERROR_CLASS get_notify(BUFFER_OUT origin_addr, COUNT origin_count,
38+
DATATYPE origin_datatype, INT target_rank,
39+
AINT target_disp, COUNT target_count,
40+
DATATYPE target_datatype, INT notification_idx, WIN win)
41+
{
42+
int rc;
43+
44+
SPC_RECORD(OMPI_SPC_GET_NOTIFY, 1);
45+
46+
if (MPI_PARAM_CHECK) {
47+
rc = OMPI_SUCCESS;
48+
49+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
50+
51+
if (ompi_win_invalid(win)) {
52+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_WIN, FUNC_NAME);
53+
} else if (origin_count < 0 || target_count < 0) {
54+
rc = MPI_ERR_COUNT;
55+
} else if (ompi_win_peer_invalid(win, target_rank) &&
56+
(MPI_PROC_NULL != target_rank)) {
57+
rc = MPI_ERR_RANK;
58+
} else if ( MPI_WIN_FLAVOR_DYNAMIC != win->w_flavor && target_disp < 0 ) {
59+
rc = MPI_ERR_DISP;
60+
} else if (notification_idx < 0) {
61+
rc = MPI_ERR_NOTIFY_IDX;
62+
} else {
63+
OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, origin_datatype, origin_count);
64+
if (OMPI_SUCCESS == rc) {
65+
OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, target_datatype, target_count);
66+
}
67+
}
68+
OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME);
69+
}
70+
71+
if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS;
72+
73+
rc = win->w_osc_module->osc_get_notify(origin_addr, origin_count, origin_datatype,
74+
target_rank, target_disp, target_count,
75+
target_datatype, notification_idx, win);
76+
OMPI_ERRHANDLER_RETURN(rc, win, rc, FUNC_NAME);
77+
}

0 commit comments

Comments
 (0)