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

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

DEFINITIONS

This source file includes following definitions.
  1. mca_coll_monitoring_alltoallw
  2. mca_coll_monitoring_ialltoallw

   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_alltoallw(const void *sbuf, const int *scounts,
  17                                   const int *sdisps,
  18                                   struct ompi_datatype_t * const *sdtypes,
  19                                   void *rbuf, const int *rcounts,
  20                                   const int *rdisps,
  21                                   struct ompi_datatype_t * const *rdtypes,
  22                                   struct ompi_communicator_t *comm,
  23                                   mca_coll_base_module_t *module)
  24 {
  25     mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
  26     size_t type_size, data_size, data_size_aggreg = 0;
  27     const int comm_size = ompi_comm_size(comm);
  28     const int my_rank = ompi_comm_rank(comm);
  29     int i, rank;
  30     for( i = 0; i < comm_size; ++i ) {
  31         if( my_rank == i ) continue; /* No communication for self */
  32         ompi_datatype_type_size(sdtypes[i], &type_size);
  33         data_size = scounts[i] * type_size;
  34         /**
  35          * If this fails the destination is not part of my MPI_COM_WORLD
  36          * Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
  37          */
  38         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  39             mca_common_monitoring_record_coll(rank, data_size);
  40             data_size_aggreg += data_size;
  41         }
  42     }
  43     mca_common_monitoring_coll_a2a(data_size_aggreg, monitoring_module->data);
  44     return monitoring_module->real.coll_alltoallw(sbuf, scounts, sdisps, sdtypes, rbuf, rcounts, rdisps, rdtypes, comm, monitoring_module->real.coll_alltoallw_module);
  45 }
  46 
  47 int mca_coll_monitoring_ialltoallw(const void *sbuf, const int *scounts,
  48                                    const int *sdisps,
  49                                    struct ompi_datatype_t * const *sdtypes,
  50                                    void *rbuf, const int *rcounts,
  51                                    const int *rdisps,
  52                                    struct ompi_datatype_t * const *rdtypes,
  53                                    struct ompi_communicator_t *comm,
  54                                    ompi_request_t ** request,
  55                                    mca_coll_base_module_t *module)
  56 {
  57     mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
  58     size_t type_size, data_size, data_size_aggreg = 0;
  59     const int comm_size = ompi_comm_size(comm);
  60     const int my_rank = ompi_comm_rank(comm);
  61     int i, rank;
  62     for( i = 0; i < comm_size; ++i ) {
  63         if( my_rank == i ) continue; /* No communication for self */
  64         ompi_datatype_type_size(sdtypes[i], &type_size);
  65         data_size = scounts[i] * type_size;
  66         /**
  67          * If this fails the destination is not part of my MPI_COM_WORLD
  68          * Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
  69          */
  70         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  71             mca_common_monitoring_record_coll(rank, data_size);
  72             data_size_aggreg += data_size;
  73         }
  74     }
  75     mca_common_monitoring_coll_a2a(data_size_aggreg, monitoring_module->data);
  76     return monitoring_module->real.coll_ialltoallw(sbuf, scounts, sdisps, sdtypes, rbuf, rcounts, rdisps, rdtypes, comm, request, monitoring_module->real.coll_ialltoallw_module);
  77 }

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