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

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

DEFINITIONS

This source file includes following definitions.
  1. mca_coll_monitoring_scatterv
  2. mca_coll_monitoring_iscatterv

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

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