Skip to content

Commit 57f2404

Browse files
authored
Merge pull request #12714 from tkordenbrock/topic/main/portals4-update-to-coll-base-3-0-0
portals4: update the coll-portals4 component to be Big Count compliant
2 parents c3bebd8 + 24630e6 commit 57f2404

11 files changed

+59
-38
lines changed

ompi/mca/coll/portals4/coll_portals4.h

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,31 @@ struct mca_coll_portals4_module_t {
9595
opal_atomic_size_t coll_count;
9696

9797
/* record handlers dedicated to fallback if offloaded operations are not supported */
98+
mca_coll_base_module_barrier_fn_t previous_barrier;
99+
mca_coll_base_module_t *previous_barrier_module;
100+
mca_coll_base_module_ibarrier_fn_t previous_ibarrier;
101+
mca_coll_base_module_t *previous_ibarrier_module;
102+
103+
mca_coll_base_module_bcast_fn_t previous_bcast;
104+
mca_coll_base_module_t *previous_bcast_module;
105+
mca_coll_base_module_ibcast_fn_t previous_ibcast;
106+
mca_coll_base_module_t *previous_ibcast_module;
107+
108+
mca_coll_base_module_gather_fn_t previous_gather;
109+
mca_coll_base_module_t *previous_gather_module;
110+
mca_coll_base_module_igather_fn_t previous_igather;
111+
mca_coll_base_module_t *previous_igather_module;
112+
98113
mca_coll_base_module_reduce_fn_t previous_reduce;
99114
mca_coll_base_module_t *previous_reduce_module;
100115
mca_coll_base_module_ireduce_fn_t previous_ireduce;
101116
mca_coll_base_module_t *previous_ireduce_module;
102117

118+
mca_coll_base_module_scatter_fn_t previous_scatter;
119+
mca_coll_base_module_t *previous_scatter_module;
120+
mca_coll_base_module_iscatter_fn_t previous_iscatter;
121+
mca_coll_base_module_t *previous_iscatter_module;
122+
103123
mca_coll_base_module_allreduce_fn_t previous_allreduce;
104124
mca_coll_base_module_t *previous_allreduce_module;
105125
mca_coll_base_module_iallreduce_fn_t previous_iallreduce;
@@ -187,34 +207,34 @@ int ompi_coll_portals4_ibarrier_intra(struct ompi_communicator_t *comm,
187207
mca_coll_base_module_t *module);
188208
int ompi_coll_portals4_ibarrier_intra_fini(struct ompi_coll_portals4_request_t *request);
189209

190-
int ompi_coll_portals4_bcast_intra(void *buff, int count,
210+
int ompi_coll_portals4_bcast_intra(void *buff, size_t count,
191211
struct ompi_datatype_t *datatype, int root,
192212
struct ompi_communicator_t *comm,mca_coll_base_module_t *module);
193-
int ompi_coll_portals4_ibcast_intra(void *buff, int count,
213+
int ompi_coll_portals4_ibcast_intra(void *buff, size_t count,
194214
struct ompi_datatype_t *datatype, int root,
195215
struct ompi_communicator_t *comm,
196216
ompi_request_t **request,
197217
mca_coll_base_module_t *module);
198218
int ompi_coll_portals4_ibcast_intra_fini(struct ompi_coll_portals4_request_t *request);
199219

200-
int ompi_coll_portals4_reduce_intra(const void *sbuf, void *rbuf, int count,
220+
int ompi_coll_portals4_reduce_intra(const void *sbuf, void *rbuf, size_t count,
201221
MPI_Datatype dtype, MPI_Op op,
202222
int root,
203223
struct ompi_communicator_t *comm,
204224
mca_coll_base_module_t *module);
205-
int ompi_coll_portals4_ireduce_intra(const void* sendbuf, void* recvbuf, int count,
225+
int ompi_coll_portals4_ireduce_intra(const void* sendbuf, void* recvbuf, size_t count,
206226
MPI_Datatype dype, MPI_Op op,
207227
int root,
208228
struct ompi_communicator_t *comm,
209229
ompi_request_t ** ompi_request,
210230
mca_coll_base_module_t *module);
211231
int ompi_coll_portals4_ireduce_intra_fini(struct ompi_coll_portals4_request_t *request);
212232

213-
int ompi_coll_portals4_allreduce_intra(const void* sendbuf, void* recvbuf, int count,
233+
int ompi_coll_portals4_allreduce_intra(const void* sendbuf, void* recvbuf, size_t count,
214234
MPI_Datatype dtype, MPI_Op op,
215235
struct ompi_communicator_t *comm,
216236
mca_coll_base_module_t *module);
217-
int ompi_coll_portals4_iallreduce_intra(const void* sendbuf, void* recvbuf, int count,
237+
int ompi_coll_portals4_iallreduce_intra(const void* sendbuf, void* recvbuf, size_t count,
218238
MPI_Datatype dtype, MPI_Op op,
219239
struct ompi_communicator_t *comm,
220240
ompi_request_t ** ompi_request,

ompi/mca/coll/portals4/coll_portals4_allreduce.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define COLL_PORTALS4_ALLREDUCE_MAX_CHILDREN 2
3333

3434
static int
35-
allreduce_kary_tree_top(const void *sendbuf, void *recvbuf, int count,
35+
allreduce_kary_tree_top(const void *sendbuf, void *recvbuf, size_t count,
3636
MPI_Datatype dtype, MPI_Op op,
3737
struct ompi_communicator_t *comm,
3838
ompi_coll_portals4_request_t *request,
@@ -380,7 +380,7 @@ allreduce_kary_tree_bottom(ompi_coll_portals4_request_t *request)
380380
return (OMPI_SUCCESS);
381381
}
382382

383-
int ompi_coll_portals4_allreduce_intra(const void* sendbuf, void* recvbuf, int count,
383+
int ompi_coll_portals4_allreduce_intra(const void* sendbuf, void* recvbuf, size_t count,
384384
MPI_Datatype dtype, MPI_Op op,
385385
struct ompi_communicator_t *comm,
386386
mca_coll_base_module_t *module)
@@ -409,7 +409,7 @@ int ompi_coll_portals4_allreduce_intra(const void* sendbuf, void* recvbuf, int c
409409
}
410410

411411

412-
int ompi_coll_portals4_iallreduce_intra(const void* sendbuf, void* recvbuf, int count,
412+
int ompi_coll_portals4_iallreduce_intra(const void* sendbuf, void* recvbuf, size_t count,
413413
MPI_Datatype dtype, MPI_Op op,
414414
struct ompi_communicator_t *comm,
415415
ompi_request_t ** ompi_request,

ompi/mca/coll/portals4/coll_portals4_bcast.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ bcast_pipeline_bottom(ompi_coll_portals4_request_t *request)
834834

835835

836836
int
837-
ompi_coll_portals4_bcast_intra(void *buff, int count,
837+
ompi_coll_portals4_bcast_intra(void *buff, size_t count,
838838
struct ompi_datatype_t *datatype, int root,
839839
struct ompi_communicator_t *comm,
840840
mca_coll_base_module_t *module)
@@ -878,7 +878,7 @@ ompi_coll_portals4_bcast_intra(void *buff, int count,
878878

879879

880880
int
881-
ompi_coll_portals4_ibcast_intra(void *buff, int count,
881+
ompi_coll_portals4_ibcast_intra(void *buff, size_t count,
882882
struct ompi_datatype_t *datatype, int root,
883883
struct ompi_communicator_t *comm,
884884
ompi_request_t **ompi_request,

ompi/mca/coll/portals4/coll_portals4_component.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ ptl_datatype_t ompi_coll_portals4_atomic_datatype [OMPI_DATATYPE_MPI_MAX_PREDEFI
135135
{ \
136136
opal_output_verbose(1, ompi_coll_base_framework.framework_output, \
137137
"(%d/%s): no underlying " #__api "; disqualifying myself", \
138-
__comm->c_contextid, __comm->c_name); \
138+
ompi_comm_get_local_cid(__comm), __comm->c_name); \
139139
__module->previous_##__api = NULL; \
140140
__module->previous_##__api##_module = NULL; \
141141
} \
@@ -144,7 +144,7 @@ ptl_datatype_t ompi_coll_portals4_atomic_datatype [OMPI_DATATYPE_MPI_MAX_PREDEFI
144144
/* save the current selected collective */ \
145145
MCA_COLL_SAVE_API(__comm, __api, __module->previous_##__api, __module->previous_##__api##_module, "portals"); \
146146
/* install our own */ \
147-
MCA_COLL_INSTALL_API(__comm, __api, __module->super.coll##__api, &__module->super, "portals"); \
147+
MCA_COLL_INSTALL_API(__comm, __api, __module->super.coll_##__api, &__module->super, "portals"); \
148148
} \
149149
} while (0)
150150

@@ -187,7 +187,7 @@ mca_coll_portals4_component_t mca_coll_portals4_component = {
187187
* about the component itself */
188188

189189
.collm_version = {
190-
MCA_COLL_BASE_VERSION_2_4_0,
190+
MCA_COLL_BASE_VERSION_3_0_0,
191191

192192
/* Component name and version */
193193
.mca_component_name = "portals4",

ompi/mca/coll/portals4/coll_portals4_gather.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ setup_gather_buffers_binomial(struct ompi_communicator_t *comm,
215215
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
216216
"%s:%d:vrank(%d): root - gather_buf(%p) - gather_bytes(%lu)=packed_size(%ld) * size(%d)",
217217
__FILE__, __LINE__, vrank,
218-
request->u.gather.gather_buf, request->u.gather.gather_bytes,
218+
(void*)request->u.gather.gather_buf, request->u.gather.gather_bytes,
219219
request->u.gather.packed_size, request->u.gather.size);
220220
} else if (bmtree->tree_nextsize) {
221221
/*
@@ -238,7 +238,7 @@ setup_gather_buffers_binomial(struct ompi_communicator_t *comm,
238238
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
239239
"%s:%d:vrank(%d): nonleaf - gather_buf(%p) - gather_bytes(%lu)=packed_size(%ld) * (bmtree->tree_numdescendants(%d) + 1)",
240240
__FILE__, __LINE__, vrank,
241-
request->u.gather.gather_buf, request->u.gather.gather_bytes,
241+
(void*)request->u.gather.gather_buf, request->u.gather.gather_bytes,
242242
request->u.gather.packed_size, bmtree->tree_numdescendants);
243243
} else {
244244
/* leaf nodes, allocate space to pack into and put from */
@@ -257,7 +257,7 @@ setup_gather_buffers_binomial(struct ompi_communicator_t *comm,
257257
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
258258
"%s:%d:vrank(%d): leaf - gather_buf(%p) - gather_bytes(%lu)=packed_size(%ld)",
259259
__FILE__, __LINE__, vrank,
260-
request->u.gather.gather_buf, request->u.gather.gather_bytes,
260+
(void*)request->u.gather.gather_buf, request->u.gather.gather_bytes,
261261
request->u.gather.packed_size);
262262
}
263263

@@ -316,7 +316,7 @@ setup_gather_buffers_linear(struct ompi_communicator_t *comm,
316316
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
317317
"%s:%d:rank(%d): root - gather_buf(%p) - gather_bytes(%lu)=packed_size(%ld) * size(%d)",
318318
__FILE__, __LINE__, request->u.gather.my_rank,
319-
request->u.gather.gather_buf, request->u.gather.gather_bytes,
319+
(void*)request->u.gather.gather_buf, request->u.gather.gather_bytes,
320320
request->u.gather.packed_size, request->u.gather.size);
321321
} else {
322322
/* non-root nodes, allocate space to pack into and put from */
@@ -334,7 +334,7 @@ setup_gather_buffers_linear(struct ompi_communicator_t *comm,
334334
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
335335
"%s:%d:rank(%d): leaf - gather_buf(%p) - gather_bytes(%lu)=packed_size(%ld)",
336336
__FILE__, __LINE__, request->u.gather.my_rank,
337-
request->u.gather.gather_buf, request->u.gather.gather_bytes,
337+
(void*)request->u.gather.gather_buf, request->u.gather.gather_bytes,
338338
request->u.gather.packed_size);
339339
}
340340

ompi/mca/coll/portals4/coll_portals4_reduce.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333

3434
static int
35-
reduce_kary_tree_top(const void *sendbuf, void *recvbuf, int count,
35+
reduce_kary_tree_top(const void *sendbuf, void *recvbuf, size_t count,
3636
MPI_Datatype dtype, MPI_Op op,
3737
int root,
3838
struct ompi_communicator_t *comm,
@@ -377,7 +377,7 @@ reduce_kary_tree_bottom(ompi_coll_portals4_request_t *request)
377377

378378

379379
int
380-
ompi_coll_portals4_reduce_intra(const void *sendbuf, void *recvbuf, int count,
380+
ompi_coll_portals4_reduce_intra(const void *sendbuf, void *recvbuf, size_t count,
381381
MPI_Datatype dtype, MPI_Op op,
382382
int root,
383383
struct ompi_communicator_t *comm,
@@ -412,7 +412,7 @@ ompi_coll_portals4_reduce_intra(const void *sendbuf, void *recvbuf, int count,
412412

413413

414414
int
415-
ompi_coll_portals4_ireduce_intra(const void* sendbuf, void* recvbuf, int count,
415+
ompi_coll_portals4_ireduce_intra(const void* sendbuf, void* recvbuf, size_t count,
416416
MPI_Datatype dtype, MPI_Op op,
417417
int root,
418418
struct ompi_communicator_t *comm,

ompi/mca/coll/portals4/coll_portals4_scatter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ setup_scatter_buffers_linear(struct ompi_communicator_t *comm,
9191
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
9292
"%s:%d:rank(%d): root - scatter_buf(%p) - scatter_bytes(%lu)=packed_size(%ld) * size(%d)",
9393
__FILE__, __LINE__, request->u.scatter.my_rank,
94-
request->u.scatter.scatter_buf, request->u.scatter.scatter_bytes,
94+
(void*)request->u.scatter.scatter_buf, request->u.scatter.scatter_bytes,
9595
request->u.scatter.packed_size, request->u.scatter.size);
9696
} else {
9797
request->u.scatter.scatter_bytes=request->u.scatter.packed_size;
@@ -104,7 +104,7 @@ setup_scatter_buffers_linear(struct ompi_communicator_t *comm,
104104
opal_output_verbose(30, ompi_coll_base_framework.framework_output,
105105
"%s:%d:rank(%d): leaf - scatter_buf(%p) - scatter_bytes(%lu)=packed_size(%ld)",
106106
__FILE__, __LINE__, request->u.scatter.my_rank,
107-
request->u.scatter.scatter_buf, request->u.scatter.scatter_bytes,
107+
(void*)request->u.scatter.scatter_buf, request->u.scatter.scatter_bytes,
108108
request->u.scatter.packed_size);
109109
}
110110

ompi/mca/mtl/portals4/mtl_portals4_recv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ read_msg(void *start, ptl_size_t length, ptl_process_t target,
4949
ompi_mtl_portals4_recv_request_t *request)
5050
{
5151
int ret, i;
52-
ptl_size_t rest = length, asked = 0;
52+
ptl_size_t rest = length;
5353
int32_t frag_count;
5454

5555
#if OMPI_MTL_PORTALS4_FLOW_CONTROL
@@ -102,7 +102,6 @@ read_msg(void *start, ptl_size_t length, ptl_process_t target,
102102
return OMPI_ERR_OUT_OF_RESOURCE;
103103
}
104104
rest -= frag->frag_length;
105-
asked += frag->frag_length;
106105
}
107106

108107
return OMPI_SUCCESS;

ompi/mca/mtl/portals4/mtl_portals4_send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ ompi_mtl_portals4_long_isend(void *start, size_t length, uint32_t contextid, int
418418

419419
#if OMPI_MTL_PORTALS4_FLOW_CONTROL
420420
void
421-
ompi_mtl_portals4_pending_list_progress()
421+
ompi_mtl_portals4_pending_list_progress(void)
422422
{
423423
int ret, val;
424424
opal_list_item_t *item;

ompi/mca/osc/portals4/osc_portals4_comm.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,8 @@ ompi_osc_portals4_raccumulate(const void *origin_addr,
22452245
size_t offset, size;
22462246
ptl_op_t ptl_op;
22472247
ptl_datatype_t ptl_dt;
2248-
ptrdiff_t sent, length, origin_lb, target_lb, extent;
2248+
ptl_size_t sent, length;
2249+
ptrdiff_t origin_lb, target_lb, extent;
22492250

22502251
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
22512252
"raccumulate: 0x%lx, %zu, %s, %d, %lu, %zu, %s, %s 0x%lx",
@@ -2998,7 +2999,8 @@ ompi_osc_portals4_accumulate(const void *origin_addr,
29982999
size_t offset, size;
29993000
ptl_op_t ptl_op;
30003001
ptl_datatype_t ptl_dt;
3001-
ptrdiff_t sent, length, origin_lb, target_lb, extent;
3002+
ptl_size_t sent, length;
3003+
ptrdiff_t origin_lb, target_lb, extent;
30023004

30033005
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
30043006
"accumulate: 0x%lx, %zu, %s, %d, %lu, %zu, %s, %s, 0x%lx",

ompi/mca/osc/portals4/osc_portals4_component.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,18 @@ static bool
115115
check_config_value_bool(char *key, opal_info_t *info)
116116
{
117117
int ret, flag, param;
118-
const bool *flag_value;
119-
bool result;
118+
bool result = false;
119+
const bool *flag_value = &result;
120+
120121
ret = opal_info_get_bool(info, key, &result, &flag);
121-
if (OMPI_SUCCESS != ret || !flag) goto info_not_found;
122-
return result;
122+
if (OMPI_SUCCESS == ret && flag) {
123+
return result;
124+
}
123125

124-
info_not_found:
125126
param = mca_base_var_find("ompi", "osc", "portals4", key);
126-
if (0 > param) return false;
127-
128-
ret = mca_base_var_get_value(param, &flag_value, NULL, NULL);
129-
if (OMPI_SUCCESS != ret) return false;
127+
if (0 <= param) {
128+
(void) mca_base_var_get_value(param, &flag_value, NULL, NULL);
129+
}
130130

131131
return flag_value[0];
132132
}

0 commit comments

Comments
 (0)