Skip to content

Commit f79b94b

Browse files
author
Joseph Antony
committed
Public APIs for:
put_with_notify get_with_notify Signed-off-by: Joseph Antony <jajoseph.antony18@gmail.com>
1 parent 50f1ba0 commit f79b94b

File tree

8 files changed

+194
-0
lines changed

8 files changed

+194
-0
lines changed

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_with_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_with_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_with_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_with_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_with_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_with_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_with_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_with_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
@@ -302,6 +302,7 @@
302302
'MPI_ERR_VALUE_TOO_LARGE': 79,
303303
'MPI_ERR_ERRHANDLER': 80,
304304
'MPI_ERR_LASTCODE': 92,
305+
'MPI_ERR_NOTIFY_IDX': 81,
305306
'MPI_IDENT': 0,
306307
'MPI_CONGRUENT': 1,
307308
'MPI_SIMILAR': 2,

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_with_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_with_notify.c.in \
341343
query_thread.c.in \
342344
raccumulate.c.in \
343345
recv.c.in \

ompi/mpi/c/get_with_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_with_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_WITH_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_with_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+
}

ompi/mpi/c/put_with_notify.c.in

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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) 2006 Cisco Systems, Inc. All rights reserved.
14+
* Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights
15+
* reserved.
16+
* Copyright (c) 2015 Research Organization for Information Science
17+
* and Technology (RIST). All rights reserved.
18+
* Copyright (c) 2024 Triad National Security, LLC. All rights
19+
* reserved.
20+
* $COPYRIGHT$
21+
*
22+
* Additional copyrights may follow
23+
*
24+
* $HEADER$
25+
*/
26+
#include "ompi_config.h"
27+
#include <stdio.h>
28+
29+
#include "ompi/mpi/c/bindings.h"
30+
#include "ompi/runtime/params.h"
31+
#include "ompi/communicator/communicator.h"
32+
#include "ompi/errhandler/errhandler.h"
33+
#include "ompi/win/win.h"
34+
#include "ompi/mca/osc/osc.h"
35+
#include "ompi/datatype/ompi_datatype.h"
36+
#include "ompi/runtime/ompi_spc.h"
37+
38+
PROTOTYPE ERROR_CLASS put_with_notify(BUFFER origin_addr, COUNT origin_count, DATATYPE origin_datatype,
39+
INT target_rank, 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_PUT_WITH_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 (NULL == target_datatype ||
59+
MPI_DATATYPE_NULL == target_datatype) {
60+
rc = MPI_ERR_TYPE;
61+
} else if ( MPI_WIN_FLAVOR_DYNAMIC != win->w_flavor && target_disp < 0 ) {
62+
rc = MPI_ERR_DISP;
63+
} else if (notification_idx < 0) {
64+
rc = MPI_ERR_NOTIFY_IDX;
65+
} else {
66+
OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, origin_datatype, origin_count);
67+
if (OMPI_SUCCESS == rc) {
68+
OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, target_datatype, target_count);
69+
}
70+
}
71+
OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME);
72+
}
73+
74+
if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS;
75+
76+
rc = win->w_osc_module->osc_put_with_notify(origin_addr, origin_count, origin_datatype,
77+
target_rank, target_disp, target_count,
78+
target_datatype, notification_idx. win);
79+
OMPI_ERRHANDLER_RETURN(rc, win, rc, FUNC_NAME);
80+
}

ompi/runtime/ompi_spc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ static const ompi_spc_event_t ompi_spc_events_desc[OMPI_SPC_NUM_COUNTERS] = {
7171
SET_COUNTER_ARRAY(OMPI_SPC_SENDRECV, "The number of times MPI_Sendrecv was called.", false, false),
7272
SET_COUNTER_ARRAY(OMPI_SPC_SENDRECV_REPLACE, "The number of times MPI_Sendrecv_replace was called.", false, false),
7373
SET_COUNTER_ARRAY(OMPI_SPC_PUT, "The number of times MPI_Put was called.", false, false),
74+
SET_COUNTER_ARRAY(OMPI_SPC_PUT_WITH_NOTIFY, "The number of times MPI_Put_with_notify was called.", false, false),
7475
SET_COUNTER_ARRAY(OMPI_SPC_RPUT, "The number of times MPI_Rput was called.", false, false),
7576
SET_COUNTER_ARRAY(OMPI_SPC_GET, "The number of times MPI_Get was called.", false, false),
77+
SET_COUNTER_ARRAY(OMPI_SPC_GET_WITH_NOTIFY, "The number of times MPI_Get was called.", false, false),
7678
SET_COUNTER_ARRAY(OMPI_SPC_RGET, "The number of times MPI_Rget was called.", false, false),
7779
SET_COUNTER_ARRAY(OMPI_SPC_PROBE, "The number of times MPI_Probe was called.", false, false),
7880
SET_COUNTER_ARRAY(OMPI_SPC_IPROBE, "The number of times MPI_Iprobe was called.", false, false),

ompi/runtime/ompi_spc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ typedef enum ompi_spc_counters {
5858
OMPI_SPC_SENDRECV,
5959
OMPI_SPC_SENDRECV_REPLACE,
6060
OMPI_SPC_PUT,
61+
OMPI_SPC_PUT_WITH_NOTIFY,
6162
OMPI_SPC_RPUT,
6263
OMPI_SPC_GET,
64+
OMPI_SPC_GET_WITH_NOTIFY,
6365
OMPI_SPC_RGET,
6466
OMPI_SPC_PROBE,
6567
OMPI_SPC_IPROBE,

0 commit comments

Comments
 (0)