root/opal/mca/btl/portals4/btl_portals4_send.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_btl_portals4_send
  2. mca_btl_portals4_sendi

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2005 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2008      UT-Battelle, LLC. All rights reserved.
  13  * Copyright (c) 2012      Los Alamos National Security, LLC.  All rights
  14  *                         reserved.
  15  * Copyright (c) 2013      Sandia National Laboratories.  All rights reserved.
  16  * Copyright (c) 2014      Bull SAS.  All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 #include "opal_config.h"
  25 #include "opal/constants.h"
  26 #include "opal/datatype/opal_convertor.h"
  27 
  28 #include "btl_portals4.h"
  29 
  30 int mca_btl_portals4_send(struct mca_btl_base_module_t* btl_base,
  31                      struct mca_btl_base_endpoint_t* endpoint,
  32                      struct mca_btl_base_descriptor_t* descriptor,
  33                      mca_btl_base_tag_t tag)
  34 {
  35     struct mca_btl_portals4_module_t* portals4_btl = (struct mca_btl_portals4_module_t*) btl_base;
  36     mca_btl_portals4_frag_t *frag = (mca_btl_portals4_frag_t*) descriptor;
  37     ptl_match_bits_t match_bits, msglen_type;
  38     ptl_size_t put_length;
  39     int ret;
  40 
  41     frag->endpoint = endpoint;
  42     frag->hdr.tag = tag;
  43 
  44     put_length       = frag->segments[0].base.seg_len;
  45     if (put_length > portals4_btl->super.btl_eager_limit)
  46          msglen_type = BTL_PORTALS4_LONG_MSG;
  47     else msglen_type = BTL_PORTALS4_SHORT_MSG;
  48 
  49     BTL_PORTALS4_SET_SEND_BITS(match_bits, 0, 0, tag, msglen_type);
  50 
  51     /* reserve space in the event queue for rdma operations immediately */
  52     while (OPAL_THREAD_ADD_FETCH32(&portals4_btl->portals_outstanding_ops, 1) >
  53            portals4_btl->portals_max_outstanding_ops) {
  54         OPAL_THREAD_ADD_FETCH32(&portals4_btl->portals_outstanding_ops, -1);
  55         OPAL_OUTPUT_VERBOSE((90, opal_btl_base_framework.framework_output,
  56                              "Call to mca_btl_portals4_component_progress (4)\n"));
  57         mca_btl_portals4_component_progress();
  58     }
  59     OPAL_OUTPUT_VERBOSE((90, opal_btl_base_framework.framework_output,
  60                          "mca_btl_portals4_send: Incrementing portals_outstanding_ops=%d\n",
  61         portals4_btl->portals_outstanding_ops));
  62 
  63     OPAL_OUTPUT_VERBOSE((50, opal_btl_base_framework.framework_output,
  64                          "PtlPut frag=%p rank=%x pid=%x tag=%x len=%ld match_bits=%lx\n",
  65                          (void*)frag,  endpoint->ptl_proc.rank, endpoint->ptl_proc.phys.pid, tag,
  66                          put_length, (uint64_t)match_bits));
  67 
  68     ret = PtlPut(portals4_btl->send_md_h,
  69                  (ptl_size_t) frag->segments[0].base.seg_addr.pval,
  70                  put_length, /* fragment length */
  71                  (mca_btl_portals4_component.portals_need_ack ? PTL_ACK_REQ : PTL_NO_ACK_REQ),
  72                  endpoint->ptl_proc,
  73                  portals4_btl->recv_idx,
  74                  match_bits,                     /* match bits */
  75                  0,                              /* remote offset - not used */
  76                  (void *) frag,                  /* user ptr */
  77                  tag);                           /* hdr_data: tag */
  78     if (ret != PTL_OK) {
  79         opal_output(opal_btl_base_framework.framework_output, "mca_btl_portals4_send: PtlPut failed with error %d", ret);
  80         return OPAL_ERROR;
  81     }
  82     OPAL_OUTPUT_VERBOSE((90, opal_btl_base_framework.framework_output,
  83             "PtlPut frag=%p rank=%x pid=%x tag=%x addr=%p len=%ld match_bits=%lx",
  84             (void*)frag,  endpoint->ptl_proc.rank, endpoint->ptl_proc.phys.pid, tag,
  85             (void *)frag->segments[0].base.seg_addr.pval, put_length, (uint64_t)match_bits));
  86 
  87     return OPAL_SUCCESS;
  88 }
  89 
  90 /* NOT IMPLEMENTED */
  91 int mca_btl_portals4_sendi(struct mca_btl_base_module_t* btl_base,
  92                           struct mca_btl_base_endpoint_t* endpoint,
  93                           struct opal_convertor_t* convertor,
  94                           void* header,
  95                           size_t header_size,
  96                           size_t payload_size,
  97                           uint8_t order,
  98                           uint32_t flags,
  99                           mca_btl_base_tag_t tag,
 100                           mca_btl_base_descriptor_t** des)
 101 {
 102     opal_output(opal_btl_base_framework.framework_output, "mca_btl_portals_sendi is not implemented");
 103     BTL_ERROR(("mca_btl_portals_sendi is not implemented"));
 104     return OPAL_SUCCESS;
 105 }

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