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_with_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_with_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_with_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_with_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_with_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_with_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_with_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_with_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 @@ -302,6 +302,7 @@
'MPI_ERR_VALUE_TOO_LARGE': 79,
'MPI_ERR_ERRHANDLER': 80,
'MPI_ERR_LASTCODE': 92,
'MPI_ERR_NOTIFY_IDX': 81,
Copy link
Owner

Choose a reason for hiding this comment

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

This should go before MPI_ERR_LASTCODE.

'MPI_IDENT': 0,
'MPI_CONGRUENT': 1,
'MPI_SIMILAR': 2,
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_with_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_with_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_with_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_with_notify(BUFFER_OUT origin_addr, COUNT origin_count,
Copy link
Owner

Choose a reason for hiding this comment

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

This needs to be consistent with the proposal (get_notify).

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_WITH_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_with_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);
}
80 changes: 80 additions & 0 deletions ompi/mpi/c/put_with_notify.c.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/* -*- 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) 2006 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013-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 put_with_notify(BUFFER 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_PUT_WITH_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 (NULL == target_datatype ||
MPI_DATATYPE_NULL == target_datatype) {
rc = MPI_ERR_TYPE;
} 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_put_with_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);
}
2 changes: 2 additions & 0 deletions ompi/runtime/ompi_spc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ static const ompi_spc_event_t ompi_spc_events_desc[OMPI_SPC_NUM_COUNTERS] = {
SET_COUNTER_ARRAY(OMPI_SPC_SENDRECV, "The number of times MPI_Sendrecv was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_SENDRECV_REPLACE, "The number of times MPI_Sendrecv_replace was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_PUT, "The number of times MPI_Put was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_PUT_WITH_NOTIFY, "The number of times MPI_Put_with_notify was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_RPUT, "The number of times MPI_Rput was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_GET, "The number of times MPI_Get was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_GET_WITH_NOTIFY, "The number of times MPI_Get was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_RGET, "The number of times MPI_Rget was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_PROBE, "The number of times MPI_Probe was called.", false, false),
SET_COUNTER_ARRAY(OMPI_SPC_IPROBE, "The number of times MPI_Iprobe was called.", false, false),
Expand Down
2 changes: 2 additions & 0 deletions ompi/runtime/ompi_spc.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ typedef enum ompi_spc_counters {
OMPI_SPC_SENDRECV,
OMPI_SPC_SENDRECV_REPLACE,
OMPI_SPC_PUT,
OMPI_SPC_PUT_WITH_NOTIFY,
OMPI_SPC_RPUT,
OMPI_SPC_GET,
OMPI_SPC_GET_WITH_NOTIFY,
OMPI_SPC_RGET,
OMPI_SPC_PROBE,
OMPI_SPC_IPROBE,
Expand Down
Loading