@@ -155,12 +155,19 @@ int mca_coll_hcoll_gather(const void *sbuf, int scount,
155
155
struct ompi_datatype_t * rdtype ,
156
156
int root ,
157
157
struct ompi_communicator_t * comm ,
158
- mca_coll_base_module_t * module ){
158
+ mca_coll_base_module_t * module )
159
+ {
160
+ mca_coll_hcoll_module_t * hcoll_module = (mca_coll_hcoll_module_t * )module ;
159
161
dte_data_representation_t stype ;
160
162
dte_data_representation_t rtype ;
161
163
int rc ;
164
+
162
165
HCOL_VERBOSE (20 ,"RUNNING HCOL GATHER" );
163
- mca_coll_hcoll_module_t * hcoll_module = (mca_coll_hcoll_module_t * )module ;
166
+
167
+ if (root != comm -> c_my_rank ) {
168
+ rdtype = sdtype ;
169
+ }
170
+
164
171
stype = ompi_dtype_2_hcoll_dtype (sdtype , NO_DERIVED );
165
172
rtype = ompi_dtype_2_hcoll_dtype (rdtype , NO_DERIVED );
166
173
if (OPAL_UNLIKELY (HCOL_DTE_IS_ZERO (stype ) || HCOL_DTE_IS_ZERO (rtype ))) {
@@ -367,13 +374,19 @@ int mca_coll_hcoll_gatherv(const void* sbuf, int scount,
367
374
struct ompi_communicator_t * comm ,
368
375
mca_coll_base_module_t * module )
369
376
{
377
+ mca_coll_hcoll_module_t * hcoll_module = (mca_coll_hcoll_module_t * )module ;
370
378
dte_data_representation_t stype ;
371
379
dte_data_representation_t rtype ;
372
380
int rc ;
373
381
HCOL_VERBOSE (20 ,"RUNNING HCOL GATHERV" );
374
- mca_coll_hcoll_module_t * hcoll_module = (mca_coll_hcoll_module_t * )module ;
382
+
383
+ if (root != comm -> c_my_rank ) {
384
+ rdtype = sdtype ;
385
+ }
386
+
375
387
stype = ompi_dtype_2_hcoll_dtype (sdtype , NO_DERIVED );
376
388
rtype = ompi_dtype_2_hcoll_dtype (rdtype , NO_DERIVED );
389
+
377
390
if (OPAL_UNLIKELY (HCOL_DTE_IS_ZERO (stype ) || HCOL_DTE_IS_ZERO (rtype ))) {
378
391
/*If we are here then datatype is not simple predefined datatype */
379
392
/*In future we need to add more complex mapping to the dte_data_representation_t */
@@ -386,7 +399,9 @@ int mca_coll_hcoll_gatherv(const void* sbuf, int scount,
386
399
comm , hcoll_module -> previous_gatherv_module );
387
400
return rc ;
388
401
}
389
- rc = hcoll_collectives .coll_gatherv ((void * )sbuf , scount , stype , rbuf , (int * )rcounts , (int * )displs , rtype , root , hcoll_module -> hcoll_context );
402
+ rc = hcoll_collectives .coll_gatherv ((void * )sbuf , scount , stype , rbuf ,
403
+ (int * )rcounts , (int * )displs , rtype ,
404
+ root , hcoll_module -> hcoll_context );
390
405
if (HCOLL_SUCCESS != rc ){
391
406
HCOL_VERBOSE (20 ,"RUNNING FALLBACK GATHERV" );
392
407
rc = hcoll_module -> previous_gatherv (sbuf ,scount ,sdtype ,
@@ -651,13 +666,20 @@ int mca_coll_hcoll_igatherv(const void* sbuf, int scount,
651
666
ompi_request_t * * request ,
652
667
mca_coll_base_module_t * module )
653
668
{
669
+ mca_coll_hcoll_module_t * hcoll_module = (mca_coll_hcoll_module_t * )module ;
654
670
dte_data_representation_t stype ;
655
671
dte_data_representation_t rtype ;
656
672
int rc ;
657
673
void * * rt_handle ;
674
+
658
675
HCOL_VERBOSE (20 ,"RUNNING HCOL IGATHERV" );
659
- mca_coll_hcoll_module_t * hcoll_module = ( mca_coll_hcoll_module_t * ) module ;
676
+
660
677
rt_handle = (void * * ) request ;
678
+
679
+ if (root != comm -> c_my_rank ) {
680
+ rdtype = sdtype ;
681
+ }
682
+
661
683
stype = ompi_dtype_2_hcoll_dtype (sdtype , NO_DERIVED );
662
684
rtype = ompi_dtype_2_hcoll_dtype (rdtype , NO_DERIVED );
663
685
if (OPAL_UNLIKELY (HCOL_DTE_IS_ZERO (stype ) || HCOL_DTE_IS_ZERO (rtype ))) {
0 commit comments