99
1010#include "coll_ucc_common.h"
1111
12- static inline ucc_status_t mca_coll_ucc_allgatherv_init (const void * sbuf , int scount ,
12+ static inline ucc_status_t mca_coll_ucc_allgatherv_init (const void * sbuf , size_t scount ,
1313 struct ompi_datatype_t * sdtype ,
1414 void * rbuf , ompi_count_array_t rcounts , ompi_disp_array_t rdisps ,
1515 struct ompi_datatype_t * rdtype ,
1616 mca_coll_ucc_module_t * ucc_module ,
1717 ucc_coll_req_h * req ,
1818 mca_coll_ucc_req_t * coll_req )
1919{
20- ucc_datatype_t ucc_sdt , ucc_rdt ;
20+ ucc_datatype_t ucc_sdt = UCC_DT_INT8 , ucc_rdt = UCC_DT_INT8 ;
21+ bool is_inplace = (MPI_IN_PLACE == sbuf );
22+ uint64_t flags = 0 ;
2123
22- ucc_sdt = ompi_dtype_to_ucc_dtype (sdtype );
2324 ucc_rdt = ompi_dtype_to_ucc_dtype (rdtype );
25+ if (!is_inplace ) {
26+ ucc_sdt = ompi_dtype_to_ucc_dtype (sdtype );
27+ }
28+
2429 if (COLL_UCC_DT_UNSUPPORTED == ucc_sdt ||
2530 COLL_UCC_DT_UNSUPPORTED == ucc_rdt ) {
2631 UCC_VERBOSE (5 , "ompi_datatype is not supported: dtype = %s" ,
@@ -29,13 +34,13 @@ static inline ucc_status_t mca_coll_ucc_allgatherv_init(const void *sbuf, int sc
2934 goto fallback ;
3035 }
3136
32- uint64_t flags = ompi_count_array_is_64bit (rcounts ) ? UCC_COLL_ARGS_FLAG_COUNT_64BIT : 0 ;
33- flags |= ompi_disp_array_is_64bit (rdisps ) ? UCC_COLL_ARGS_FLAG_DISPLACEMENTS_64BIT : 0 ;
37+ flags = (ompi_count_array_is_64bit (rcounts ) ? UCC_COLL_ARGS_FLAG_COUNT_64BIT : 0 ) |
38+ (ompi_disp_array_is_64bit (rdisps ) ? UCC_COLL_ARGS_FLAG_DISPLACEMENTS_64BIT : 0 ) |
39+ (is_inplace ? UCC_COLL_ARGS_FLAG_IN_PLACE : 0 );
3440
3541 ucc_coll_args_t coll = {
42+ .mask = flags ? UCC_COLL_ARGS_FIELD_FLAGS : 0 ,
3643 .flags = flags ,
37- .mask = 0 ,
38- .flags = 0 ,
3944 .coll_type = UCC_COLL_TYPE_ALLGATHERV ,
4045 .src .info = {
4146 .buffer = (void * )sbuf ,
@@ -52,10 +57,6 @@ static inline ucc_status_t mca_coll_ucc_allgatherv_init(const void *sbuf, int sc
5257 }
5358 };
5459
55- if (MPI_IN_PLACE == sbuf ) {
56- coll .mask = UCC_COLL_ARGS_FIELD_FLAGS ;
57- coll .flags |= UCC_COLL_ARGS_FLAG_IN_PLACE ;
58- }
5960 COLL_UCC_REQ_INIT (coll_req , req , coll , ucc_module );
6061 return UCC_OK ;
6162fallback :
0 commit comments