@@ -136,7 +136,8 @@ int mca_coll_hcoll_allgatherv(const void *sbuf, int scount,
136136 hcoll_module -> previous_allgatherv_module );
137137 return rc ;
138138 }
139- rc = hcoll_collectives .coll_allgatherv ((void * )sbuf ,scount ,stype ,rbuf ,rcount ,displs ,rtype ,hcoll_module -> hcoll_context );
139+ rc = hcoll_collectives .coll_allgatherv ((void * )sbuf ,scount ,stype ,rbuf ,(int * )rcount ,
140+ (int * )displs ,rtype ,hcoll_module -> hcoll_context );
140141 if (HCOLL_SUCCESS != rc ){
141142 HCOL_VERBOSE (20 ,"RUNNING FALLBACK ALLGATHERV" );
142143 rc = hcoll_module -> previous_allgatherv (sbuf ,scount ,sdtype ,
@@ -558,7 +559,7 @@ int mca_coll_hcoll_iallgatherv(const void *sbuf, int scount,
558559 hcoll_module -> previous_iallgatherv_module );
559560 return rc ;
560561 }
561- rc = hcoll_collectives .coll_iallgatherv ((void * )sbuf ,scount ,stype ,rbuf ,rcount ,displs ,rtype ,
562+ rc = hcoll_collectives .coll_iallgatherv ((void * )sbuf ,scount ,stype ,rbuf ,( int * ) rcount ,( int * ) displs ,rtype ,
562563 hcoll_module -> hcoll_context , rt_handle );
563564 if (HCOLL_SUCCESS != rc ){
564565 HCOL_VERBOSE (20 ,"RUNNING FALLBACK NON-BLOCKING ALLGATHER" );
@@ -724,9 +725,9 @@ int mca_coll_hcoll_igatherv(const void* sbuf, int scount,
724725
725726
726727#if HCOLL_API >= HCOLL_VERSION (3 ,7 )
727- int mca_coll_hcoll_ialltoallv (const void * sbuf , int * scounts , int * sdisps ,
728+ int mca_coll_hcoll_ialltoallv (const void * sbuf , const int * scounts , const int * sdisps ,
728729 struct ompi_datatype_t * sdtype ,
729- void * rbuf , int * rcounts , int * rdisps ,
730+ void * rbuf , const int * rcounts , const int * rdisps ,
730731 struct ompi_datatype_t * rdtype ,
731732 struct ompi_communicator_t * comm ,
732733 ompi_request_t * * request ,
@@ -760,3 +761,88 @@ int mca_coll_hcoll_ialltoallv(const void *sbuf, int *scounts, int *sdisps,
760761 return rc ;
761762}
762763#endif
764+
765+ #if HCOLL_API > HCOLL_VERSION (4 ,5 )
766+ int mca_coll_hcoll_reduce_scatter_block (const void * sbuf , void * rbuf , int rcount ,
767+ struct ompi_datatype_t * dtype ,
768+ struct ompi_op_t * op ,
769+ struct ompi_communicator_t * comm ,
770+ mca_coll_base_module_t * module ) {
771+ dte_data_representation_t Dtype ;
772+ hcoll_dte_op_t * Op ;
773+ int rc ;
774+ HCOL_VERBOSE (20 ,"RUNNING HCOL REDUCE SCATTER BLOCK" );
775+ mca_coll_hcoll_module_t * hcoll_module = (mca_coll_hcoll_module_t * )module ;
776+ Dtype = ompi_dtype_2_hcoll_dtype (dtype , NO_DERIVED );
777+ if (OPAL_UNLIKELY (HCOL_DTE_IS_ZERO (Dtype ))){
778+ /*If we are here then datatype is not simple predefined datatype */
779+ /*In future we need to add more complex mapping to the dte_data_representation_t */
780+ /* Now use fallback */
781+ HCOL_VERBOSE (20 ,"Ompi_datatype is not supported: dtype = %s; calling fallback allreduce;" ,
782+ dtype -> super .name );
783+ goto fallback ;
784+ }
785+
786+ Op = ompi_op_2_hcolrte_op (op );
787+ if (OPAL_UNLIKELY (HCOL_DTE_OP_NULL == Op -> id )){
788+ /*If we are here then datatype is not simple predefined datatype */
789+ /*In future we need to add more complex mapping to the dte_data_representation_t */
790+ /* Now use fallback */
791+ HCOL_VERBOSE (20 ,"ompi_op_t is not supported: op = %s; calling fallback allreduce;" ,
792+ op -> o_name );
793+ goto fallback ;
794+ }
795+
796+ rc = hcoll_collectives .coll_reduce_scatter_block ((void * )sbuf ,rbuf ,rcount ,Dtype ,Op ,hcoll_module -> hcoll_context );
797+ if (HCOLL_SUCCESS != rc ){
798+ fallback :
799+ HCOL_VERBOSE (20 ,"RUNNING FALLBACK ALLREDUCE" );
800+ rc = hcoll_module -> previous_reduce_scatter_block (sbuf ,rbuf ,
801+ rcount ,dtype ,op ,
802+ comm , hcoll_module -> previous_allreduce_module );
803+ }
804+ return rc ;
805+ }
806+
807+ int mca_coll_hcoll_reduce_scatter (const void * sbuf , void * rbuf , const int * rcounts ,
808+ struct ompi_datatype_t * dtype ,
809+ struct ompi_op_t * op ,
810+ struct ompi_communicator_t * comm ,
811+ mca_coll_base_module_t * module ) {
812+ dte_data_representation_t Dtype ;
813+ hcoll_dte_op_t * Op ;
814+ int rc ;
815+ HCOL_VERBOSE (20 ,"RUNNING HCOL REDUCE SCATTER" );
816+ mca_coll_hcoll_module_t * hcoll_module = (mca_coll_hcoll_module_t * )module ;
817+ Dtype = ompi_dtype_2_hcoll_dtype (dtype , NO_DERIVED );
818+ if (OPAL_UNLIKELY (HCOL_DTE_IS_ZERO (Dtype ))){
819+ /*If we are here then datatype is not simple predefined datatype */
820+ /*In future we need to add more complex mapping to the dte_data_representation_t */
821+ /* Now use fallback */
822+ HCOL_VERBOSE (20 ,"Ompi_datatype is not supported: dtype = %s; calling fallback allreduce;" ,
823+ dtype -> super .name );
824+ goto fallback ;
825+ }
826+
827+ Op = ompi_op_2_hcolrte_op (op );
828+ if (OPAL_UNLIKELY (HCOL_DTE_OP_NULL == Op -> id )){
829+ /*If we are here then datatype is not simple predefined datatype */
830+ /*In future we need to add more complex mapping to the dte_data_representation_t */
831+ /* Now use fallback */
832+ HCOL_VERBOSE (20 ,"ompi_op_t is not supported: op = %s; calling fallback allreduce;" ,
833+ op -> o_name );
834+ goto fallback ;
835+ }
836+
837+ rc = hcoll_collectives .coll_reduce_scatter ((void * )sbuf , rbuf , (int * )rcounts ,
838+ Dtype , Op , hcoll_module -> hcoll_context );
839+ if (HCOLL_SUCCESS != rc ){
840+ fallback :
841+ HCOL_VERBOSE (20 ,"RUNNING FALLBACK ALLREDUCE" );
842+ rc = hcoll_module -> previous_reduce_scatter (sbuf ,rbuf ,
843+ rcounts ,dtype ,op ,
844+ comm , hcoll_module -> previous_allreduce_module );
845+ }
846+ return rc ;
847+ }
848+ #endif
0 commit comments