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

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

DEFINITIONS

This source file includes following definitions.
  1. mca_coll_monitoring_exscan
  2. mca_coll_monitoring_iexscan

   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/op/op.h>
  12 #include <ompi/request/request.h>
  13 #include <ompi/datatype/ompi_datatype.h>
  14 #include <ompi/communicator/communicator.h>
  15 #include "coll_monitoring.h"
  16 
  17 int mca_coll_monitoring_exscan(const void *sbuf, void *rbuf, int count,
  18                                struct ompi_datatype_t *dtype,
  19                                struct ompi_op_t *op,
  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(dtype, &type_size);
  29     data_size = count * type_size;
  30     mca_common_monitoring_coll_a2a(data_size * (comm_size - my_rank), monitoring_module->data);
  31     for( i = my_rank + 1; i < comm_size; ++i ) {
  32         /**
  33          * If this fails the destination is not part of my MPI_COM_WORLD
  34          * Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
  35          */
  36         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  37             mca_common_monitoring_record_coll(rank, data_size);
  38         }
  39     }
  40     return monitoring_module->real.coll_exscan(sbuf, rbuf, count, dtype, op, comm, monitoring_module->real.coll_exscan_module);
  41 }
  42 
  43 int mca_coll_monitoring_iexscan(const void *sbuf, void *rbuf, int count,
  44                                 struct ompi_datatype_t *dtype,
  45                                 struct ompi_op_t *op,
  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(dtype, &type_size);
  56     data_size = count * type_size;
  57     mca_common_monitoring_coll_a2a(data_size * (comm_size - my_rank), monitoring_module->data);
  58     for( i = my_rank + 1; i < comm_size; ++i ) {
  59         /**
  60          * If this fails the destination is not part of my MPI_COM_WORLD
  61          * Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
  62          */
  63         if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
  64             mca_common_monitoring_record_coll(rank, data_size);
  65         }
  66     }
  67     return monitoring_module->real.coll_iexscan(sbuf, rbuf, count, dtype, op, comm, request, monitoring_module->real.coll_iexscan_module);
  68 }

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