root/oshmem/mca/spml/base/spml_base_putreq.h

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

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2013      Mellanox Technologies, Inc.
   3  *                         All rights reserved.
   4  * $COPYRIGHT$
   5  *
   6  * Additional copyrights may follow
   7  *
   8  * $HEADER$
   9  */
  10 /**
  11  * @file
  12  */
  13 #ifndef MCA_SPML_BASE_PUT_REQUEST_H
  14 #define MCA_SPML_BASE_PUT_REQUEST_H
  15 
  16 #include "oshmem_config.h"
  17 #include "oshmem/mca/spml/spml.h"
  18 #include "oshmem/mca/spml/base/spml_base_request.h"
  19 #include "ompi/peruse/peruse-internal.h"
  20 
  21 BEGIN_C_DECLS
  22 
  23 /**
  24  * Base type for send requests
  25  */
  26 struct mca_spml_base_put_request_t {
  27     mca_spml_base_request_t req_base; /**< base request type - common data structure for use by wait/test */
  28     void *req_addr; /**< pointer to send buffer - may not be application buffer */
  29     size_t req_bytes_packed; /**< packed size of a message given the datatype and count */
  30 };
  31 typedef struct mca_spml_base_put_request_t mca_spml_base_put_request_t;
  32 
  33 OSHMEM_DECLSPEC OBJ_CLASS_DECLARATION( mca_spml_base_put_request_t);
  34 
  35 /**
  36  * Initialize a send request with call parameters.
  37  *
  38  * @param request (IN)         Send request
  39  * @param addr (IN)            User buffer
  40  * @param count (IN)           Number of bytes.
  41  * @param peer (IN)            Destination rank
  42  * @param comm (IN)            Communicator
  43  * @param mode (IN)            Send mode (STANDARD,BUFFERED,SYNCHRONOUS,READY)
  44  * @param persistent (IN)      Is request persistent.
  45  * @param convertor_flags (IN) Flags to pass to convertor
  46  *
  47  * Perform a any one-time initialization. Note that per-use initialization
  48  * is done in the send request start routine.
  49  */
  50 
  51 #define MCA_SPML_BASE_PUT_REQUEST_INIT( request,                          \
  52                                         addr,                             \
  53                                         count,                            \
  54                                         peer,                             \
  55                                         persistent)                  \
  56    {                                                                      \
  57       OSHMEM_REQUEST_INIT(&(request)->req_base.req_oshmem, persistent);       \
  58       (request)->req_addr = addr;                                         \
  59       (request)->req_base.req_addr = addr;                                \
  60       (request)->req_base.req_count = count;                              \
  61       (request)->req_base.req_peer = (int32_t)peer;                       \
  62       (request)->req_base.req_spml_complete = OPAL_INT_TO_BOOL(persistent); \
  63       (request)->req_base.req_free_called = false;                        \
  64       (request)->req_base.req_oshmem.req_status._cancelled = 0;             \
  65       (request)->req_bytes_packed = 0;                                    \
  66                                                                           \
  67    }
  68 
  69 /**
  70  * Mark the request as started from the SPML base point of view.
  71  *
  72  *  @param request (IN)    The put request.
  73  */
  74 
  75 #define MCA_SPML_BASE_PUT_START( request )                    \
  76     do {                                                      \
  77         (request)->req_spml_complete = false;                  \
  78         (request)->req_oshmem.req_complete = false;             \
  79         (request)->req_oshmem.req_state = OSHMEM_REQUEST_ACTIVE;  \
  80         (request)->req_oshmem.req_status._cancelled = 0;        \
  81     } while (0)
  82 
  83 /**
  84  *  Release the ref counts on the communicator and datatype.
  85  *
  86  *  @param request (IN)    The put request.
  87  */
  88 
  89 #define MCA_SPML_BASE_PUT_REQUEST_FINI( request )                         \
  90     do {                                                                  \
  91         OSHMEM_REQUEST_FINI(&(request)->req_base.req_oshmem);                 \
  92         opal_convertor_cleanup( &((request)->req_base.req_convertor) );   \
  93     } while (0)
  94 
  95 END_C_DECLS
  96 
  97 #endif
  98 

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