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

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

DEFINITIONS

This source file includes following definitions.
  1. mca_coll_monitoring_gatherv
  2. mca_coll_monitoring_igatherv

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

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