root/ompi/mca/pml/monitoring/pml_monitoring_isend.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_pml_monitoring_isend_init
  2. mca_pml_monitoring_isend
  3. mca_pml_monitoring_send

   1 /*
   2  * Copyright (c) 2013-2015 The University of Tennessee and The University
   3  *                         of Tennessee Research Foundation.  All rights
   4  *                         reserved.
   5  * Copyright (c) 2013-2018 Inria.  All rights reserved.
   6  * $COPYRIGHT$
   7  *
   8  * Additional copyrights may follow
   9  *
  10  * $HEADER$
  11  */
  12 
  13 #include <ompi_config.h>
  14 #include "pml_monitoring.h"
  15 
  16 int mca_pml_monitoring_isend_init(const void *buf,
  17                                   size_t count,
  18                                   ompi_datatype_t *datatype,
  19                                   int dst,
  20                                   int tag,
  21                                   mca_pml_base_send_mode_t mode,
  22                                   struct ompi_communicator_t* comm,
  23                                   struct ompi_request_t **request)
  24 {
  25     return pml_selected_module.pml_isend_init(buf, count, datatype,
  26                                               dst, tag, mode, comm, request);
  27 }
  28 
  29 int mca_pml_monitoring_isend(const void *buf,
  30                              size_t count,
  31                              ompi_datatype_t *datatype,
  32                              int dst,
  33                              int tag,
  34                              mca_pml_base_send_mode_t mode,
  35                              struct ompi_communicator_t* comm,
  36                              struct ompi_request_t **request)
  37 {
  38     int world_rank;
  39     /**
  40      * If this fails the destination is not part of my MPI_COM_WORLD
  41      * Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
  42      */
  43     if(OPAL_SUCCESS == mca_common_monitoring_get_world_rank(dst, comm->c_remote_group, &world_rank)) {
  44         size_t type_size, data_size;
  45         ompi_datatype_type_size(datatype, &type_size);
  46         data_size = count*type_size;
  47         mca_common_monitoring_record_pml(world_rank, data_size, tag);
  48     }
  49 
  50     return pml_selected_module.pml_isend(buf, count, datatype,
  51                                          dst, tag, mode, comm, request);
  52 }
  53 
  54 int mca_pml_monitoring_send(const void *buf,
  55                             size_t count,
  56                             ompi_datatype_t *datatype,
  57                             int dst,
  58                             int tag,
  59                             mca_pml_base_send_mode_t mode,
  60                             struct ompi_communicator_t* comm)
  61 {
  62     int world_rank;
  63     /* Are we sending to a peer from my own MPI_COMM_WORLD? */
  64     if(OPAL_SUCCESS == mca_common_monitoring_get_world_rank(dst, comm->c_remote_group, &world_rank)) {
  65         size_t type_size, data_size;
  66         ompi_datatype_type_size(datatype, &type_size);
  67         data_size = count*type_size;
  68         mca_common_monitoring_record_pml(world_rank, data_size, tag);
  69     }
  70 
  71     return pml_selected_module.pml_send(buf, count, datatype,
  72                                         dst, tag, mode, comm);
  73 }

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