This source file includes following definitions.
- mca_coll_monitoring_alltoall
- mca_coll_monitoring_ialltoall
   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_alltoall(const void *sbuf, int scount, struct ompi_datatype_t *sdtype,
  17                                  void* rbuf, int rcount, struct ompi_datatype_t *rdtype,
  18                                  struct ompi_communicator_t *comm,
  19                                  mca_coll_base_module_t *module)
  20 {
  21     mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
  22     size_t type_size, data_size;
  23     const int comm_size = ompi_comm_size(comm);
  24     const int my_rank = ompi_comm_rank(comm);
  25     int i, rank;
  26     ompi_datatype_type_size(sdtype, &type_size);
  27     data_size = scount * type_size;
  28     mca_common_monitoring_coll_a2a(data_size * (comm_size - 1), monitoring_module->data);
  29     for( i = 0; i < comm_size; ++i ) {
  30         if( my_rank == i ) continue; 
  31         
  32 
  33 
  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         }
  38     }
  39     return monitoring_module->real.coll_alltoall(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm, monitoring_module->real.coll_alltoall_module);
  40 }
  41 
  42 int mca_coll_monitoring_ialltoall(const void *sbuf, int scount,
  43                                   struct ompi_datatype_t *sdtype,
  44                                   void *rbuf, int rcount,
  45                                   struct ompi_datatype_t *rdtype,
  46                                   struct ompi_communicator_t *comm,
  47                                   ompi_request_t ** request,
  48                                   mca_coll_base_module_t *module)
  49 {
  50     mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
  51     size_t type_size, data_size;
  52     const int comm_size = ompi_comm_size(comm);
  53     const int my_rank = ompi_comm_rank(comm);
  54     int i, rank;
  55     ompi_datatype_type_size(sdtype, &type_size);
  56     data_size = scount * type_size;
  57     mca_common_monitoring_coll_a2a(data_size * (comm_size - 1), monitoring_module->data);
  58     for( i = 0; i < comm_size; ++i ) {
  59         if( my_rank == i ) continue; 
  60         
  61 
  62 
  63 
  64         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  65             mca_common_monitoring_record_coll(rank, data_size);
  66         }
  67     }
  68     return monitoring_module->real.coll_ialltoall(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm, request, monitoring_module->real.coll_ialltoall_module);
  69 }