Skip to content

Commit 1ce5847

Browse files
committed
osc/rdma: add support for network AMOs
This commit adds support for using network AMOs for MPI_Accumulate, MPI_Fetch_and_op, and MPI_Compare_and_swap. This support is only enabled if the ompi_single_intrinsic info key is specified or the acc_single_interinsic MCA variable is set. This configuration indicates to this implementation that no long accumulates will be performed since these do not currently mix with the AMO implementation. This commit also cleans up the code somwhat. This includes removing unnecessary struct keywords where the type is also typedef'd. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 184d53a commit 1ce5847

9 files changed

+530
-244
lines changed

ompi/mca/osc/rdma/osc_rdma.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* University of Stuttgart. All rights reserved.
99
* Copyright (c) 2004-2005 The Regents of the University of California.
1010
* All rights reserved.
11-
* Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
11+
* Copyright (c) 2007-2016 Los Alamos National Security, LLC. All rights
1212
* reserved.
1313
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
1414
* Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved.
@@ -86,6 +86,12 @@ struct ompi_osc_rdma_component_t {
8686
/** Default value of the no_locks info key for new windows */
8787
bool no_locks;
8888

89+
/** Accumulate operations will only operate on a single intrinsic datatype */
90+
bool acc_single_intrinsic;
91+
92+
/** Use network AMOs when available */
93+
bool acc_use_amo;
94+
8995
/** Priority of the osc/rdma component */
9096
unsigned int priority;
9197

@@ -121,12 +127,13 @@ struct ompi_osc_rdma_module_t {
121127
/** value of same_size info key for this window */
122128
bool same_size;
123129

124-
/** window should have accumulate ordering... */
125-
bool accumulate_ordering;
126-
127130
/** passive-target synchronization will not be used in this window */
128131
bool no_locks;
129132

133+
bool acc_single_intrinsic;
134+
135+
bool acc_use_amo;
136+
130137
/** flavor of this window */
131138
int flavor;
132139

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 416 additions & 131 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
3-
* Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
3+
* Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
44
* reserved.
55
* $COPYRIGHT$
66
*
@@ -14,44 +14,30 @@
1414

1515
#include "osc_rdma.h"
1616

17-
int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare_addr,
18-
void *result_addr, struct ompi_datatype_t *dt,
19-
int target, OPAL_PTRDIFF_TYPE target_disp,
20-
struct ompi_win_t *win);
21-
22-
int ompi_osc_rdma_accumulate (const void *origin_addr, int origin_count,
23-
struct ompi_datatype_t *origin_dt,
24-
int target, OPAL_PTRDIFF_TYPE target_disp,
25-
int target_count, struct ompi_datatype_t *target_dt,
26-
struct ompi_op_t *op, struct ompi_win_t *win);
27-
int ompi_osc_rdma_fetch_and_op (const void *origin_addr, void *result_addr,
28-
struct ompi_datatype_t *dt, int target,
29-
OPAL_PTRDIFF_TYPE target_disp,
30-
struct ompi_op_t *op, struct ompi_win_t *win);
31-
32-
int ompi_osc_rdma_get_accumulate (const void *origin_addr, int origin_count,
33-
struct ompi_datatype_t *origin_datatype,
34-
void *result_addr, int result_count,
35-
struct ompi_datatype_t *result_datatype,
36-
int target_rank, MPI_Aint target_disp,
37-
int target_count, struct ompi_datatype_t *target_datatype,
38-
struct ompi_op_t *op, struct ompi_win_t *win);
39-
40-
int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count,
41-
struct ompi_datatype_t *origin_dt,
42-
int target, OPAL_PTRDIFF_TYPE target_disp,
43-
int target_count, struct ompi_datatype_t *target_dt,
44-
struct ompi_op_t *op, struct ompi_win_t *win,
45-
struct ompi_request_t **request);
46-
47-
int ompi_osc_rdma_rget_accumulate (const void *origin_addr, int origin_count,
48-
struct ompi_datatype_t *origin_datatype,
49-
void *result_addr, int result_count,
50-
struct ompi_datatype_t *result_datatype,
51-
int target_rank, MPI_Aint target_disp,
52-
int target_count, struct ompi_datatype_t *target_datatype,
53-
struct ompi_op_t *op, struct ompi_win_t *win,
54-
struct ompi_request_t **request);
17+
int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare_addr, void *result_addr,
18+
ompi_datatype_t *dt, int target_rank, OPAL_PTRDIFF_TYPE target_disp,
19+
ompi_win_t *win);
20+
21+
int ompi_osc_rdma_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank,
22+
OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op,
23+
ompi_win_t *win);
24+
25+
int ompi_osc_rdma_fetch_and_op (const void *origin_addr, void *result_addr, ompi_datatype_t *dt, int target_rank,
26+
OPAL_PTRDIFF_TYPE target_disp, ompi_op_t *op, ompi_win_t *win);
27+
28+
int ompi_osc_rdma_get_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype,
29+
void *result_addr, int result_count, ompi_datatype_t *result_datatype,
30+
int target_rank, MPI_Aint target_disp, int target_count, ompi_datatype_t *target_datatype,
31+
ompi_op_t *op, ompi_win_t *win);
32+
33+
int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank,
34+
OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op,
35+
ompi_win_t *win, ompi_request_t **request);
36+
37+
int ompi_osc_rdma_rget_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype,
38+
void *result_addr, int result_count, ompi_datatype_t *result_datatype,
39+
int target_rank, MPI_Aint target_disp, int target_count, ompi_datatype_t *target_datatype,
40+
ompi_op_t *op, ompi_win_t *win, ompi_request_t **request);
5541

