Skip to content

Commit b047013

Browse files
committed
ops: embiggen the ops framework
to take a count argument of type size_t. related to #12226 related to #9194 Signed-off-by: Howard Pritchard <[email protected]>
1 parent 0bccfcd commit b047013

18 files changed

+244
-213
lines changed

ompi/mca/op/aarch64/op_aarch64.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* reserved.
55
* Copyright (c) 2019 Arm Ltd. All rights reserved.
66
* Copyright (c) 2024 NVIDIA Corporation. All rights reserved.
7+
* Copyright (c) 2025 Triad National Security, LLC. All rights
8+
* reserved.
79
*
810
* $COPYRIGHT$
911
*
@@ -31,7 +33,7 @@ BEGIN_C_DECLS
3133
*/
3234
typedef struct {
3335
/** The base op component struct */
34-
ompi_op_base_component_1_0_0_t super;
36+
ompi_op_base_component_2_0_0_t super;
3537

3638
/* What follows is aarch64-component-specific cached information. We
3739
tend to use this scheme (caching information on the aarch64

ompi/mca/op/aarch64/op_aarch64_component.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Copyright (c) 2024 NVIDIA Corporation. All rights reserved.
77
* Copyright (c) 2024 Research Organization for Information Science
88
* and Technology (RIST). All rights reserved.
9+
* Copyright (c) 2025 Triad National Security, LLC. All rights
10+
* reserved.
911
*
1012
* $COPYRIGHT$
1113
*
@@ -34,7 +36,7 @@ static int mca_op_aarch64_component_open(void);
3436
static int mca_op_aarch64_component_close(void);
3537
static int mca_op_aarch64_component_init_query(bool enable_progress_threads,
3638
bool enable_mpi_thread_multiple);
37-
static struct ompi_op_base_module_1_0_0_t *
39+
static struct ompi_op_base_module_2_0_0_t *
3840
mca_op_aarch64_component_op_query(struct ompi_op_t *op, int *priority);
3941
static int mca_op_aarch64_component_register(void);
4042

@@ -43,7 +45,7 @@ ompi_op_aarch64_component_t mca_op_aarch64_component = {
4345
information about the component itself */
4446
{
4547
.opc_version = {
46-
OMPI_OP_BASE_VERSION_1_0_0,
48+
OMPI_OP_BASE_VERSION_2_0_0,
4749

4850
.mca_component_name = "aarch64",
4951
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
@@ -164,7 +166,7 @@ ompi_op_aarch64_3buff_functions_sve[OMPI_OP_BASE_FORTRAN_OP_MAX][OMPI_OP_BASE_TY
164166
/*
165167
* Query whether this component can be used for a specific op
166168
*/
167-
static struct ompi_op_base_module_1_0_0_t *
169+
static struct ompi_op_base_module_2_0_0_t *
168170
mca_op_aarch64_component_op_query(struct ompi_op_t *op, int *priority)
169171
{
170172
/* Sanity check -- although the framework should never invoke the
@@ -242,5 +244,5 @@ static struct ompi_op_base_module_1_0_0_t *
242244
if (NULL != module) {
243245
*priority = 50;
244246
}
245-
return (ompi_op_base_module_1_0_0_t *) module;
247+
return (ompi_op_base_module_2_0_0_t *) module;
246248
}

ompi/mca/op/aarch64/op_aarch64_functions.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* Copyright (c) 2024 NVIDIA Corporation. All rights reserved.
77
* Copyright (c) 2024 Research Organization for Information Science
88
* and Technology (RIST). All rights reserved.
9+
* Copyright (c) 2025 Triad National Security, LLC. All rights
10+
* reserved.
911
*
1012
* $COPYRIGHT$
1113
*
@@ -114,11 +116,11 @@ _Generic((*(out)), \
114116
#if defined(GENERATE_NEON_CODE)
115117
#define OP_AARCH64_FUNC(name, type_name, type_size, type_cnt, type, op) \
116118
static void OP_CONCAT(ompi_op_aarch64_2buff_##name##_##type##type_size##_t, \
117-
APPEND)(const void *_in, void *_out, int *count, \
119+
APPEND)(const void *_in, void *_out, size_t *count, \
118120
struct ompi_datatype_t **dtype, \
119-
struct ompi_op_base_module_1_0_0_t *module) \
121+
struct ompi_op_base_module_2_0_0_t *module) \
120122
{ \
121-
int left_over = *count; \
123+
size_t left_over = *count; \
122124
type##type_size##_t *in = (type##type_size##_t *) _in, \
123125
*out = (type##type_size##_t *) _out; \
124126
OP_CONCAT(OMPI_OP_TYPE_PREPEND, type##type_size##x##type_cnt##_t) vsrc, vdst; \
@@ -138,12 +140,12 @@ _Generic((*(out)), \
138140
#elif defined(GENERATE_SVE_CODE)
139141
#define OP_AARCH64_FUNC(name, type_name, type_size, type_cnt, type, op) \
140142
static void OP_CONCAT(ompi_op_aarch64_2buff_##name##_##type##type_size##_t, APPEND) \
141-
(const void *_in, void *_out, int *count, \
143+
(const void *_in, void *_out, size_t *count, \
142144
struct ompi_datatype_t **dtype, \
143-
struct ompi_op_base_module_1_0_0_t *module) \
145+
struct ompi_op_base_module_2_0_0_t *module) \
144146
{ \
145147
const int types_per_step = svcnt(*((type##type_size##_t *) _in)); \
146-
const int cnt = *count; \
148+
const size_t cnt = *count; \
147149
type##type_size##_t *in = (type##type_size##_t *) _in, \
148150
*out = (type##type_size##_t *) _out; \
149151
OP_CONCAT(OMPI_OP_TYPE_PREPEND, type##type_size##_t) vsrc, vdst; \
@@ -279,11 +281,11 @@ _Generic((*(out)), \
279281
#if defined(GENERATE_NEON_CODE)
280282
#define OP_AARCH64_FUNC_3BUFF(name, type_name, type_size, type_cnt, type, op) \
281283
static void OP_CONCAT(ompi_op_aarch64_3buff_##name##_##type##type_size##_t, APPEND) \
282-
(const void *_in1, const void *_in2, void *_out, int *count, \
284+
(const void *_in1, const void *_in2, void *_out, size_t *count, \
283285
struct ompi_datatype_t **dtype, \
284-
struct ompi_op_base_module_1_0_0_t *module) \
286+
struct ompi_op_base_module_2_0_0_t *module) \
285287
{ \
286-
int left_over = *count; \
288+
size_t left_over = *count; \
287289
type##type_size##_t *in1 = (type##type_size##_t *) _in1, \
288290
*in2 = (type##type_size##_t *) _in2, \
289291
*out = (type##type_size##_t *) _out; \
@@ -304,17 +306,17 @@ static void OP_CONCAT(ompi_op_aarch64_3buff_##name##_##type##type_size##_t, APPE
304306
#elif defined(GENERATE_SVE_CODE)
305307
#define OP_AARCH64_FUNC_3BUFF(name, type_name, type_size, type_cnt, type, op) \
306308
static void OP_CONCAT(ompi_op_aarch64_3buff_##name##_##type##type_size##_t, APPEND) \
307-
(const void *_in1, const void *_in2, void *_out, int *count, \
309+
(const void *_in1, const void *_in2, void *_out, size_t *count, \
308310
struct ompi_datatype_t **dtype, \
309-
struct ompi_op_base_module_1_0_0_t *module) \
311+
struct ompi_op_base_module_2_0_0_t *module) \
310312
{ \
311313
const int types_per_step = svcnt(*((type##type_size##_t *) _in1)); \
312314
type##type_size##_t *in1 = (type##type_size##_t *) _in1, \
313315
*in2 = (type##type_size##_t *) _in2, \
314316
*out = (type##type_size##_t *) _out; \
315-
const int cnt = *count; \
317+
const size_t cnt = *count; \
316318
OP_CONCAT(OMPI_OP_TYPE_PREPEND, type##type_size##_t) vsrc, vdst; \
317-
for (int idx=0; idx < cnt; idx += types_per_step) { \
319+
for (size_t idx=0; idx < cnt; idx += types_per_step) { \
318320
svbool_t pred = svwhilelt_b##type_size(idx, cnt); \
319321
vsrc = svld1(pred, &in1[idx]); \
320322
vdst = svld1(pred, &in2[idx]); \

ompi/mca/op/avx/op_avx.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright (c) 2019-2020 The University of Tennessee and The University
33
* of Tennessee Research Foundation. All rights
44
* reserved.
5+
* Copyright (c) 2025 Triad National Security, LLC. All rights
6+
* reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -37,7 +39,7 @@ BEGIN_C_DECLS
3739
*/
3840
typedef struct {
3941
/** The base op component struct */
40-
ompi_op_base_component_1_0_0_t super;
42+
ompi_op_base_component_2_0_0_t super;
4143

4244
/* What follows is avx-component-specific cached information. We
4345
tend to use this scheme (caching information on the avx

ompi/mca/op/avx/op_avx_component.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* Copyright (c) 2020 Research Organization for Information Science
66
* and Technology (RIST). All rights reserved.
77
* Copyright (c) 2021 Cisco Systems, Inc. All rights reserved.
8+
* Copyright (c) 2025 Triad National Security, LLC. All rights
9+
* reserved.
810
* $COPYRIGHT$
911
*
1012
* Additional copyrights may follow
@@ -32,7 +34,7 @@ static int avx_component_open(void);
3234
static int avx_component_close(void);
3335
static int avx_component_init_query(bool enable_progress_threads,
3436
bool enable_mpi_thread_multiple);
35-
static struct ompi_op_base_module_1_0_0_t *
37+
static struct ompi_op_base_module_2_0_0_t *
3638
avx_component_op_query(struct ompi_op_t *op, int *priority);
3739
static int avx_component_register(void);
3840

@@ -131,7 +133,7 @@ static uint32_t has_intel_AVX_features(void)
131133
ompi_op_avx_component_t mca_op_avx_component = {
132134
{
133135
.opc_version = {
134-
OMPI_OP_BASE_VERSION_1_0_0,
136+
OMPI_OP_BASE_VERSION_2_0_0,
135137

136138
.mca_component_name = "avx",
137139
MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
@@ -250,7 +252,7 @@ avx_component_init_query(bool enable_progress_threads,
250252
/*
251253
* Query whether this component can be used for a specific op
252254
*/
253-
static struct ompi_op_base_module_1_0_0_t*
255+
static struct ompi_op_base_module_2_0_0_t*
254256
avx_component_op_query(struct ompi_op_t *op, int *priority)
255257
{
256258
ompi_op_base_module_t *module = NULL;
@@ -325,5 +327,5 @@ avx_component_op_query(struct ompi_op_t *op, int *priority)
325327
if (NULL != module) {
326328
*priority = 50;
327329
}
328-
return (ompi_op_base_module_1_0_0_t *) module;
330+
return (ompi_op_base_module_2_0_0_t *) module;
329331
}

0 commit comments

Comments
 (0)