2011-11-02 19:07:57 +04:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2011-10-21 01:39:44 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2011 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2009 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2006-2007 Voltaire. All rights reserved.
|
|
|
|
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
|
2013-03-28 02:10:02 +04:00
|
|
|
* Copyright (c) 2010-2013 Los Alamos National Security, LLC.
|
2011-10-21 01:39:44 +04:00
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include "btl_vader.h"
|
|
|
|
#include "btl_vader_frag.h"
|
|
|
|
#include "btl_vader_fifo.h"
|
2011-10-28 00:22:46 +04:00
|
|
|
#include "btl_vader_fbox.h"
|
2011-10-21 01:39:44 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initiate a send to the peer.
|
|
|
|
*
|
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param peer (IN) BTL peer addressing
|
|
|
|
*/
|
|
|
|
int mca_btl_vader_send (struct mca_btl_base_module_t *btl,
|
2011-11-02 19:07:57 +04:00
|
|
|
struct mca_btl_base_endpoint_t *endpoint,
|
|
|
|
struct mca_btl_base_descriptor_t *descriptor,
|
|
|
|
mca_btl_base_tag_t tag)
|
2011-10-21 01:39:44 +04:00
|
|
|
{
|
|
|
|
mca_btl_vader_frag_t *frag = (mca_btl_vader_frag_t *) descriptor;
|
|
|
|
|
2013-07-12 00:54:12 +04:00
|
|
|
if (OPAL_LIKELY(frag->hdr->flags & MCA_BTL_VADER_FLAG_FBOX)) {
|
2012-12-14 03:18:53 +04:00
|
|
|
mca_btl_vader_fbox_send (frag->segments[0].seg_addr.pval, tag, frag->segments[0].seg_len);
|
2012-03-16 00:12:46 +04:00
|
|
|
mca_btl_vader_frag_complete (frag);
|
2011-10-28 00:22:46 +04:00
|
|
|
|
2011-11-02 19:07:57 +04:00
|
|
|
return 1;
|
2011-10-28 00:22:46 +04:00
|
|
|
}
|
|
|
|
|
2012-12-14 03:18:53 +04:00
|
|
|
/* header (+ optional inline data) */
|
|
|
|
frag->hdr->len = frag->segments[0].seg_len;
|
2011-10-21 01:39:44 +04:00
|
|
|
/* type of message, pt-2-pt, one-sided, etc */
|
|
|
|
frag->hdr->tag = tag;
|
|
|
|
|
|
|
|
/* post the relative address of the descriptor into the peer's fifo */
|
2013-03-28 02:10:02 +04:00
|
|
|
vader_fifo_write (frag->hdr, endpoint);
|
2011-10-21 01:39:44 +04:00
|
|
|
|
2013-07-12 00:54:12 +04:00
|
|
|
if ((frag->hdr->flags & MCA_BTL_VADER_FLAG_SINGLE_COPY) ||
|
2012-03-16 00:12:46 +04:00
|
|
|
!(frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP)) {
|
2011-11-02 19:07:57 +04:00
|
|
|
frag->base.des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK;
|
2012-03-16 00:12:46 +04:00
|
|
|
|
2011-11-02 19:07:57 +04:00
|
|
|
return 0;
|
2011-10-25 22:38:42 +04:00
|
|
|
}
|
|
|
|
|
2012-03-16 00:12:46 +04:00
|
|
|
/* data is gone (from the pml's perspective). frag callback/release will
|
|
|
|
happen later */
|
2011-10-21 01:39:44 +04:00
|
|
|
return 1;
|
|
|
|
}
|