Skip to content

Commit 91f90b2

Browse files
committed
Merge pull request open-mpi#545 from ggouaillardet/topic/v2.x/mpi_osc_prototypes_fixes
Topic/v2.x/mpi osc prototypes fixes
2 parents 9e38cfd + 07dbcc7 commit 91f90b2

25 files changed

+170
-134
lines changed

ompi/include/mpi.h.in

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* reserved.
1818
* Copyright (c) 2011-2013 INRIA. All rights reserved.
1919
* Copyright (c) 2015 University of Houston. All rights reserved.
20+
* Copyright (c) 2015 Research Organization for Information Science
21+
* and Technology (RIST). All rights reserved.
2022
* $COPYRIGHT$
2123
*
2224
* Additional copyrights may follow
@@ -1328,7 +1330,7 @@ OMPI_DECLSPEC int MPI_Comm_spawn_multiple(int count, char *array_of_commands[],
13281330
OMPI_DECLSPEC int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm);
13291331
OMPI_DECLSPEC int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm);
13301332
OMPI_DECLSPEC int MPI_Comm_test_inter(MPI_Comm comm, int *flag);
1331-
OMPI_DECLSPEC int MPI_Compare_and_swap(void *origin_addr, void *compare_addr,
1333+
OMPI_DECLSPEC int MPI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
13321334
void *result_addr, MPI_Datatype datatype, int target_rank,
13331335
MPI_Aint target_disp, MPI_Win win);
13341336
OMPI_DECLSPEC int MPI_Dims_create(int nnodes, int ndims, int dims[]);
@@ -1346,7 +1348,7 @@ OMPI_DECLSPEC int MPI_Error_class(int errorcode, int *errorclass);
13461348
OMPI_DECLSPEC int MPI_Error_string(int errorcode, char *string, int *resultlen);
13471349
OMPI_DECLSPEC int MPI_Exscan(const void *sendbuf, void *recvbuf, int count,
13481350
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
1349-
OMPI_DECLSPEC int MPI_Fetch_and_op(void *origin_addr, void *result_addr, MPI_Datatype datatype,
1351+
OMPI_DECLSPEC int MPI_Fetch_and_op(const void *origin_addr, void *result_addr, MPI_Datatype datatype,
13501352
int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win);
13511353
OMPI_DECLSPEC int MPI_Iexscan(const void *sendbuf, void *recvbuf, int count,
13521354
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
@@ -1622,8 +1624,8 @@ OMPI_DECLSPEC int MPI_Put(const void *origin_addr, int origin_count, MPI_Dataty
16221624
int target_rank, MPI_Aint target_disp, int target_count,
16231625
MPI_Datatype target_datatype, MPI_Win win);
16241626
OMPI_DECLSPEC int MPI_Query_thread(int *provided);
1625-
OMPI_DECLSPEC int MPI_Raccumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
1626-
int target_rank, MPI_Aint target_disp, int target_count,
1627+
OMPI_DECLSPEC int MPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
1628+
int target_rank, MPI_Aint target_disp, int target_count,
16271629
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request);
16281630
OMPI_DECLSPEC int MPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
16291631
int tag, MPI_Comm comm, MPI_Request *request);
@@ -1846,7 +1848,7 @@ OMPI_DECLSPEC int MPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_at
18461848
MPI_Win_delete_attr_function *win_delete_attr_fn,
18471849
int *win_keyval, void *extra_state);
18481850
OMPI_DECLSPEC int MPI_Win_delete_attr(MPI_Win win, int win_keyval);
1849-
OMPI_DECLSPEC int MPI_Win_detach(MPI_Win win, void *base);
1851+
OMPI_DECLSPEC int MPI_Win_detach(MPI_Win win, const void *base);
18501852
OMPI_DECLSPEC MPI_Win MPI_Win_f2c(MPI_Fint win);
18511853
OMPI_DECLSPEC int MPI_Win_fence(int assert, MPI_Win win);
18521854
OMPI_DECLSPEC int MPI_Win_flush(int rank, MPI_Win win);
@@ -2028,7 +2030,7 @@ OMPI_DECLSPEC int PMPI_Comm_spawn_multiple(int count, char *array_of_commands[]
20282030
OMPI_DECLSPEC int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm);
20292031
OMPI_DECLSPEC int PMPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm);
20302032
OMPI_DECLSPEC int PMPI_Comm_test_inter(MPI_Comm comm, int *flag);
2031-
OMPI_DECLSPEC int PMPI_Compare_and_swap(void *origin_addr, void *compare_addr,
2033+
OMPI_DECLSPEC int PMPI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
20322034
void *result_addr, MPI_Datatype datatype, int target_rank,
20332035
MPI_Aint target_disp, MPI_Win win);
20342036
OMPI_DECLSPEC int PMPI_Dims_create(int nnodes, int ndims, int dims[]);
@@ -2046,7 +2048,7 @@ OMPI_DECLSPEC int PMPI_Error_class(int errorcode, int *errorclass);
20462048
OMPI_DECLSPEC int PMPI_Error_string(int errorcode, char *string, int *resultlen);
20472049
OMPI_DECLSPEC int PMPI_Exscan(const void *sendbuf, void *recvbuf, int count,
20482050
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
2049-
OMPI_DECLSPEC int PMPI_Fetch_and_op(void *origin_addr, void *result_addr, MPI_Datatype datatype,
2051+
OMPI_DECLSPEC int PMPI_Fetch_and_op(const void *origin_addr, void *result_addr, MPI_Datatype datatype,
20502052
int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win);
20512053
OMPI_DECLSPEC int PMPI_Iexscan(const void *sendbuf, void *recvbuf, int count,
20522054
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
@@ -2324,8 +2326,8 @@ OMPI_DECLSPEC int PMPI_Put(const void *origin_addr, int origin_count, MPI_Datat
23242326
int target_rank, MPI_Aint target_disp, int target_count,
23252327
MPI_Datatype target_datatype, MPI_Win win);
23262328
OMPI_DECLSPEC int PMPI_Query_thread(int *provided);
2327-
OMPI_DECLSPEC int PMPI_Raccumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
2328-
int target_rank, MPI_Aint target_disp, int target_count,
2329+
OMPI_DECLSPEC int PMPI_Raccumulate(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
2330+
int target_rank, MPI_Aint target_disp, int target_count,
23292331
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request *request);
23302332
OMPI_DECLSPEC int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int source,
23312333
int tag, MPI_Comm comm, MPI_Request *request);
@@ -2548,7 +2550,7 @@ OMPI_DECLSPEC int PMPI_Win_create_keyval(MPI_Win_copy_attr_function *win_copy_a
25482550
MPI_Win_delete_attr_function *win_delete_attr_fn,
25492551
int *win_keyval, void *extra_state);
25502552
OMPI_DECLSPEC int PMPI_Win_delete_attr(MPI_Win win, int win_keyval);
2551-
OMPI_DECLSPEC int PMPI_Win_detach(MPI_Win win, void *base);
2553+
OMPI_DECLSPEC int PMPI_Win_detach(MPI_Win win, const void *base);
25522554
OMPI_DECLSPEC MPI_Win PMPI_Win_f2c(MPI_Fint win);
25532555
OMPI_DECLSPEC int PMPI_Win_fence(int assert, MPI_Win win);
25542556
OMPI_DECLSPEC int PMPI_Win_flush(int rank, MPI_Win win);

ompi/mca/osc/base/osc_base_obj_convert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int ompi_osc_base_process_op (void *outbuf, void *inbuf, size_t inbuflen,
134134
return OMPI_SUCCESS;
135135
}
136136

137-
int ompi_osc_base_sndrcv_op (void *origin, int32_t origin_count,
137+
int ompi_osc_base_sndrcv_op (const void *origin, int32_t origin_count,
138138
struct ompi_datatype_t *origin_dt,
139139
void *target, int32_t target_count,
140140
struct ompi_datatype_t *target_dt,
@@ -152,7 +152,7 @@ int ompi_osc_base_sndrcv_op (void *origin, int32_t origin_count,
152152
bool done;
153153

154154
if (ompi_datatype_is_predefined(origin_dt) && origin_dt == target_dt) {
155-
ompi_op_reduce(op, origin, target, origin_count, origin_dt);
155+
ompi_op_reduce(op, (void *)origin, target, origin_count, origin_dt);
156156

157157
return OMPI_SUCCESS;
158158
}

ompi/mca/osc/base/osc_base_obj_convert.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* University of Stuttgart. All rights reserved.
88
* Copyright (c) 2004-2005 The Regents of the University of California.
99
* All rights reserved.
10+
* Copyright (c) 2015 Research Organization for Information Science
11+
* and Technology (RIST). All rights reserved.
1012
* $COPYRIGHT$
1113
*
1214
* Additional copyrights may follow
@@ -117,7 +119,7 @@ OMPI_DECLSPEC int ompi_osc_base_process_op(void *outbuf,
117119
int count,
118120
ompi_op_t *op);
119121

120-
OMPI_DECLSPEC int ompi_osc_base_sndrcv_op(void *origin,
122+
OMPI_DECLSPEC int ompi_osc_base_sndrcv_op(const void *origin,
121123
int32_t origin_count,
122124
struct ompi_datatype_t *origin_dt,
123125
void *target,

ompi/mca/osc/osc.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
1212
* reserved.
1313
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
14+
* Copyright (c) 2015 Research Organization for Information Science
15+
* and Technology (RIST). All rights reserved.
1416
* $COPYRIGHT$
1517
*
1618
* Additional copyrights may follow
@@ -181,7 +183,7 @@ typedef int (*ompi_osc_base_module_win_shared_query_fn_t)(struct ompi_win_t *win
181183
size_t *size, int *disp_unit, void *baseptr);
182184

183185
typedef int (*ompi_osc_base_module_win_attach_fn_t)(struct ompi_win_t *win, void *base, size_t size);
184-
typedef int (*ompi_osc_base_module_win_detach_fn_t)(struct ompi_win_t *win, void *base);
186+
typedef int (*ompi_osc_base_module_win_detach_fn_t)(struct ompi_win_t *win, const void *base);
185187

186188
/**
187189
* Free resources associated with win
@@ -201,7 +203,7 @@ typedef int (*ompi_osc_base_module_win_detach_fn_t)(struct ompi_win_t *win, void
201203
typedef int (*ompi_osc_base_module_free_fn_t)(struct ompi_win_t *win);
202204

203205

204-
typedef int (*ompi_osc_base_module_put_fn_t)(void *origin_addr,
206+
typedef int (*ompi_osc_base_module_put_fn_t)(const void *origin_addr,
205207
int origin_count,
206208
struct ompi_datatype_t *origin_dt,
207209
int target,
@@ -221,7 +223,7 @@ typedef int (*ompi_osc_base_module_get_fn_t)(void *origin_addr,
221223
struct ompi_win_t *win);
222224

223225

224-
typedef int (*ompi_osc_base_module_accumulate_fn_t)(void *origin_addr,
226+
typedef int (*ompi_osc_base_module_accumulate_fn_t)(const void *origin_addr,
225227
int origin_count,
226228
struct ompi_datatype_t *origin_dt,
227229
int target,
@@ -231,24 +233,24 @@ typedef int (*ompi_osc_base_module_accumulate_fn_t)(void *origin_addr,
231233
struct ompi_op_t *op,
232234
struct ompi_win_t *win);
233235

234-
typedef int (*ompi_osc_base_module_compare_and_swap_fn_t)(void *origin_addr,
235-
void *compare_addr,
236+
typedef int (*ompi_osc_base_module_compare_and_swap_fn_t)(const void *origin_addr,
237+
const void *compare_addr,
236238
void *result_addr,
237239
struct ompi_datatype_t *dt,
238240
int target,
239241
OPAL_PTRDIFF_TYPE target_disp,
240242
struct ompi_win_t *win);
241243

242-
typedef int (*ompi_osc_base_module_fetch_and_op_fn_t)(void *origin_addr,
244+
typedef int (*ompi_osc_base_module_fetch_and_op_fn_t)(const void *origin_addr,
243245
void *result_addr,
244246
struct ompi_datatype_t *dt,
245247
int target,
246248
OPAL_PTRDIFF_TYPE target_disp,
247249
struct ompi_op_t *op,
248250
struct ompi_win_t *win);
249251

250-
typedef int (*ompi_osc_base_module_get_accumulate_fn_t)(void *origin_addr,
251-
int origin_count,
252+
typedef int (*ompi_osc_base_module_get_accumulate_fn_t)(const void *origin_addr,
253+
int origin_count,
252254
struct ompi_datatype_t *origin_datatype,
253255
void *result_addr,
254256
int result_count,
@@ -260,7 +262,7 @@ typedef int (*ompi_osc_base_module_get_accumulate_fn_t)(void *origin_addr,
260262
struct ompi_op_t *op,
261263
struct ompi_win_t *win);
262264

263-
typedef int (*ompi_osc_base_module_rput_fn_t)(void *origin_addr,
265+
typedef int (*ompi_osc_base_module_rput_fn_t)(const void *origin_addr,
264266
int origin_count,
265267
struct ompi_datatype_t *origin_dt,
266268
int target,
@@ -281,7 +283,7 @@ typedef int (*ompi_osc_base_module_rget_fn_t)(void *origin_addr,
281283
struct ompi_request_t **request);
282284

283285

284-
typedef int (*ompi_osc_base_module_raccumulate_fn_t)(void *origin_addr,
286+
typedef int (*ompi_osc_base_module_raccumulate_fn_t)(const void *origin_addr,
285287
int origin_count,
286288
struct ompi_datatype_t *origin_dt,
287289
int target,
@@ -292,8 +294,8 @@ typedef int (*ompi_osc_base_module_raccumulate_fn_t)(void *origin_addr,
292294
struct ompi_win_t *win,
293295
struct ompi_request_t **request);
294296

295-
typedef int (*ompi_osc_base_module_rget_accumulate_fn_t)(void *origin_addr,
296-
int origin_count,
297+
typedef int (*ompi_osc_base_module_rget_accumulate_fn_t)(const void *origin_addr,
298+
int origin_count,
297299
struct ompi_datatype_t *origin_datatype,
298300
void *result_addr,
299301
int result_count,

ompi/mca/osc/portals4/osc_portals4.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright (c) 2011-2013 Sandia National Laboratories. All rights reserved.
44
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
55
* reserved.
6+
* Copyright (c) 2015 Research Organization for Information Science
7+
* and Technology (RIST). All rights reserved.
68
* $COPYRIGHT$
79
*
810
* Additional copyrights may follow
@@ -116,11 +118,11 @@ get_displacement(ompi_osc_portals4_module_t *module,
116118

117119

118120
int ompi_osc_portals4_attach(struct ompi_win_t *win, void *base, size_t len);
119-
int ompi_osc_portals4_detach(struct ompi_win_t *win, void *base);
121+
int ompi_osc_portals4_detach(struct ompi_win_t *win, const void *base);
120122

121123
int ompi_osc_portals4_free(struct ompi_win_t *win);
122124

123-
int ompi_osc_portals4_put(void *origin_addr,
125+
int ompi_osc_portals4_put(const void *origin_addr,
124126
int origin_count,
125127
struct ompi_datatype_t *origin_dt,
126128
int target,
@@ -138,7 +140,7 @@ int ompi_osc_portals4_get(void *origin_addr,
138140
struct ompi_datatype_t *target_dt,
139141
struct ompi_win_t *win);
140142

141-
int ompi_osc_portals4_accumulate(void *origin_addr,
143+
int ompi_osc_portals4_accumulate(const void *origin_addr,
142144
int origin_count,
143145
struct ompi_datatype_t *origin_dt,
144146
int target,
@@ -148,24 +150,24 @@ int ompi_osc_portals4_accumulate(void *origin_addr,
148150
struct ompi_op_t *op,
149151
struct ompi_win_t *win);
150152

151-
int ompi_osc_portals4_compare_and_swap(void *origin_addr,
152-
void *compare_addr,
153+
int ompi_osc_portals4_compare_and_swap(const void *origin_addr,
154+
const void *compare_addr,
153155
void *result_addr,
154156
struct ompi_datatype_t *dt,
155157
int target,
156158
OPAL_PTRDIFF_TYPE target_disp,
157159
struct ompi_win_t *win);
158160

159-
int ompi_osc_portals4_fetch_and_op(void *origin_addr,
161+
int ompi_osc_portals4_fetch_and_op(const void *origin_addr,
160162
void *result_addr,
161163
struct ompi_datatype_t *dt,
162164
int target,
163165
OPAL_PTRDIFF_TYPE target_disp,
164166
struct ompi_op_t *op,
165167
struct ompi_win_t *win);
166168

167-
int ompi_osc_portals4_get_accumulate(void *origin_addr,
168-
int origin_count,
169+
int ompi_osc_portals4_get_accumulate(const void *origin_addr,
170+
int origin_count,
169171
struct ompi_datatype_t *origin_datatype,
170172
void *result_addr,
171173
int result_count,
@@ -177,7 +179,7 @@ int ompi_osc_portals4_get_accumulate(void *origin_addr,
177179
struct ompi_op_t *op,
178180
struct ompi_win_t *win);
179181

180-
int ompi_osc_portals4_rput(void *origin_addr,
182+
int ompi_osc_portals4_rput(const void *origin_addr,
181183
int origin_count,
182184
struct ompi_datatype_t *origin_dt,
183185
int target,
@@ -197,7 +199,7 @@ int ompi_osc_portals4_rget(void *origin_addr,
197199
struct ompi_win_t *win,
198200
struct ompi_request_t **request);
199201

200-
int ompi_osc_portals4_raccumulate(void *origin_addr,
202+
int ompi_osc_portals4_raccumulate(const void *origin_addr,
201203
int origin_count,
202204
struct ompi_datatype_t *origin_dt,
203205
int target,
@@ -208,8 +210,8 @@ int ompi_osc_portals4_raccumulate(void *origin_addr,
208210
struct ompi_win_t *win,
209211
struct ompi_request_t **request);
210212

211-
int ompi_osc_portals4_rget_accumulate(void *origin_addr,
212-
int origin_count,
213+
int ompi_osc_portals4_rget_accumulate(const void *origin_addr,
214+
int origin_count,
213215
struct ompi_datatype_t *origin_datatype,
214216
void *result_addr,
215217
int result_count,

0 commit comments

Comments
 (0)