44 * reserved.
55 * Copyright (c) 2022 IBM Corporation. All rights reserved
66 * Copyright (c) 2020-2022 Bull S.A.S. All rights reserved.
7+ * Copyright (c) Amazon.com, Inc. or its affiliates.
8+ * All rights reserved.
79 * $COPYRIGHT$
810 *
911 * Additional copyrights may follow
@@ -189,7 +191,9 @@ typedef struct mca_coll_han_op_module_name_t {
189191 mca_coll_han_op_up_low_module_name_t allreduce ;
190192 mca_coll_han_op_up_low_module_name_t allgather ;
191193 mca_coll_han_op_up_low_module_name_t gather ;
194+ mca_coll_han_op_up_low_module_name_t gatherv ;
192195 mca_coll_han_op_up_low_module_name_t scatter ;
196+ mca_coll_han_op_up_low_module_name_t scatterv ;
193197} mca_coll_han_op_module_name_t ;
194198
195199/**
@@ -233,10 +237,18 @@ typedef struct mca_coll_han_component_t {
233237 uint32_t han_gather_up_module ;
234238 /* low level module for gather */
235239 uint32_t han_gather_low_module ;
240+ /* up level module for gatherv */
241+ uint32_t han_gatherv_up_module ;
242+ /* low level module for gatherv */
243+ uint32_t han_gatherv_low_module ;
236244 /* up level module for scatter */
237245 uint32_t han_scatter_up_module ;
238246 /* low level module for scatter */
239247 uint32_t han_scatter_low_module ;
248+ /* up level module for scatterv */
249+ uint32_t han_scatterv_up_module ;
250+ /* low level module for scatterv */
251+ uint32_t han_scatterv_low_module ;
240252 /* name of the modules */
241253 mca_coll_han_op_module_name_t han_op_module_name ;
242254 /* whether we need reproducible results
@@ -277,8 +289,10 @@ typedef struct mca_coll_han_single_collective_fallback_s {
277289 mca_coll_base_module_barrier_fn_t barrier ;
278290 mca_coll_base_module_bcast_fn_t bcast ;
279291 mca_coll_base_module_gather_fn_t gather ;
292+ mca_coll_base_module_gatherv_fn_t gatherv ;
280293 mca_coll_base_module_reduce_fn_t reduce ;
281294 mca_coll_base_module_scatter_fn_t scatter ;
295+ mca_coll_base_module_scatterv_fn_t scatterv ;
282296 } module_fn ;
283297 mca_coll_base_module_t * module ;
284298} mca_coll_han_single_collective_fallback_t ;
@@ -296,7 +310,9 @@ typedef struct mca_coll_han_collectives_fallback_s {
296310 mca_coll_han_single_collective_fallback_t bcast ;
297311 mca_coll_han_single_collective_fallback_t reduce ;
298312 mca_coll_han_single_collective_fallback_t gather ;
313+ mca_coll_han_single_collective_fallback_t gatherv ;
299314 mca_coll_han_single_collective_fallback_t scatter ;
315+ mca_coll_han_single_collective_fallback_t scatterv ;
300316} mca_coll_han_collectives_fallback_t ;
301317
302318/** Coll han module */
@@ -369,9 +385,14 @@ OBJ_CLASS_DECLARATION(mca_coll_han_module_t);
369385#define previous_gather fallback.gather.module_fn.gather
370386#define previous_gather_module fallback.gather.module
371387
388+ #define previous_gatherv fallback.gatherv.module_fn.gatherv
389+ #define previous_gatherv_module fallback.gatherv.module
390+
372391#define previous_scatter fallback.scatter.module_fn.scatter
373392#define previous_scatter_module fallback.scatter.module
374393
394+ #define previous_scatterv fallback.scatterv.module_fn.scatterv
395+ #define previous_scatterv_module fallback.scatterv.module
375396
376397/* macro to correctly load a fallback collective module */
377398#define HAN_LOAD_FALLBACK_COLLECTIVE (HANM , COMM , COLL ) \
@@ -391,7 +412,9 @@ OBJ_CLASS_DECLARATION(mca_coll_han_module_t);
391412 HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, barrier); \
392413 HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, bcast); \
393414 HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, scatter); \
415+ HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, scatterv); \
394416 HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, gather); \
417+ HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, gatherv); \
395418 HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, reduce); \
396419 HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, allreduce); \
397420 HAN_LOAD_FALLBACK_COLLECTIVE(HANM, COMM, allgather); \
@@ -432,11 +455,16 @@ int *mca_coll_han_topo_init(struct ompi_communicator_t *comm, mca_coll_han_modul
432455
433456/* Utils */
434457static inline void
435- mca_coll_han_get_ranks (int * vranks , int root , int low_size ,
436- int * root_low_rank , int * root_up_rank )
458+ mca_coll_han_get_ranks (int * vranks , int w_rank , int low_size ,
459+ int * low_rank , int * up_rank )
437460{
438- * root_up_rank = vranks [root ] / low_size ;
439- * root_low_rank = vranks [root ] % low_size ;
461+ if (up_rank ) {
462+ * up_rank = vranks [w_rank ] / low_size ;
463+ }
464+
465+ if (low_rank ) {
466+ * low_rank = vranks [w_rank ] % low_size ;
467+ }
440468}
441469
442470const char * mca_coll_han_topo_lvl_to_str (TOPO_LVL_T topo_lvl );
@@ -469,11 +497,17 @@ int
469497mca_coll_han_gather_intra_dynamic (GATHER_BASE_ARGS ,
470498 mca_coll_base_module_t * module );
471499int
500+ mca_coll_han_gatherv_intra_dynamic (GATHERV_BASE_ARGS ,
501+ mca_coll_base_module_t * module );
502+ int
472503mca_coll_han_reduce_intra_dynamic (REDUCE_BASE_ARGS ,
473504 mca_coll_base_module_t * module );
474505int
475506mca_coll_han_scatter_intra_dynamic (SCATTER_BASE_ARGS ,
476507 mca_coll_base_module_t * module );
508+ int
509+ mca_coll_han_scatterv_intra_dynamic (SCATTERV_BASE_ARGS ,
510+ mca_coll_base_module_t * module );
477511
478512int mca_coll_han_barrier_intra_simple (struct ompi_communicator_t * comm ,
479513 mca_coll_base_module_t * module );
@@ -486,4 +520,10 @@ ompi_coll_han_reorder_gather(const void *sbuf,
486520 struct ompi_communicator_t * comm ,
487521 int * topo );
488522
523+ size_t
524+ coll_han_utils_gcd (const size_t * numerators , const size_t size );
525+
526+ int
527+ coll_han_utils_create_contiguous_datatype (size_t count , const ompi_datatype_t * oldType ,
528+ ompi_datatype_t * * newType );
489529#endif /* MCA_COLL_HAN_EXPORT_H */
0 commit comments