root/ompi/mca/coll/hcoll/coll_hcoll_ops.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mca_coll_hcoll_barrier
  2. mca_coll_hcoll_bcast
  3. mca_coll_hcoll_allgather
  4. mca_coll_hcoll_allgatherv
  5. mca_coll_hcoll_gather
  6. mca_coll_hcoll_allreduce
  7. mca_coll_hcoll_reduce
  8. mca_coll_hcoll_alltoall
  9. mca_coll_hcoll_alltoallv
  10. mca_coll_hcoll_gatherv
  11. mca_coll_hcoll_scatterv
  12. mca_coll_hcoll_ibarrier
  13. mca_coll_hcoll_ibcast
  14. mca_coll_hcoll_iallgather
  15. mca_coll_hcoll_iallgatherv
  16. mca_coll_hcoll_iallreduce
  17. mca_coll_hcoll_ireduce
  18. mca_coll_hcoll_igatherv
  19. mca_coll_hcoll_ialltoallv

   1 /**
   2   Copyright (c) 2011      Mellanox Technologies. All rights reserved.
   3   Copyright (c) 2015      Research Organization for Information Science
   4                           and Technology (RIST). All rights reserved.
   5   Copyright (c) 2018      Cisco Systems, Inc.  All rights reserved
   6   $COPYRIGHT$
   7 
   8   Additional copyrights may follow
   9 
  10   $HEADER$
  11  */
  12 
  13 #include "ompi_config.h"
  14 #include "ompi/constants.h"
  15 #include "coll_hcoll.h"
  16 #include "hcoll/api/hcoll_constants.h"
  17 #include "coll_hcoll_dtypes.h"
  18 #include "hcoll/api/hcoll_dte.h"
  19 int mca_coll_hcoll_barrier(struct ompi_communicator_t *comm,
  20                          mca_coll_base_module_t *module){
  21     int rc;
  22     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
  23     HCOL_VERBOSE(20,"RUNNING HCOL BARRIER");
  24 
  25     if (OPAL_UNLIKELY(ompi_mpi_state >= OMPI_MPI_STATE_FINALIZE_STARTED)) {
  26         HCOL_VERBOSE(5, "In finalize, reverting to previous barrier");
  27         goto orig_barrier;
  28     }
  29     rc = hcoll_collectives.coll_barrier(hcoll_module->hcoll_context);
  30     if (HCOLL_SUCCESS != rc){
  31         HCOL_VERBOSE(20,"RUNNING FALLBACK BARRIER");
  32         rc = hcoll_module->previous_barrier(comm,hcoll_module->previous_barrier_module);
  33     }
  34     return rc;
  35 orig_barrier:
  36     return hcoll_module->previous_barrier(comm,hcoll_module->previous_barrier_module);
  37 }
  38 
  39 int mca_coll_hcoll_bcast(void *buff, int count,
  40                         struct ompi_datatype_t *datatype, int root,
  41                         struct ompi_communicator_t *comm,
  42                         mca_coll_base_module_t *module)
  43 {
  44     dte_data_representation_t dtype;
  45     int rc;
  46     HCOL_VERBOSE(20,"RUNNING HCOL BCAST");
  47     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
  48     dtype = ompi_dtype_2_hcoll_dtype(datatype, TRY_FIND_DERIVED);
  49 
  50     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(dtype))) {
  51         /*If we are here then datatype is not simple predefined datatype */
  52         /*In future we need to add more complex mapping to the dte_data_representation_t */
  53         /* Now use fallback */
  54         HCOL_VERBOSE(20,"Ompi_datatype is not supported: %s; calling fallback bcast;",datatype->super.name);
  55         rc = hcoll_module->previous_bcast(buff,count,datatype,root,
  56                                          comm,hcoll_module->previous_bcast_module);
  57         return rc;
  58     }
  59     rc = hcoll_collectives.coll_bcast(buff,count,dtype,root,hcoll_module->hcoll_context);
  60     if (HCOLL_SUCCESS != rc){
  61         HCOL_VERBOSE(20,"RUNNING FALLBACK BCAST");
  62         rc = hcoll_module->previous_bcast(buff,count,datatype,root,
  63                                          comm,hcoll_module->previous_bcast_module);
  64     }
  65     return rc;
  66 }
  67 
  68 int mca_coll_hcoll_allgather(const void *sbuf, int scount,
  69                             struct ompi_datatype_t *sdtype,
  70                             void *rbuf, int rcount,
  71                             struct ompi_datatype_t *rdtype,
  72                             struct ompi_communicator_t *comm,
  73                             mca_coll_base_module_t *module)
  74 {
  75     dte_data_representation_t stype;
  76     dte_data_representation_t rtype;
  77     int rc;
  78     HCOL_VERBOSE(20,"RUNNING HCOL ALLGATHER");
  79     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
  80     stype = ompi_dtype_2_hcoll_dtype(sdtype, TRY_FIND_DERIVED);
  81     rtype = ompi_dtype_2_hcoll_dtype(rdtype, TRY_FIND_DERIVED);
  82     if (sbuf == MPI_IN_PLACE) {
  83         stype = rtype;
  84     }
  85     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
  86         /*If we are here then datatype is not simple predefined datatype */
  87         /*In future we need to add more complex mapping to the dte_data_representation_t */
  88         /* Now use fallback */
  89         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback allgather;",
  90                      sdtype->super.name,
  91                      rdtype->super.name);
  92         rc = hcoll_module->previous_allgather(sbuf,scount,sdtype,
  93                                              rbuf,rcount,rdtype,
  94                                              comm,
  95                                              hcoll_module->previous_allgather_module);
  96         return rc;
  97     }
  98     rc = hcoll_collectives.coll_allgather((void *)sbuf,scount,stype,rbuf,rcount,rtype,hcoll_module->hcoll_context);
  99     if (HCOLL_SUCCESS != rc){
 100         HCOL_VERBOSE(20,"RUNNING FALLBACK ALLGATHER");
 101         rc = hcoll_module->previous_allgather(sbuf,scount,sdtype,
 102                                              rbuf,rcount,rdtype,
 103                                              comm,
 104                                              hcoll_module->previous_allgather_module);
 105     }
 106     return rc;
 107 }
 108 
 109 int mca_coll_hcoll_allgatherv(const void *sbuf, int scount,
 110                             struct ompi_datatype_t *sdtype,
 111                             void *rbuf, const int *rcount,
 112                             const int *displs,
 113                             struct ompi_datatype_t *rdtype,
 114                             struct ompi_communicator_t *comm,
 115                             mca_coll_base_module_t *module)
 116 {
 117     dte_data_representation_t stype;
 118     dte_data_representation_t rtype;
 119     int rc;
 120     HCOL_VERBOSE(20,"RUNNING HCOL ALLGATHERV");
 121     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 122     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 123     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 124     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 125         /*If we are here then datatype is not simple predefined datatype */
 126         /*In future we need to add more complex mapping to the dte_data_representation_t */
 127         /* Now use fallback */
 128         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback allgatherv;",
 129                      sdtype->super.name,
 130                      rdtype->super.name);
 131         rc = hcoll_module->previous_allgatherv(sbuf,scount,sdtype,
 132                                              rbuf,rcount,
 133                                              displs, 
 134                                              rdtype,
 135                                              comm,
 136                                              hcoll_module->previous_allgatherv_module);
 137         return rc;
 138     }
 139     rc = hcoll_collectives.coll_allgatherv((void *)sbuf,scount,stype,rbuf,rcount,displs,rtype,hcoll_module->hcoll_context);
 140     if (HCOLL_SUCCESS != rc){
 141         HCOL_VERBOSE(20,"RUNNING FALLBACK ALLGATHERV");
 142         rc = hcoll_module->previous_allgatherv(sbuf,scount,sdtype,
 143                                              rbuf,rcount,
 144                                              displs, 
 145                                              rdtype,
 146                                              comm,
 147                                              hcoll_module->previous_allgatherv_module);
 148     }
 149     return rc;
 150 }
 151 
 152 int mca_coll_hcoll_gather(const void *sbuf, int scount,
 153                           struct ompi_datatype_t *sdtype,
 154                           void *rbuf, int rcount,
 155                           struct ompi_datatype_t *rdtype,
 156                           int root,
 157                           struct ompi_communicator_t *comm,
 158                           mca_coll_base_module_t *module){
 159     dte_data_representation_t stype;
 160     dte_data_representation_t rtype;
 161     int rc;
 162     HCOL_VERBOSE(20,"RUNNING HCOL GATHER");
 163     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 164     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 165     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 166     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 167         /*If we are here then datatype is not simple predefined datatype */
 168         /*In future we need to add more complex mapping to the dte_data_representation_t */
 169         /* Now use fallback */
 170         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback gather;",
 171                      sdtype->super.name,
 172                      rdtype->super.name);
 173         rc = hcoll_module->previous_gather(sbuf,scount,sdtype,
 174                                            rbuf,rcount,rdtype,root,
 175                                            comm,
 176                                            hcoll_module->previous_allgather_module);
 177         return rc;
 178     }
 179     rc = hcoll_collectives.coll_gather((void *)sbuf,scount,stype,rbuf,rcount,rtype,root,hcoll_module->hcoll_context);
 180     if (HCOLL_SUCCESS != rc){
 181         HCOL_VERBOSE(20,"RUNNING FALLBACK GATHER");
 182         rc = hcoll_module->previous_gather((void *)sbuf,scount,sdtype,
 183                                               rbuf,rcount,rdtype,root,
 184                                               comm,
 185                                               hcoll_module->previous_allgather_module);
 186     }
 187     return rc;
 188 
 189 }
 190 
 191 int mca_coll_hcoll_allreduce(const void *sbuf, void *rbuf, int count,
 192                             struct ompi_datatype_t *dtype,
 193                             struct ompi_op_t *op,
 194                             struct ompi_communicator_t *comm,
 195                             mca_coll_base_module_t *module)
 196 {
 197     dte_data_representation_t Dtype;
 198     hcoll_dte_op_t *Op;
 199     int rc;
 200     HCOL_VERBOSE(20,"RUNNING HCOL ALLREDUCE");
 201     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 202     Dtype = ompi_dtype_2_hcoll_dtype(dtype, NO_DERIVED);
 203     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(Dtype))){
 204         /*If we are here then datatype is not simple predefined datatype */
 205         /*In future we need to add more complex mapping to the dte_data_representation_t */
 206         /* Now use fallback */
 207         HCOL_VERBOSE(20,"Ompi_datatype is not supported: dtype = %s; calling fallback allreduce;",
 208                      dtype->super.name);
 209         rc = hcoll_module->previous_allreduce(sbuf,rbuf,
 210                                              count,dtype,op,
 211                                              comm, hcoll_module->previous_allreduce_module);
 212         return rc;
 213     }
 214 
 215     Op = ompi_op_2_hcolrte_op(op);
 216     if (OPAL_UNLIKELY(HCOL_DTE_OP_NULL == Op->id)){
 217         /*If we are here then datatype is not simple predefined datatype */
 218         /*In future we need to add more complex mapping to the dte_data_representation_t */
 219         /* Now use fallback */
 220         HCOL_VERBOSE(20,"ompi_op_t is not supported: op = %s; calling fallback allreduce;",
 221                      op->o_name);
 222         rc = hcoll_module->previous_allreduce(sbuf,rbuf,
 223                                              count,dtype,op,
 224                                              comm, hcoll_module->previous_allreduce_module);
 225         return rc;
 226     }
 227 
 228     rc = hcoll_collectives.coll_allreduce((void *)sbuf,rbuf,count,Dtype,Op,hcoll_module->hcoll_context);
 229     if (HCOLL_SUCCESS != rc){
 230         HCOL_VERBOSE(20,"RUNNING FALLBACK ALLREDUCE");
 231         rc = hcoll_module->previous_allreduce(sbuf,rbuf,
 232                                              count,dtype,op,
 233                                              comm, hcoll_module->previous_allreduce_module);
 234     }
 235     return rc;
 236 }
 237 
 238 int mca_coll_hcoll_reduce(const void *sbuf, void *rbuf, int count,
 239                             struct ompi_datatype_t *dtype,
 240                             struct ompi_op_t *op,
 241                             int root,
 242                             struct ompi_communicator_t *comm,
 243                             mca_coll_base_module_t *module)
 244 {
 245     dte_data_representation_t Dtype;
 246     hcoll_dte_op_t *Op;
 247     int rc;
 248     HCOL_VERBOSE(20,"RUNNING HCOL REDUCE");
 249     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 250     Dtype = ompi_dtype_2_hcoll_dtype(dtype, NO_DERIVED);
 251     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(Dtype))){
 252         /*If we are here then datatype is not simple predefined datatype */
 253         /*In future we need to add more complex mapping to the dte_data_representation_t */
 254         /* Now use fallback */
 255         HCOL_VERBOSE(20,"Ompi_datatype is not supported: dtype = %s; calling fallback reduce;",
 256                      dtype->super.name);
 257         rc = hcoll_module->previous_reduce(sbuf,rbuf,
 258                                              count,dtype,op,
 259                                              root,
 260                                              comm, hcoll_module->previous_reduce_module);
 261         return rc;
 262     }
 263 
 264     Op = ompi_op_2_hcolrte_op(op);
 265     if (OPAL_UNLIKELY(HCOL_DTE_OP_NULL == Op->id)){
 266         /*If we are here then datatype is not simple predefined datatype */
 267         /*In future we need to add more complex mapping to the dte_data_representation_t */
 268         /* Now use fallback */
 269         HCOL_VERBOSE(20,"ompi_op_t is not supported: op = %s; calling fallback reduce;",
 270                      op->o_name);
 271         rc = hcoll_module->previous_reduce(sbuf,rbuf,
 272                                              count,dtype,op,
 273                                              root,
 274                                              comm, hcoll_module->previous_reduce_module);
 275         return rc;
 276     }
 277 
 278     rc = hcoll_collectives.coll_reduce((void *)sbuf,rbuf,count,Dtype,Op,root,hcoll_module->hcoll_context);
 279     if (HCOLL_SUCCESS != rc){
 280         HCOL_VERBOSE(20,"RUNNING FALLBACK REDUCE");
 281         rc = hcoll_module->previous_reduce(sbuf,rbuf,
 282                                              count,dtype,op,
 283                                              root,
 284                                              comm, hcoll_module->previous_reduce_module);
 285     }
 286     return rc;
 287 }
 288 
 289 int mca_coll_hcoll_alltoall(const void *sbuf, int scount,
 290                            struct ompi_datatype_t *sdtype,
 291                            void* rbuf, int rcount,
 292                            struct ompi_datatype_t *rdtype,
 293                            struct ompi_communicator_t *comm,
 294                            mca_coll_base_module_t *module)
 295 {
 296     dte_data_representation_t stype;
 297     dte_data_representation_t rtype;
 298     int rc;
 299     HCOL_VERBOSE(20,"RUNNING HCOL ALLTOALL");
 300     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 301     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 302     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 303     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 304         /*If we are here then datatype is not simple predefined datatype */
 305         /*In future we need to add more complex mapping to the dte_data_representation_t */
 306         /* Now use fallback */
 307         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback alltoall;",
 308                      sdtype->super.name,
 309                      rdtype->super.name);
 310         rc = hcoll_module->previous_alltoall(sbuf,scount,sdtype,
 311                                             rbuf,rcount,rdtype,
 312                                             comm,
 313                                             hcoll_module->previous_alltoall_module);
 314         return rc;
 315     }
 316     rc = hcoll_collectives.coll_alltoall((void *)sbuf,scount,stype,rbuf,rcount,rtype,hcoll_module->hcoll_context);
 317     if (HCOLL_SUCCESS != rc){
 318         HCOL_VERBOSE(20,"RUNNING FALLBACK ALLTOALL");
 319         rc = hcoll_module->previous_alltoall(sbuf,scount,sdtype,
 320                                             rbuf,rcount,rdtype,
 321                                             comm,
 322                                             hcoll_module->previous_alltoall_module);
 323     }
 324     return rc;
 325 }
 326 
 327 int mca_coll_hcoll_alltoallv(const void *sbuf, const int *scounts, const int *sdisps,
 328                             struct ompi_datatype_t *sdtype,
 329                             void *rbuf, const int *rcounts, const int *rdisps,
 330                             struct ompi_datatype_t *rdtype,
 331                             struct ompi_communicator_t *comm,
 332                             mca_coll_base_module_t *module)
 333 {
 334     dte_data_representation_t stype;
 335     dte_data_representation_t rtype;
 336     int rc;
 337     HCOL_VERBOSE(20,"RUNNING HCOL ALLTOALLV");
 338     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 339     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 340     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 341     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 342         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback alltoallv;",
 343                      sdtype->super.name,
 344                      rdtype->super.name);
 345         rc = hcoll_module->previous_alltoallv(sbuf, scounts, sdisps, sdtype,
 346                                             rbuf, rcounts, rdisps, rdtype,
 347                                             comm, hcoll_module->previous_alltoallv_module);
 348         return rc;
 349     }
 350     rc = hcoll_collectives.coll_alltoallv((void *)sbuf, (int *)scounts, (int *)sdisps, stype,
 351                                             rbuf, (int *)rcounts, (int *)rdisps, rtype,
 352                                                 hcoll_module->hcoll_context);
 353     if (HCOLL_SUCCESS != rc){
 354         HCOL_VERBOSE(20,"RUNNING FALLBACK ALLTOALLV");
 355         rc = hcoll_module->previous_alltoallv(sbuf, scounts, sdisps, sdtype,
 356                                             rbuf, rcounts, rdisps, rdtype,
 357                                             comm, hcoll_module->previous_alltoallv_module);
 358     }
 359     return rc;
 360 }
 361 
 362 int mca_coll_hcoll_gatherv(const void* sbuf, int scount,
 363                             struct ompi_datatype_t *sdtype,
 364                             void* rbuf, const int *rcounts, const int *displs,
 365                             struct ompi_datatype_t *rdtype,
 366                             int root,
 367                             struct ompi_communicator_t *comm,
 368                             mca_coll_base_module_t *module)
 369 {
 370     dte_data_representation_t stype;
 371     dte_data_representation_t rtype;
 372     int rc;
 373     HCOL_VERBOSE(20,"RUNNING HCOL GATHERV");
 374     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 375     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 376     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 377     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 378         /*If we are here then datatype is not simple predefined datatype */
 379         /*In future we need to add more complex mapping to the dte_data_representation_t */
 380         /* Now use fallback */
 381         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback gatherv;",
 382                      sdtype->super.name,
 383                      rdtype->super.name);
 384         rc = hcoll_module->previous_gatherv(sbuf,scount,sdtype,
 385                                            rbuf, rcounts, displs, rdtype,root,
 386                                            comm, hcoll_module->previous_gatherv_module);
 387         return rc;
 388     }
 389     rc = hcoll_collectives.coll_gatherv((void *)sbuf, scount, stype, rbuf, (int *)rcounts, (int *)displs, rtype, root, hcoll_module->hcoll_context);
 390     if (HCOLL_SUCCESS != rc){
 391         HCOL_VERBOSE(20,"RUNNING FALLBACK GATHERV");
 392         rc = hcoll_module->previous_gatherv(sbuf,scount,sdtype,
 393                                            rbuf, rcounts, displs, rdtype,root,
 394                                            comm, hcoll_module->previous_igatherv_module);
 395     }
 396     return rc;
 397 
 398 }
 399 
 400 int mca_coll_hcoll_scatterv(const void* sbuf, const int *scounts, const int *displs,
 401                             struct ompi_datatype_t *sdtype,
 402                             void* rbuf, int rcount,
 403                             struct ompi_datatype_t *rdtype,
 404                             int root,
 405                             struct ompi_communicator_t *comm,
 406                             mca_coll_base_module_t *module)
 407 {
 408     dte_data_representation_t stype;
 409     dte_data_representation_t rtype;
 410     int rc;
 411     HCOL_VERBOSE(20,"RUNNING HCOL SCATTERV");
 412     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 413     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 414     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 415     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 416         /*If we are here then datatype is not simple predefined datatype */
 417         /*In future we need to add more complex mapping to the dte_data_representation_t */
 418         /* Now use fallback */
 419         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback scatterv;",
 420                      sdtype->super.name,
 421                      rdtype->super.name);
 422         rc = hcoll_module->previous_scatterv(sbuf, scounts, displs, sdtype,
 423                                            rbuf, rcount, rdtype, root,
 424                                            comm, hcoll_module->previous_scatterv_module);
 425         return rc;
 426     }
 427     rc = hcoll_collectives.coll_scatterv((void *)sbuf, (int *)scounts, (int *)displs, stype, rbuf, rcount, rtype, root, hcoll_module->hcoll_context);
 428     if (HCOLL_SUCCESS != rc){
 429         HCOL_VERBOSE(20,"RUNNING FALLBACK SCATTERV");
 430         rc = hcoll_module->previous_scatterv(sbuf, scounts, displs, sdtype,
 431                                            rbuf, rcount, rdtype, root,
 432                                            comm, hcoll_module->previous_scatterv_module);
 433     }
 434     return rc;
 435 }
 436 
 437 int mca_coll_hcoll_ibarrier(struct ompi_communicator_t *comm,
 438                             ompi_request_t ** request,
 439                             mca_coll_base_module_t *module)
 440 {
 441     int rc;
 442     void** rt_handle;
 443     HCOL_VERBOSE(20,"RUNNING HCOL NON-BLOCKING BARRIER");
 444     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 445     rt_handle = (void**) request;
 446     rc = hcoll_collectives.coll_ibarrier(hcoll_module->hcoll_context, rt_handle);
 447     if (HCOLL_SUCCESS != rc){
 448         HCOL_VERBOSE(20,"RUNNING FALLBACK NON-BLOCKING BARRIER");
 449         rc = hcoll_module->previous_ibarrier(comm, request, hcoll_module->previous_ibarrier_module);
 450     }
 451     return rc;
 452 }
 453 
 454 int mca_coll_hcoll_ibcast(void *buff, int count,
 455                         struct ompi_datatype_t *datatype, int root,
 456                         struct ompi_communicator_t *comm,
 457                         ompi_request_t ** request,
 458                         mca_coll_base_module_t *module)
 459 {
 460     dte_data_representation_t dtype;
 461     int rc;
 462     void** rt_handle;
 463     HCOL_VERBOSE(20,"RUNNING HCOL NON-BLOCKING BCAST");
 464     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 465     rt_handle = (void**) request;
 466     dtype = ompi_dtype_2_hcoll_dtype(datatype, TRY_FIND_DERIVED);
 467     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(dtype))){
 468         /*If we are here then datatype is not simple predefined datatype */
 469         /*In future we need to add more complex mapping to the dte_data_representation_t */
 470         /* Now use fallback */
 471         HCOL_VERBOSE(20,"Ompi_datatype is not supported: %s; calling fallback non-blocking bcast;",datatype->super.name);
 472         rc = hcoll_module->previous_ibcast(buff,count,datatype,root,
 473                                          comm, request, hcoll_module->previous_ibcast_module);
 474         return rc;
 475     }
 476     rc = hcoll_collectives.coll_ibcast(buff, count, dtype, root, rt_handle, hcoll_module->hcoll_context);
 477     if (HCOLL_SUCCESS != rc){
 478         HCOL_VERBOSE(20,"RUNNING FALLBACK NON-BLOCKING BCAST");
 479         rc = hcoll_module->previous_ibcast(buff,count,datatype,root,
 480                                          comm, request, hcoll_module->previous_ibcast_module);
 481     }
 482     return rc;
 483 }
 484 
 485 int mca_coll_hcoll_iallgather(const void *sbuf, int scount,
 486                             struct ompi_datatype_t *sdtype,
 487                             void *rbuf, int rcount,
 488                             struct ompi_datatype_t *rdtype,
 489                             struct ompi_communicator_t *comm,
 490                             ompi_request_t ** request,
 491                             mca_coll_base_module_t *module)
 492 {
 493     dte_data_representation_t stype;
 494     dte_data_representation_t rtype;
 495     int rc;
 496     void** rt_handle;
 497     HCOL_VERBOSE(20,"RUNNING HCOL NON-BLOCKING ALLGATHER");
 498     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 499     rt_handle = (void**) request;
 500     stype = ompi_dtype_2_hcoll_dtype(sdtype, TRY_FIND_DERIVED);
 501     rtype = ompi_dtype_2_hcoll_dtype(rdtype, TRY_FIND_DERIVED);
 502     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 503         /*If we are here then datatype is not simple predefined datatype */
 504         /*In future we need to add more complex mapping to the dte_data_representation_t */
 505         /* Now use fallback */
 506         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback non-blocking allgather;",
 507                      sdtype->super.name,
 508                      rdtype->super.name);
 509         rc = hcoll_module->previous_iallgather(sbuf,scount,sdtype,
 510                                              rbuf,rcount,rdtype,
 511                                              comm,
 512                                              request,
 513                                              hcoll_module->previous_iallgather_module);
 514         return rc;
 515     }
 516     rc = hcoll_collectives.coll_iallgather((void *)sbuf, scount, stype, rbuf, rcount, rtype, hcoll_module->hcoll_context, rt_handle);
 517     if (HCOLL_SUCCESS != rc){
 518         HCOL_VERBOSE(20,"RUNNING FALLBACK NON-BLOCKING ALLGATHER");
 519         rc = hcoll_module->previous_iallgather(sbuf,scount,sdtype,
 520                                              rbuf,rcount,rdtype,
 521                                              comm,
 522                                              request,
 523                                              hcoll_module->previous_iallgather_module);
 524     }
 525     return rc;
 526 }
 527 #if HCOLL_API >= HCOLL_VERSION(3,5)
 528 int mca_coll_hcoll_iallgatherv(const void *sbuf, int scount,
 529                             struct ompi_datatype_t *sdtype,
 530                             void *rbuf, const int *rcount,
 531                             const int *displs,
 532                             struct ompi_datatype_t *rdtype,
 533                             struct ompi_communicator_t *comm,
 534                             ompi_request_t ** request,
 535                             mca_coll_base_module_t *module)
 536 {
 537     dte_data_representation_t stype;
 538     dte_data_representation_t rtype;
 539     int rc;
 540     HCOL_VERBOSE(20,"RUNNING HCOL NON-BLOCKING ALLGATHERV");
 541     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 542     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 543     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 544     void **rt_handle = (void **) request;
 545     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 546         /*If we are here then datatype is not simple predefined datatype */
 547         /*In future we need to add more complex mapping to the dte_data_representation_t */
 548         /* Now use fallback */
 549         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback non-blocking allgatherv;",
 550                      sdtype->super.name,
 551                      rdtype->super.name);
 552         rc = hcoll_module->previous_iallgatherv(sbuf,scount,sdtype,
 553                                              rbuf,rcount,
 554                                              displs, 
 555                                              rdtype,
 556                                              comm,
 557                                              request,
 558                                              hcoll_module->previous_iallgatherv_module);
 559         return rc;
 560     }
 561     rc = hcoll_collectives.coll_iallgatherv((void *)sbuf,scount,stype,rbuf,rcount,displs,rtype,
 562             hcoll_module->hcoll_context, rt_handle);
 563     if (HCOLL_SUCCESS != rc){
 564        HCOL_VERBOSE(20,"RUNNING FALLBACK NON-BLOCKING ALLGATHER");
 565         rc = hcoll_module->previous_iallgatherv(sbuf,scount,sdtype,
 566                                              rbuf,rcount,
 567                                              displs, 
 568                                              rdtype,
 569                                              comm,
 570                                              request,
 571                                              hcoll_module->previous_iallgatherv_module);
 572     }
 573     return rc;
 574 }
 575 #endif
 576 int mca_coll_hcoll_iallreduce(const void *sbuf, void *rbuf, int count,
 577                             struct ompi_datatype_t *dtype,
 578                             struct ompi_op_t *op,
 579                             struct ompi_communicator_t *comm,
 580                             ompi_request_t ** request,
 581                             mca_coll_base_module_t *module)
 582 {
 583     dte_data_representation_t Dtype;
 584     hcoll_dte_op_t *Op;
 585     int rc;
 586     void** rt_handle;
 587     HCOL_VERBOSE(20,"RUNNING HCOL NON-BLOCKING ALLREDUCE");
 588     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 589     rt_handle = (void**) request;
 590     Dtype = ompi_dtype_2_hcoll_dtype(dtype, NO_DERIVED);
 591     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(Dtype))){
 592         /*If we are here then datatype is not simple predefined datatype */
 593         /*In future we need to add more complex mapping to the dte_data_representation_t */
 594         /* Now use fallback */
 595         HCOL_VERBOSE(20,"Ompi_datatype is not supported: dtype = %s; calling fallback non-blocking allreduce;",
 596                      dtype->super.name);
 597         rc = hcoll_module->previous_iallreduce(sbuf,rbuf,
 598                                              count,dtype,op,
 599                                              comm, request, hcoll_module->previous_iallreduce_module);
 600         return rc;
 601     }
 602 
 603     Op = ompi_op_2_hcolrte_op(op);
 604     if (OPAL_UNLIKELY(HCOL_DTE_OP_NULL == Op->id)){
 605         /*If we are here then datatype is not simple predefined datatype */
 606         /*In future we need to add more complex mapping to the dte_data_representation_t */
 607         /* Now use fallback */
 608         HCOL_VERBOSE(20,"ompi_op_t is not supported: op = %s; calling fallback non-blocking allreduce;",
 609                      op->o_name);
 610         rc = hcoll_module->previous_iallreduce(sbuf,rbuf,
 611                                              count,dtype,op,
 612                                              comm, request, hcoll_module->previous_iallreduce_module);
 613         return rc;
 614     }
 615 
 616     rc = hcoll_collectives.coll_iallreduce((void *)sbuf, rbuf, count, Dtype, Op, hcoll_module->hcoll_context, rt_handle);
 617     if (HCOLL_SUCCESS != rc){
 618         HCOL_VERBOSE(20,"RUNNING FALLBACK NON-BLOCKING ALLREDUCE");
 619         rc = hcoll_module->previous_iallreduce(sbuf,rbuf,
 620                                              count,dtype,op,
 621                                              comm, request, hcoll_module->previous_iallreduce_module);
 622     }
 623     return rc;
 624 }
 625 #if HCOLL_API >= HCOLL_VERSION(3,5)
 626 int mca_coll_hcoll_ireduce(const void *sbuf, void *rbuf, int count,
 627                             struct ompi_datatype_t *dtype,
 628                             struct ompi_op_t *op,
 629                             int root,
 630                             struct ompi_communicator_t *comm,
 631                             ompi_request_t ** request,
 632                             mca_coll_base_module_t *module)
 633 {
 634     dte_data_representation_t Dtype;
 635     hcoll_dte_op_t *Op;
 636     int rc;
 637     HCOL_VERBOSE(20,"RUNNING HCOL NON-BLOCKING REDUCE");
 638     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 639     Dtype = ompi_dtype_2_hcoll_dtype(dtype, NO_DERIVED);
 640     void **rt_handle = (void**) request;
 641     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(Dtype))){
 642         /*If we are here then datatype is not simple predefined datatype */
 643         /*In future we need to add more complex mapping to the dte_data_representation_t */
 644         /* Now use fallback */
 645         HCOL_VERBOSE(20,"Ompi_datatype is not supported: dtype = %s; calling fallback non-blocking reduce;",
 646                      dtype->super.name);
 647         rc = hcoll_module->previous_ireduce(sbuf,rbuf,count,dtype,op,
 648                                              root,
 649                                              comm, request, 
 650                                              hcoll_module->previous_ireduce_module);
 651         return rc;
 652     }
 653 
 654     Op = ompi_op_2_hcolrte_op(op);
 655     if (OPAL_UNLIKELY(HCOL_DTE_OP_NULL == Op->id)){
 656         /*If we are here then datatype is not simple predefined datatype */
 657         /*In future we need to add more complex mapping to the dte_data_representation_t */
 658         /* Now use fallback */
 659         HCOL_VERBOSE(20,"ompi_op_t is not supported: op = %s; calling fallback non-blocking reduce;",
 660                      op->o_name);
 661         rc = hcoll_module->previous_ireduce(sbuf,rbuf,
 662                                              count,dtype,op,
 663                                              root,
 664                                              comm, request,
 665                                              hcoll_module->previous_ireduce_module);
 666         return rc;
 667     }
 668 
 669     rc = hcoll_collectives.coll_ireduce((void *)sbuf,rbuf,count,Dtype,Op,root,hcoll_module->hcoll_context,rt_handle);
 670     if (HCOLL_SUCCESS != rc){
 671         HCOL_VERBOSE(20,"RUNNING FALLBACK NON-BLOCKING REDUCE");
 672         rc = hcoll_module->previous_ireduce(sbuf,rbuf,
 673                                              count,dtype,op,
 674                                              root,
 675                                              comm, 
 676                                              request,
 677                                              hcoll_module->previous_ireduce_module);
 678     }
 679     return rc;
 680 }
 681 #endif
 682 int mca_coll_hcoll_igatherv(const void* sbuf, int scount,
 683                             struct ompi_datatype_t *sdtype,
 684                             void* rbuf, const int *rcounts, const int *displs,
 685                             struct ompi_datatype_t *rdtype,
 686                             int root,
 687                             struct ompi_communicator_t *comm,
 688                             ompi_request_t ** request,
 689                             mca_coll_base_module_t *module)
 690 {
 691     dte_data_representation_t stype;
 692     dte_data_representation_t rtype;
 693     int rc;
 694     void** rt_handle;
 695     HCOL_VERBOSE(20,"RUNNING HCOL IGATHERV");
 696     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 697     rt_handle = (void**) request;
 698     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 699     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 700     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 701         /*If we are here then datatype is not simple predefined datatype */
 702         /*In future we need to add more complex mapping to the dte_data_representation_t */
 703         /* Now use fallback */
 704         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback igatherv;",
 705                      sdtype->super.name,
 706                      rdtype->super.name);
 707         rc = hcoll_module->previous_igatherv(sbuf,scount,sdtype,
 708                                            rbuf, rcounts, displs, rdtype,root,
 709                                            comm, request,
 710                                            hcoll_module->previous_igatherv_module);
 711         return rc;
 712     }
 713     rc = hcoll_collectives.coll_igatherv((void *)sbuf, scount, stype, rbuf, (int *)rcounts, (int *)displs, rtype, root, hcoll_module->hcoll_context, rt_handle);
 714     if (HCOLL_SUCCESS != rc){
 715         HCOL_VERBOSE(20,"RUNNING FALLBACK IGATHERV");
 716         rc = hcoll_module->previous_igatherv(sbuf,scount,sdtype,
 717                                            rbuf, rcounts, displs, rdtype,root,
 718                                            comm, request,
 719                                            hcoll_module->previous_igatherv_module);
 720     }
 721     return rc;
 722 
 723 }
 724 
 725 
 726 #if HCOLL_API >= HCOLL_VERSION(3,7)
 727 int mca_coll_hcoll_ialltoallv(const void *sbuf, int *scounts, int *sdisps,
 728                               struct ompi_datatype_t *sdtype,
 729                               void *rbuf, int *rcounts, int *rdisps,
 730                               struct ompi_datatype_t *rdtype,
 731                               struct ompi_communicator_t *comm,
 732                               ompi_request_t ** request,
 733                               mca_coll_base_module_t *module)
 734 {
 735     dte_data_representation_t stype;
 736     dte_data_representation_t rtype;
 737     int rc;
 738     HCOL_VERBOSE(20,"RUNNING HCOL IALLTOALLV");
 739     mca_coll_hcoll_module_t *hcoll_module = (mca_coll_hcoll_module_t*)module;
 740     stype = ompi_dtype_2_hcoll_dtype(sdtype, NO_DERIVED);
 741     rtype = ompi_dtype_2_hcoll_dtype(rdtype, NO_DERIVED);
 742     if (OPAL_UNLIKELY(HCOL_DTE_IS_ZERO(stype) || HCOL_DTE_IS_ZERO(rtype))) {
 743         HCOL_VERBOSE(20,"Ompi_datatype is not supported: sdtype = %s, rdtype = %s; calling fallback ialltoallv;",
 744                      sdtype->super.name,
 745                      rdtype->super.name);
 746         rc = hcoll_module->previous_ialltoallv(sbuf, scounts, sdisps, sdtype,
 747                                                rbuf, rcounts, rdisps, rdtype,
 748                                                comm, request, hcoll_module->previous_alltoallv_module);
 749         return rc;
 750     }
 751     rc = hcoll_collectives.coll_ialltoallv((void *)sbuf, (int *)scounts, (int *)sdisps, stype,
 752                                            rbuf, (int *)rcounts, (int *)rdisps, rtype,
 753                                            hcoll_module->hcoll_context, (void**)request);
 754     if (HCOLL_SUCCESS != rc){
 755         HCOL_VERBOSE(20,"RUNNING FALLBACK IALLTOALLV");
 756         rc = hcoll_module->previous_ialltoallv(sbuf, scounts, sdisps, sdtype,
 757                                                rbuf, rcounts, rdisps, rdtype,
 758                                                comm, request, hcoll_module->previous_alltoallv_module);
 759     }
 760     return rc;
 761 }
 762 #endif

/* [<][>][^][v][top][bottom][index][help] */