Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ enum {
#define MPI_ERR_SESSION 78
#define MPI_ERR_VALUE_TOO_LARGE 79
#define MPI_ERR_ERRHANDLER 80
#define MPI_ERR_NOTIFY_IDX 81

/* Per MPI-3 p349 47, MPI_ERR_LASTCODE must be >= the last predefined
MPI_ERR_<foo> code. Set the last code to allow some room for adding
Expand Down Expand Up @@ -1917,6 +1918,14 @@ OMPI_DECLSPEC int MPI_Get_c(void *origin_addr, MPI_Count origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, MPI_Win win);
OMPI_DECLSPEC int MPI_Get_notify(void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int MPI_Get_notify_c(void *origin_addr, MPI_Count origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int MPI_Get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
void *result_addr, int result_count, MPI_Datatype result_datatype,
int target_rank, MPI_Aint target_disp, int target_count,
Expand Down Expand Up @@ -2180,6 +2189,12 @@ OMPI_DECLSPEC int MPI_Put(const void *origin_addr, int origin_count, MPI_Dataty
OMPI_DECLSPEC int MPI_Put_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, MPI_Win win);
OMPI_DECLSPEC int MPI_Put_notify(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int MPI_Put_notify_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int MPI_Query_thread(int *provided);
OMPI_DECLSPEC int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, int target_count,
Expand Down Expand Up @@ -3093,6 +3108,14 @@ OMPI_DECLSPEC int PMPI_Get_c(void *origin_addr, MPI_Count origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, MPI_Win win);
OMPI_DECLSPEC int PMPI_Get_notify(void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int PMPI_Get_notify_c(void *origin_addr, MPI_Count origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int PMPI_Get_accumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
void *result_addr, int result_count, MPI_Datatype result_datatype,
int target_rank, MPI_Aint target_disp, int target_count,
Expand Down Expand Up @@ -3356,6 +3379,12 @@ OMPI_DECLSPEC int PMPI_Put(const void *origin_addr, int origin_count, MPI_Datat
OMPI_DECLSPEC int PMPI_Put_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, MPI_Win win);
OMPI_DECLSPEC int PMPI_Put_notify(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int PMPI_Put_notify_c(const void *origin_addr, MPI_Count origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, int notification_idx, MPI_Win win);
OMPI_DECLSPEC int PMPI_Query_thread(int *provided);
OMPI_DECLSPEC int PMPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
int target_rank, MPI_Aint target_disp, int target_count,
Expand Down
1 change: 1 addition & 0 deletions ompi/include/mpif-values.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@
'MPI_ERR_SESSION': 78,
'MPI_ERR_VALUE_TOO_LARGE': 79,
'MPI_ERR_ERRHANDLER': 80,
'MPI_ERR_NOTIFY_IDX': 81,
'MPI_ERR_LASTCODE': 92,
'MPI_IDENT': 0,
'MPI_CONGRUENT': 1,
Expand Down
16 changes: 8 additions & 8 deletions ompi/mca/osc/osc.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ typedef int (*ompi_osc_base_module_put_fn_t)(const void *origin_addr,
struct ompi_datatype_t *target_dt,
struct ompi_win_t *win);

typedef int (*ompi_osc_base_module_put_with_notify_fn_t)(const void *origin_addr,
typedef int (*ompi_osc_base_module_put_notify_fn_t)(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand All @@ -235,7 +235,7 @@ typedef int (*ompi_osc_base_module_get_fn_t)(void *origin_addr,
struct ompi_datatype_t *target_dt,
struct ompi_win_t *win);

typedef int (*ompi_osc_base_module_get_with_notify_fn_t)(void *origin_addr,
typedef int (*ompi_osc_base_module_get_notify_fn_t)(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down Expand Up @@ -294,7 +294,7 @@ typedef int (*ompi_osc_base_module_rput_fn_t)(const void *origin_addr,
struct ompi_win_t *win,
struct ompi_request_t **request);

typedef int (*ompi_osc_base_module_rput_with_notify_fn_t)(const void *origin_addr,
typedef int (*ompi_osc_base_module_rput_notify_fn_t)(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand All @@ -315,7 +315,7 @@ typedef int (*ompi_osc_base_module_rget_fn_t)(void *origin_addr,
struct ompi_win_t *win,
struct ompi_request_t **request);

typedef int (*ompi_osc_base_module_rget_with_notify_fn_t)(void *origin_addr,
typedef int (*ompi_osc_base_module_rget_notify_fn_t)(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down Expand Up @@ -418,18 +418,18 @@ struct ompi_osc_base_module_4_0_0_t {
ompi_osc_base_module_free_fn_t osc_free;

ompi_osc_base_module_put_fn_t osc_put;
ompi_osc_base_module_put_with_notify_fn_t osc_put_with_notify;
ompi_osc_base_module_put_notify_fn_t osc_put_notify;
ompi_osc_base_module_get_fn_t osc_get;
ompi_osc_base_module_get_with_notify_fn_t osc_get_with_notify;
ompi_osc_base_module_get_notify_fn_t osc_get_notify;
ompi_osc_base_module_accumulate_fn_t osc_accumulate;
ompi_osc_base_module_compare_and_swap_fn_t osc_compare_and_swap;
ompi_osc_base_module_fetch_and_op_fn_t osc_fetch_and_op;
ompi_osc_base_module_get_accumulate_fn_t osc_get_accumulate;

ompi_osc_base_module_rput_fn_t osc_rput;
ompi_osc_base_module_rput_with_notify_fn_t osc_rput_with_notify;
ompi_osc_base_module_rput_notify_fn_t osc_rput_notify;
ompi_osc_base_module_rget_fn_t osc_rget;
ompi_osc_base_module_rget_with_notify_fn_t osc_rget_with_notify;
ompi_osc_base_module_rget_notify_fn_t osc_rget_notify;
ompi_osc_base_module_raccumulate_fn_t osc_raccumulate;
ompi_osc_base_module_rget_accumulate_fn_t osc_rget_accumulate;

Expand Down
10 changes: 5 additions & 5 deletions ompi/mca/osc/sm/osc_sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int ompi_osc_sm_detach(struct ompi_win_t *win, const void *base);

int ompi_osc_sm_free(struct ompi_win_t *win);

// TODO: add put/get_with_notify prototypes
// TODO: add put/get_notify prototypes
Copy link
Author

@joe-explr joe-explr Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Will remove todos


int ompi_osc_sm_put(const void *origin_addr,
size_t origin_count,
Expand All @@ -118,7 +118,7 @@ int ompi_osc_sm_put(const void *origin_addr,
struct ompi_datatype_t *target_dt,
struct ompi_win_t *win);

int ompi_osc_sm_put_with_notify(const void *origin_addr,
int ompi_osc_sm_put_notify(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand All @@ -137,7 +137,7 @@ int ompi_osc_sm_get(void *origin_addr,
struct ompi_datatype_t *target_dt,
struct ompi_win_t *win);

int ompi_osc_sm_get_with_notify(void *origin_addr,
int ompi_osc_sm_get_notify(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down Expand Up @@ -196,7 +196,7 @@ int ompi_osc_sm_rput(const void *origin_addr,
struct ompi_win_t *win,
struct ompi_request_t **request);

int ompi_osc_sm_rput_with_notify(const void *origin_addr,
int ompi_osc_sm_rput_notify(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand All @@ -217,7 +217,7 @@ int ompi_osc_sm_rget(void *origin_addr,
struct ompi_win_t *win,
struct ompi_request_t **request);

int ompi_osc_sm_rget_with_notify(void *origin_addr,
int ompi_osc_sm_rget_notify(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down
8 changes: 4 additions & 4 deletions ompi/mca/osc/sm/osc_sm_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ompi_osc_sm_rput(const void *origin_addr,
}

int
ompi_osc_sm_rput_with_notify(const void *origin_addr,
ompi_osc_sm_rput_notify(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down Expand Up @@ -143,7 +143,7 @@ ompi_osc_sm_rget(void *origin_addr,
}

int
ompi_osc_sm_rget_with_notify(void *origin_addr,
ompi_osc_sm_rget_notify(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down Expand Up @@ -323,7 +323,7 @@ ompi_osc_sm_put(const void *origin_addr,


int
ompi_osc_sm_put_with_notify(const void *origin_addr,
ompi_osc_sm_put_notify(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down Expand Up @@ -392,7 +392,7 @@ ompi_osc_sm_get(void *origin_addr,


int
ompi_osc_sm_get_with_notify(void *origin_addr,
ompi_osc_sm_get_notify(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
Expand Down
8 changes: 4 additions & 4 deletions ompi/mca/osc/sm/osc_sm_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ ompi_osc_sm_module_t ompi_osc_sm_module_template = {
.osc_free = ompi_osc_sm_free,

.osc_put = ompi_osc_sm_put,
.osc_put_with_notify = ompi_osc_sm_put_with_notify,
.osc_put_notify = ompi_osc_sm_put_notify,
.osc_get = ompi_osc_sm_get,
.osc_get_with_notify = ompi_osc_sm_get_with_notify,
.osc_get_notify = ompi_osc_sm_get_notify,
.osc_accumulate = ompi_osc_sm_accumulate,
.osc_compare_and_swap = ompi_osc_sm_compare_and_swap,
.osc_fetch_and_op = ompi_osc_sm_fetch_and_op,
.osc_get_accumulate = ompi_osc_sm_get_accumulate,

.osc_rput = ompi_osc_sm_rput,
.osc_rput_with_notify = ompi_osc_sm_rput_with_notify,
.osc_rput_notify = ompi_osc_sm_rput_notify,
.osc_rget = ompi_osc_sm_rget,
.osc_rget_with_notify = ompi_osc_sm_rget_with_notify,
.osc_rget_notify = ompi_osc_sm_rget_notify,
.osc_raccumulate = ompi_osc_sm_raccumulate,
.osc_rget_accumulate = ompi_osc_sm_rget_accumulate,

Expand Down
1 change: 1 addition & 0 deletions ompi/mpi/bindings/ompi_bindings/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'MPI_SUCCESS',
'MPI_ERR_BUFFER',
'MPI_ERR_COUNT',
'MPI_ERR_NOTIFY_IDX'
'MPI_ERR_TYPE',
'MPI_ERR_TAG',
'MPI_ERR_COMM',
Expand Down
2 changes: 2 additions & 0 deletions ompi/mpi/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ prototype_sources = \
get_accumulate.c.in \
get_address.c.in \
get.c.in \
get_notify.c.in \
get_count.c.in \
get_elements.c.in \
get_elements_x.c.in \
Expand Down Expand Up @@ -338,6 +339,7 @@ prototype_sources = \
psend_init.c.in \
publish_name.c.in \
put.c.in \
put_notify.c.in \
query_thread.c.in \
raccumulate.c.in \
recv.c.in \
Expand Down
77 changes: 77 additions & 0 deletions ompi/mpi/c/get_notify.c.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2020 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2024 Triad National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>

#include "ompi/mpi/c/bindings.h"
#include "ompi/runtime/params.h"
#include "ompi/communicator/communicator.h"
#include "ompi/errhandler/errhandler.h"
#include "ompi/win/win.h"
#include "ompi/mca/osc/osc.h"
#include "ompi/datatype/ompi_datatype.h"
#include "ompi/runtime/ompi_spc.h"

PROTOTYPE ERROR_CLASS get_notify(BUFFER_OUT origin_addr, COUNT origin_count,
DATATYPE origin_datatype, INT target_rank,
AINT target_disp, COUNT target_count,
DATATYPE target_datatype, INT notification_idx, WIN win)
{
int rc;

SPC_RECORD(OMPI_SPC_GET_NOTIFY, 1);

if (MPI_PARAM_CHECK) {
rc = OMPI_SUCCESS;

OMPI_ERR_INIT_FINALIZE(FUNC_NAME);

if (ompi_win_invalid(win)) {
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_WIN, FUNC_NAME);
} else if (origin_count < 0 || target_count < 0) {
rc = MPI_ERR_COUNT;
} else if (ompi_win_peer_invalid(win, target_rank) &&
(MPI_PROC_NULL != target_rank)) {
rc = MPI_ERR_RANK;
} else if ( MPI_WIN_FLAVOR_DYNAMIC != win->w_flavor && target_disp < 0 ) {
rc = MPI_ERR_DISP;
} else if (notification_idx < 0) {
rc = MPI_ERR_NOTIFY_IDX;
} else {
OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, origin_datatype, origin_count);
if (OMPI_SUCCESS == rc) {
OMPI_CHECK_DATATYPE_FOR_ONE_SIDED(rc, target_datatype, target_count);
}
}
OMPI_ERRHANDLER_CHECK(rc, win, rc, FUNC_NAME);
}

if (MPI_PROC_NULL == target_rank) return MPI_SUCCESS;

rc = win->w_osc_module->osc_get_notify(origin_addr, origin_count, origin_datatype,
target_rank, target_disp, target_count,
target_datatype, notification_idx, win);
OMPI_ERRHANDLER_RETURN(rc, win, rc, FUNC_NAME);
}
Loading
Loading