root/ompi/mca/coll/monitoring/coll_monitoring_alltoallv.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_coll_monitoring_alltoallv
  2. mca_coll_monitoring_ialltoallv

   1 /*
   2  * Copyright (c) 2016-2018 Inria. All rights reserved.
   3  * $COPYRIGHT$
   4  *
   5  * Additional copyrights may follow
   6  *
   7  * $HEADER$
   8  */
   9 
  10 #include <ompi_config.h>
  11 #include <ompi/request/request.h>
  12 #include <ompi/datatype/ompi_datatype.h>
  13 #include <ompi/communicator/communicator.h>
  14 #include "coll_monitoring.h"
  15 
  16 int mca_coll_monitoring_alltoallv(const void *sbuf, const int *scounts, const int *sdisps,
  17                                   struct ompi_datatype_t *sdtype,
  18                                   void *rbuf, const int *rcounts, const int *rdisps,
  19                                   struct ompi_datatype_t *rdtype,
  20                                   struct ompi_communicator_t *comm,
  21                                   mca_coll_base_module_t *module)
  22 {
  23     mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
  24     size_t type_size, data_size, data_size_aggreg = 0;
  25     const int comm_size = ompi_comm_size(comm);
  26     const int my_rank = ompi_comm_rank(comm);
  27     int i, rank;
  28     ompi_datatype_type_size(sdtype, &type_size);
  29     for( i = 0; i < comm_size; ++i ) {
  30         if( my_rank == i ) continue; /* No communication for self */
  31         data_size = scounts[i] * type_size;
  32         /**
  33          * If this fails the destination is not part of my MPI_COM_WORLD
  34          * Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
  35          */
  36         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  37             mca_common_monitoring_record_coll(rank, data_size);
  38             data_size_aggreg += data_size;
  39         }
  40     }
  41     mca_common_monitoring_coll_a2a(data_size_aggreg, monitoring_module->data);
  42     return monitoring_module->real.coll_alltoallv(sbuf, scounts, sdisps, sdtype, rbuf, rcounts, rdisps, rdtype, comm, monitoring_module->real.coll_alltoallv_module);
  43 }
  44 
  45 int mca_coll_monitoring_ialltoallv(const void *sbuf, const int *scounts,
  46                                    const int *sdisps,
  47                                    struct ompi_datatype_t *sdtype,
  48                                    void *rbuf, const int *rcounts,
  49                                    const int *rdisps,
  50                                    struct ompi_datatype_t *rdtype,
  51                                    struct ompi_communicator_t *comm,
  52                                    ompi_request_t ** request,
  53                                    mca_coll_base_module_t *module)
  54 {
  55     mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
  56     size_t type_size, data_size, data_size_aggreg = 0;
  57     const int comm_size = ompi_comm_size(comm);
  58     const int my_rank = ompi_comm_rank(comm);
  59     int i, rank;
  60     ompi_datatype_type_size(sdtype, &type_size);
  61     for( i = 0; i < comm_size; ++i ) {
  62         if( my_rank == i ) continue; /* No communication for self */
  63         data_size = scounts[i] * type_size;
  64         /**
  65          * If this fails the destination is not part of my MPI_COM_WORLD
  66          * Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
  67          */
  68         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  69             mca_common_monitoring_record_coll(rank, data_size);
  70             data_size_aggreg += data_size;
  71         }
  72     }
  73     mca_common_monitoring_coll_a2a(data_size_aggreg, monitoring_module->data);
  74     return monitoring_module->real.coll_ialltoallv(sbuf, scounts, sdisps, sdtype, rbuf, rcounts, rdisps, rdtype, comm, request, monitoring_module->real.coll_ialltoallv_module);
  75 }

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