Skip to content

Commit 5eec621

Browse files
committed
pml: fix commit open-mpi/ompi@6e6a3e9
do not use the const modifier for allocator nor recv buffers (cherry picked from commit open-mpi/ompi@a611274)
1 parent 8555bc9 commit 5eec621

File tree

18 files changed

+34
-50
lines changed

18 files changed

+34
-50
lines changed

ompi/mca/coll/base/coll_base_gather.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ ompi_coll_base_gather_intra_linear_sync(const void *sbuf, int scount,
237237
COLL_BASE_COMPUTED_SEGCOUNT( (size_t) first_segment_size, typelng,
238238
first_segment_count );
239239

240-
ret = MCA_PML_CALL(recv(sbuf, 0, MPI_BYTE, root,
240+
ret = MCA_PML_CALL(recv(rbuf, 0, MPI_BYTE, root,
241241
MCA_COLL_BASE_TAG_GATHER,
242242
comm, MPI_STATUS_IGNORE));
243243
if (ret != MPI_SUCCESS) { line = __LINE__; goto error_hndl; }

ompi/mca/pml/base/pml_base_bsend.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -373,7 +375,7 @@ int mca_pml_base_bsend_request_fini(ompi_request_t* request)
373375
OPAL_THREAD_LOCK(&mca_pml_bsend_mutex);
374376

375377
/* free buffer */
376-
mca_pml_bsend_allocator->alc_free(mca_pml_bsend_allocator, sendreq->req_addr);
378+
mca_pml_bsend_allocator->alc_free(mca_pml_bsend_allocator, (void *)sendreq->req_addr);
377379
sendreq->req_addr = sendreq->req_base.req_addr;
378380

379381
/* decrement count of buffered requests */

ompi/mca/pml/base/pml_base_request.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct mca_pml_base_request_t {
7070
opal_convertor_t req_convertor; /**< always need the convertor */
7171
/* END: These field have to match the definition of the mca_pml_cm_request_t */
7272

73-
const void *req_addr; /**< pointer to application buffer */
73+
void *req_addr; /**< pointer to application buffer */
7474
size_t req_count; /**< count of user datatype elements */
7575
int32_t req_peer; /**< peer process - rank w/in this communicator */
7676
int32_t req_tag; /**< user defined tag */

ompi/mca/pml/base/pml_base_sendreq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION( mca_pml_base_send_request_t );
8181
(request)->req_base.req_ompi.req_mpi_object.comm = comm; \
8282
(request)->req_addr = addr; \
8383
(request)->req_send_mode = mode; \
84-
(request)->req_base.req_addr = addr; \
84+
(request)->req_base.req_addr = (void *)addr; \
8585
(request)->req_base.req_count = count; \
8686
(request)->req_base.req_datatype = datatype; \
8787
(request)->req_base.req_peer = (int32_t)peer; \

ompi/mca/pml/cm/pml_cm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ OMPI_DECLSPEC extern int mca_pml_cm_del_comm(struct ompi_communicator_t* comm);
6767

6868

6969
__opal_attribute_always_inline__ static inline int
70-
mca_pml_cm_irecv_init(const void *addr,
70+
mca_pml_cm_irecv_init(void *addr,
7171
size_t count,
7272
ompi_datatype_t * datatype,
7373
int src,
@@ -92,7 +92,7 @@ mca_pml_cm_irecv_init(const void *addr,
9292
}
9393

9494
__opal_attribute_always_inline__ static inline int
95-
mca_pml_cm_irecv(const void *addr,
95+
mca_pml_cm_irecv(void *addr,
9696
size_t count,
9797
ompi_datatype_t * datatype,
9898
int src,
@@ -133,7 +133,7 @@ mca_pml_cm_recv_fast_completion(struct mca_mtl_request_t *mtl_request)
133133
}
134134

135135
__opal_attribute_always_inline__ static inline int
136-
mca_pml_cm_recv(const void *addr,
136+
mca_pml_cm_recv(void *addr,
137137
size_t count,
138138
ompi_datatype_t * datatype,
139139
int src,

ompi/mca/pml/cm/pml_cm_recvreq.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
1414
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1515
* reserved.
16-
* Copyright (c) 2015 Research Organization for Information Science
17-
* and Technology (RIST). All rights reserved.
1816
* $COPYRIGHT$
1917
*
2018
* Additional copyrights may follow
@@ -38,7 +36,7 @@ OBJ_CLASS_DECLARATION(mca_pml_cm_thin_recv_request_t);
3836

3937
struct mca_pml_cm_hvy_recv_request_t {
4038
mca_pml_cm_request_t req_base;
41-
const void *req_addr; /**< pointer to application buffer */
39+
void *req_addr; /**< pointer to application buffer */
4240
size_t req_count; /**< count of user datatype elements */
4341
int32_t req_peer; /**< peer process - rank w/in this communicator */
4442
int32_t req_tag; /**< user defined tag */

ompi/mca/pml/ob1/pml_ob1.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,23 +166,23 @@ extern int mca_pml_ob1_send( const void *buf,
166166
mca_pml_base_send_mode_t mode,
167167
struct ompi_communicator_t* comm );
168168

169-
extern int mca_pml_ob1_irecv_init( const void *buf,
169+
extern int mca_pml_ob1_irecv_init( void *buf,
170170
size_t count,
171171
ompi_datatype_t *datatype,
172172
int src,
173173
int tag,
174174
struct ompi_communicator_t* comm,
175175
struct ompi_request_t **request );
176176

177-
extern int mca_pml_ob1_irecv( const void *buf,
177+
extern int mca_pml_ob1_irecv( void *buf,
178178
size_t count,
179179
ompi_datatype_t *datatype,
180180
int src,
181181
int tag,
182182
struct ompi_communicator_t* comm,
183183
struct ompi_request_t **request );
184184

185-
extern int mca_pml_ob1_recv( const void *buf,
185+
extern int mca_pml_ob1_recv( void *buf,
186186
size_t count,
187187
ompi_datatype_t *datatype,
188188
int src,

ompi/mca/pml/ob1/pml_ob1_irecv.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved.
1616
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
1717
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
18-
* Copyright (c) 2015 Research Organization for Information Science
19-
* and Technology (RIST). All rights reserved.
2018
* $COPYRIGHT$
2119
*
2220
* Additional copyrights may follow
@@ -36,7 +34,7 @@
3634

3735
mca_pml_ob1_recv_request_t *mca_pml_ob1_recvreq = NULL;
3836

39-
int mca_pml_ob1_irecv_init(const void *addr,
37+
int mca_pml_ob1_irecv_init(void *addr,
4038
size_t count,
4139
ompi_datatype_t * datatype,
4240
int src,
@@ -61,7 +59,7 @@ int mca_pml_ob1_irecv_init(const void *addr,
6159
return OMPI_SUCCESS;
6260
}
6361

64-
int mca_pml_ob1_irecv(const void *addr,
62+
int mca_pml_ob1_irecv(void *addr,
6563
size_t count,
6664
ompi_datatype_t * datatype,
6765
int src,
@@ -88,7 +86,7 @@ int mca_pml_ob1_irecv(const void *addr,
8886
}
8987

9088

91-
int mca_pml_ob1_recv(const void *addr,
89+
int mca_pml_ob1_recv(void *addr,
9290
size_t count,
9391
ompi_datatype_t * datatype,
9492
int src,

ompi/mca/pml/pml.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ typedef int (*mca_pml_base_module_del_comm_fn_t)(struct ompi_communicator_t* com
208208
* @return OMPI_SUCCESS or failure status.
209209
*/
210210
typedef int (*mca_pml_base_module_irecv_init_fn_t)(
211-
const void *buf,
211+
void *buf,
212212
size_t count,
213213
struct ompi_datatype_t *datatype,
214214
int src,
@@ -230,7 +230,7 @@ typedef int (*mca_pml_base_module_irecv_init_fn_t)(
230230
* @return OMPI_SUCCESS or failure status.
231231
*/
232232
typedef int (*mca_pml_base_module_irecv_fn_t)(
233-
const void *buf,
233+
void *buf,
234234
size_t count,
235235
struct ompi_datatype_t *datatype,
236236
int src,
@@ -259,7 +259,7 @@ typedef int (*mca_pml_base_module_imrecv_fn_t)(
259259
* @return OMPI_SUCCESS or failure status.
260260
*/
261261
typedef int (*mca_pml_base_module_recv_fn_t)(
262-
const void *buf,
262+
void *buf,
263263
size_t count,
264264
struct ompi_datatype_t *datatype,
265265
int src,

ompi/mca/pml/yalla/pml_yalla.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ int mca_pml_yalla_del_comm(struct ompi_communicator_t* comm)
313313
return OMPI_SUCCESS;
314314
}
315315

316-
int mca_pml_yalla_irecv_init(const void *buf, size_t count, ompi_datatype_t *datatype,
316+
int mca_pml_yalla_irecv_init(void *buf, size_t count, ompi_datatype_t *datatype,
317317
int src, int tag, struct ompi_communicator_t* comm,
318318
struct ompi_request_t **request)
319319
{
@@ -329,7 +329,7 @@ int mca_pml_yalla_irecv_init(const void *buf, size_t count, ompi_datatype_t *dat
329329
return OMPI_SUCCESS;
330330
}
331331

332-
int mca_pml_yalla_irecv(const void *buf, size_t count, ompi_datatype_t *datatype,
332+
int mca_pml_yalla_irecv(void *buf, size_t count, ompi_datatype_t *datatype,
333333
int src, int tag, struct ompi_communicator_t* comm,
334334
struct ompi_request_t **request)
335335
{
@@ -353,7 +353,7 @@ int mca_pml_yalla_irecv(const void *buf, size_t count, ompi_datatype_t *datatype
353353
return OMPI_SUCCESS;
354354
}
355355

356-
int mca_pml_yalla_recv(const void *buf, size_t count, ompi_datatype_t *datatype, int src,
356+
int mca_pml_yalla_recv(void *buf, size_t count, ompi_datatype_t *datatype, int src,
357357
int tag, struct ompi_communicator_t* comm,
358358
ompi_status_public_t* status)
359359
{

0 commit comments

Comments
 (0)