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
33 changes: 33 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 @@ -2604,6 +2619,8 @@ OMPI_DECLSPEC int MPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandle
OMPI_DECLSPEC int MPI_Win_get_group(MPI_Win win, MPI_Group *group);
OMPI_DECLSPEC int MPI_Win_get_info(MPI_Win win, MPI_Info *info_used);
OMPI_DECLSPEC int MPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen);
OMPI_DECLSPEC int MPI_Win_get_notify_value(MPI_Win win, int notification_idx, MPI_Count *value);
OMPI_DECLSPEC int MPI_Win_reset_notify_value(MPI_Win win, int notification_idx, MPI_Count *value);
OMPI_DECLSPEC int MPI_Win_lock(int lock_type, int rank, int mpi_assert, MPI_Win win);
OMPI_DECLSPEC int MPI_Win_lock_all(int mpi_assert, MPI_Win win);
OMPI_DECLSPEC int MPI_Win_post(MPI_Group group, int mpi_assert, MPI_Win win);
Expand Down Expand Up @@ -3091,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 @@ -3354,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 Expand Up @@ -3778,6 +3809,8 @@ OMPI_DECLSPEC int PMPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler *errhandl
OMPI_DECLSPEC int PMPI_Win_get_group(MPI_Win win, MPI_Group *group);
OMPI_DECLSPEC int PMPI_Win_get_info(MPI_Win win, MPI_Info *info_used);
OMPI_DECLSPEC int PMPI_Win_get_name(MPI_Win win, char *win_name, int *resultlen);
OMPI_DECLSPEC int PMPI_Win_get_notify_value(MPI_Win win, int notification_idx, MPI_Count *value);
OMPI_DECLSPEC int PMPI_Win_reset_notify_value(MPI_Win win, int notification_idx, MPI_Count *value);
OMPI_DECLSPEC int PMPI_Win_lock(int lock_type, int rank, int mpi_assert, MPI_Win win);
OMPI_DECLSPEC int PMPI_Win_lock_all(int mpi_assert, MPI_Win win);
OMPI_DECLSPEC int PMPI_Win_post(MPI_Group group, int mpi_assert, MPI_Win win);
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
54 changes: 53 additions & 1 deletion ompi/mca/osc/osc.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ 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_notify_fn_t)(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win);

typedef int (*ompi_osc_base_module_get_fn_t)(void *origin_addr,
size_t origin_count,
Expand All @@ -226,6 +235,23 @@ 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_notify_fn_t)(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win);

typedef int (*ompi_osc_base_module_win_get_notify_value_fn_t)(struct ompi_win_t *win,
int notify,
OMPI_MPI_COUNT_TYPE *value);

typedef int (*ompi_osc_base_module_win_reset_notify_value_fn_t)(struct ompi_win_t *win,
int notify,
OMPI_MPI_COUNT_TYPE *value);

typedef int (*ompi_osc_base_module_accumulate_fn_t)(const void *origin_addr,
size_t origin_count,
Expand Down Expand Up @@ -276,6 +302,17 @@ 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_notify_fn_t)(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win,
struct ompi_request_t **request);

typedef int (*ompi_osc_base_module_rget_fn_t)(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
Expand All @@ -286,6 +323,16 @@ 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_notify_fn_t)(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win,
struct ompi_request_t **request);

