This source file includes following definitions.
- mca_coll_monitoring_allgather
- mca_coll_monitoring_iallgather
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   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_allgather(const void *sbuf, int scount,
  17                                   struct ompi_datatype_t *sdtype,
  18                                   void *rbuf, int rcount,
  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;
  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     data_size = scount * type_size;
  30     mca_common_monitoring_coll_a2a(data_size * (comm_size - 1), monitoring_module->data);
  31     for( i = 0; i < comm_size; ++i ) {
  32         if( i == my_rank ) continue; 
  33         
  34 
  35 
  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         }
  40     }
  41     return monitoring_module->real.coll_allgather(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm, monitoring_module->real.coll_allgather_module);
  42 }
  43 
  44 int mca_coll_monitoring_iallgather(const void *sbuf, int scount,
  45                                    struct ompi_datatype_t *sdtype,
  46                                    void *rbuf, int rcount,
  47                                    struct ompi_datatype_t *rdtype,
  48                                    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     size_t type_size, data_size;
  54     const int comm_size = ompi_comm_size(comm);
  55     const int my_rank = ompi_comm_rank(comm);
  56     int i, rank;
  57     ompi_datatype_type_size(sdtype, &type_size);
  58     data_size = scount * type_size;
  59     mca_common_monitoring_coll_a2a(data_size * (comm_size - 1), monitoring_module->data);
  60     for( i = 0; i < comm_size; ++i ) {
  61         if( my_rank == i ) continue; 
  62         
  63 
  64 
  65 
  66         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  67             mca_common_monitoring_record_coll(rank, data_size);
  68         }
  69     }
  70     return monitoring_module->real.coll_iallgather(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm, request, monitoring_module->real.coll_iallgather_module);
  71 }