5642

5743
#endif /* OSC_RDMA_ACCUMULATE_H */

ompi/mca/osc/rdma/osc_rdma_comm.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -772,9 +772,9 @@ static int ompi_osc_rdma_get_contig (ompi_osc_rdma_sync_t *sync, ompi_osc_rdma_p
772772
}
773773

774774
static inline int ompi_osc_rdma_put_w_req (ompi_osc_rdma_sync_t *sync, const void *origin_addr, int origin_count,
775-
struct ompi_datatype_t *origin_datatype, ompi_osc_rdma_peer_t *peer,
775+
ompi_datatype_t *origin_datatype, ompi_osc_rdma_peer_t *peer,
776776
OPAL_PTRDIFF_TYPE target_disp, int target_count,
777-
struct ompi_datatype_t *target_datatype, ompi_osc_rdma_request_t *request)
777+
ompi_datatype_t *target_datatype, ompi_osc_rdma_request_t *request)
778778
{
779779
ompi_osc_rdma_module_t *module = sync->module;
780780
mca_btl_base_registration_handle_t *target_handle;
@@ -807,9 +807,9 @@ static inline int ompi_osc_rdma_put_w_req (ompi_osc_rdma_sync_t *sync, const voi
807807
ompi_osc_rdma_put_contig, false);
808808
}
809809

810-
static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *origin_addr, int origin_count, struct ompi_datatype_t *origin_datatype,
810+
static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype,
811811
ompi_osc_rdma_peer_t *peer, OPAL_PTRDIFF_TYPE source_disp, int source_count,
812-
struct ompi_datatype_t *source_datatype, ompi_osc_rdma_request_t *request)
812+
ompi_datatype_t *source_datatype, ompi_osc_rdma_request_t *request)
813813
{
814814
ompi_osc_rdma_module_t *module = sync->module;
815815
mca_btl_base_registration_handle_t *source_handle;
@@ -841,9 +841,9 @@ static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *ori
841841
source_handle, source_count, source_datatype, request,
842842
module->selected_btl->btl_get_limit, ompi_osc_rdma_get_contig, true);
843843
}
844-
int ompi_osc_rdma_put (const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_datatype,
844+
int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype,
845845
int target_rank, OPAL_PTRDIFF_TYPE target_disp, int target_count,
846-
struct ompi_datatype_t *target_datatype, ompi_win_t *win)
846+
ompi_datatype_t *target_datatype, ompi_win_t *win)
847847
{
848848
ompi_osc_rdma_module_t *module = GET_MODULE(win);
849849
ompi_osc_rdma_peer_t *peer;
@@ -862,10 +862,10 @@ int ompi_osc_rdma_put (const void *origin_addr, int origin_count, struct ompi_da
862862
target_count, target_datatype, NULL);
863863
}
864864