typedef int (*ompi_osc_base_module_raccumulate_fn_t)(const void *origin_addr,
size_t origin_count,
Expand Down Expand Up @@ -371,7 +418,6 @@ typedef int (*ompi_osc_base_module_flush_local_all_fn_t)(struct ompi_win_t *win)
* module structure.
*/

// TODO: extend the struct and add pointers to put/get_with_notify functions
struct ompi_osc_base_module_4_0_0_t {
ompi_osc_base_module_win_shared_query_fn_t osc_win_shared_query;

Expand Down Expand Up @@ -409,6 +455,12 @@ struct ompi_osc_base_module_4_0_0_t {
ompi_osc_base_module_flush_all_fn_t osc_flush_all;
ompi_osc_base_module_flush_local_fn_t osc_flush_local;
ompi_osc_base_module_flush_local_all_fn_t osc_flush_local_all;
ompi_osc_base_module_put_notify_fn_t osc_put_notify;
ompi_osc_base_module_get_notify_fn_t osc_get_notify;
ompi_osc_base_module_win_get_notify_value_fn_t osc_win_get_notify_value;
ompi_osc_base_module_win_reset_notify_value_fn_t osc_win_reset_notify_value;
ompi_osc_base_module_rput_notify_fn_t osc_rput_notify;
ompi_osc_base_module_rget_notify_fn_t osc_rget_notify;
};
typedef struct ompi_osc_base_module_4_0_0_t ompi_osc_base_module_4_0_0_t;
typedef ompi_osc_base_module_4_0_0_t ompi_osc_base_module_t;
Expand Down
57 changes: 55 additions & 2 deletions ompi/mca/osc/sm/osc_sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ typedef uint64_t osc_sm_post_type_t;
typedef opal_atomic_uint64_t osc_sm_post_atomic_type_t;
#define OSC_SM_POST_BITS 6
#define OSC_SM_POST_MASK 0x3f
#define OSC_SM_MAX_NOTIFY_COUNTERS 16

/* data shared across all peers */
struct ompi_osc_sm_global_state_t {
Expand All @@ -47,6 +48,9 @@ struct ompi_osc_sm_node_state_t {
opal_atomic_int32_t complete_count;
ompi_osc_sm_lock_t lock;
opal_atomic_lock_t accumulate_lock;
uint32_t notify_counter_count;
uint64_t notify_counter_offset; /* offset from segment_base, not raw pointer */

};
typedef struct ompi_osc_sm_node_state_t ompi_osc_sm_node_state_t;

Expand Down Expand Up @@ -79,7 +83,7 @@ struct ompi_osc_sm_module_t {
size_t *sizes;
void **bases;
ptrdiff_t *disp_units;
uint64_t **notify_counters;
uint64_t *notify_counters;


ompi_group_t *start_group;
Expand Down Expand Up @@ -107,7 +111,6 @@ 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

int ompi_osc_sm_put(const void *origin_addr,
size_t origin_count,
Expand All @@ -118,6 +121,16 @@ 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_notify(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win);

int ompi_osc_sm_get(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
Expand All @@ -127,6 +140,24 @@ int ompi_osc_sm_get(void *origin_addr,
struct ompi_datatype_t *target_dt,
struct ompi_win_t *win);

int ompi_osc_sm_get_notify(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win);

int ompi_osc_sm_win_get_notify_value(struct ompi_win_t *win,
int notify,
OMPI_MPI_COUNT_TYPE *value);

int ompi_osc_sm_win_reset_notify_value(struct ompi_win_t *win,
int notify,
OMPI_MPI_COUNT_TYPE *value);

int ompi_osc_sm_accumulate(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
Expand Down Expand Up @@ -176,6 +207,17 @@ int ompi_osc_sm_rput(const void *origin_addr,
struct ompi_win_t *win,
struct ompi_request_t **request);

int ompi_osc_sm_rput_notify(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win,
struct ompi_request_t **request);

int ompi_osc_sm_rget(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
Expand All @@ -186,6 +228,17 @@ int ompi_osc_sm_rget(void *origin_addr,
struct ompi_win_t *win,
struct ompi_request_t **request);

int ompi_osc_sm_rget_notify(void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
int target,
ptrdiff_t target_disp,
size_t target_count,
struct ompi_datatype_t *target_dt,
int notify,
struct ompi_win_t *win,
struct ompi_request_t **request);

int ompi_osc_sm_raccumulate(const void *origin_addr,
size_t origin_count,
struct ompi_datatype_t *origin_dt,
Expand Down
Loading
Loading