root/ompi/mca/pml/yalla/pml_yalla_datatype.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. mca_pml_yalla_convertor_free

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (C) Mellanox Technologies Ltd. 2001-2011.  ALL RIGHTS RESERVED.
   4  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   5  *                         reserved.
   6  * Copyright (c) 2017      IBM Corporation.  All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #ifndef PML_YALLA_DATATYPE_H_
  15 #define PML_YALLA_DATATYPE_H_
  16 
  17 #include "pml_yalla.h"
  18 
  19 struct pml_yalla_convertor {
  20     opal_free_list_item_t     super;
  21     ompi_datatype_t           *datatype;
  22     opal_convertor_t          convertor;
  23 };
  24 
  25 OBJ_CLASS_DECLARATION(mca_pml_yalla_convertor_t);
  26 
  27 #define PML_YALLA_INIT_MXM_REQ_DATA(_req_base, _buf, _count, _dtype, _stream_type, ...) \
  28     { \
  29         ptrdiff_t span, gap; \
  30         \
  31         if (opal_datatype_is_contiguous_memory_layout(&(_dtype)->super, _count)) { \
  32             span = opal_datatype_span(&(_dtype)->super, (_count), &gap); \
  33             (_req_base)->data_type          = MXM_REQ_DATA_BUFFER; \
  34             (_req_base)->data.buffer.ptr    = (char *)_buf + gap; \
  35             (_req_base)->data.buffer.length = span; \
  36         } else { \
  37             mca_pml_yalla_set_noncontig_data_ ## _stream_type(_req_base, \
  38                                                               _buf, _count, \
  39                                                               _dtype, ## __VA_ARGS__); \
  40         } \
  41     }
  42 
  43 #define PML_YALLA_RESET_PML_REQ_DATA(_pml_req) \
  44     { \
  45         if ((_pml_req)->convertor != NULL) { \
  46             size_t _position = 0; \
  47             opal_convertor_set_position(&(_pml_req)->convertor->convertor, &_position); \
  48         } \
  49     }
  50 
  51 
  52 static inline void mca_pml_yalla_convertor_free(mca_pml_yalla_convertor_t *convertor)
  53 {
  54     opal_convertor_cleanup(&convertor->convertor);
  55     OMPI_DATATYPE_RELEASE(convertor->datatype);
  56     PML_YALLA_FREELIST_RETURN(&ompi_pml_yalla.convs, &convertor->super);
  57 }
  58 
  59 void mca_pml_yalla_set_noncontig_data_irecv(mxm_req_base_t *mxm_req, void *buf,
  60                                             size_t count, ompi_datatype_t *datatype,
  61                                             mca_pml_yalla_recv_request_t *rreq);
  62 
  63 void mca_pml_yalla_set_noncontig_data_recv(mxm_req_base_t *mxm_req, void *buf,
  64                                            size_t count, ompi_datatype_t *datatype);
  65 
  66 void mca_pml_yalla_set_noncontig_data_isend(mxm_req_base_t *mxm_req, void *buf,
  67                                             size_t count, ompi_datatype_t *datatype,
  68                                             mca_pml_yalla_send_request_t *sreq);
  69 
  70 void mca_pml_yalla_set_noncontig_data_send(mxm_req_base_t *mxm_req, void *buf,
  71                                            size_t count, ompi_datatype_t *datatype);
  72 
  73 void mca_pml_yalla_init_datatype(void);
  74 
  75 
  76 #endif /* PML_YALLA_DATATYPE_H_ */

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