865-
int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_datatype,
865+
int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype,
866866
int target_rank, OPAL_PTRDIFF_TYPE target_disp, int target_count,
867-
struct ompi_datatype_t *target_datatype, struct ompi_win_t *win,
868-
struct ompi_request_t **request)
867+
ompi_datatype_t *target_datatype, ompi_win_t *win,
868+
ompi_request_t **request)
869869
{
870870
ompi_osc_rdma_module_t *module = GET_MODULE(win);
871871
ompi_osc_rdma_peer_t *peer;
@@ -897,9 +897,9 @@ int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, struct ompi_d
897897
return OMPI_SUCCESS;
898898
}
899899

900-
int ompi_osc_rdma_get (void *origin_addr, int origin_count, struct ompi_datatype_t *origin_datatype,
900+
int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype,
901901
int source_rank, OPAL_PTRDIFF_TYPE source_disp, int source_count,
902-
struct ompi_datatype_t *source_datatype, struct ompi_win_t *win)
902+
ompi_datatype_t *source_datatype, ompi_win_t *win)
903903
{
904904
ompi_osc_rdma_module_t *module = GET_MODULE(win);
905905
ompi_osc_rdma_peer_t *peer;
@@ -918,10 +918,10 @@ int ompi_osc_rdma_get (void *origin_addr, int origin_count, struct ompi_datatype
918918
source_disp, source_count, source_datatype, NULL);
919919
}
920920

921-
int ompi_osc_rdma_rget (void *origin_addr, int origin_count, struct ompi_datatype_t *origin_datatype,
921+
int ompi_osc_rdma_rget (void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype,
922922
int source_rank, OPAL_PTRDIFF_TYPE source_disp, int source_count,
923-
struct ompi_datatype_t *source_datatype, struct ompi_win_t *win,
924-
struct ompi_request_t **request)
923+
ompi_datatype_t *source_datatype, ompi_win_t *win,
924+
ompi_request_t **request)
925925
{
926926
ompi_osc_rdma_module_t *module = GET_MODULE(win);
927927
ompi_osc_rdma_peer_t *peer;

ompi/mca/osc/rdma/osc_rdma_comm.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,23 @@ static inline int osc_rdma_get_remote_segment (ompi_osc_rdma_module_t *module, o
9696

9797
/* prototypes for implementations of MPI RMA window functions. these will be called from the
9898
* mpi interface (ompi/mpi/c) */
99-
int ompi_osc_rdma_put (const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt,
99+
int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_t *origin_dt,
100100
int target, OPAL_PTRDIFF_TYPE target_disp, int target_count,
101-
struct ompi_datatype_t *target_dt, struct ompi_win_t *win);
101+
ompi_datatype_t *target_dt, ompi_win_t *win);
102102

103-
int ompi_osc_rdma_get (void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt,
103+
int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *origin_dt,
104104
int target, OPAL_PTRDIFF_TYPE target_disp, int target_count,
105-
struct ompi_datatype_t *target_dt, struct ompi_win_t *win);
105+
ompi_datatype_t *target_dt, ompi_win_t *win);
106106

107-
int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt,
107+
int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype_t *origin_dt,
108108
int target, OPAL_PTRDIFF_TYPE target_disp, int target_count,
109-
struct ompi_datatype_t *target_dt, struct ompi_win_t *win,
110-
struct ompi_request_t **request);
109+
ompi_datatype_t *target_dt, ompi_win_t *win,
110+
ompi_request_t **request);
111111

112-
int ompi_osc_rdma_rget (void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt,
112+
int ompi_osc_rdma_rget (void *origin_addr, int origin_count, ompi_datatype_t *origin_dt,
113113
int target, OPAL_PTRDIFF_TYPE target_disp, int target_count,
114-
struct ompi_datatype_t *target_dt, struct ompi_win_t *win,
115-
struct ompi_request_t **request);
114+
ompi_datatype_t *target_dt, ompi_win_t *win,
115+
ompi_request_t **request);
116116

117117
/**
118118
* @brief read data from a remote memory region (blocking)

0 commit comments

Comments
 (0)