opal/mca/btl/ugni/btl_ugni_get.c
/**
 * Initiate a get operation.
 *
 * @param btl (IN)         BTL module
 * @param endpoint (IN)    BTL addressing information
 * @param descriptor (IN)  Description of the data to be transferred
 */
Initiate a get operation.
@param btl (IN)         BTL module
@param endpoint (IN)    BTL addressing information
@param descriptor (IN)  Description of the data to be transferred
Initiate a get operation . @param btl ( IN ) BTL module @param endpoint ( IN ) BTL addressing information @param descriptor ( IN ) Description of the data to be transferred
int mca_btl_ugni_get (struct mca_btl_base_module_t *btl,
                      struct mca_btl_base_endpoint_t *endpoint,
                      struct mca_btl_base_descriptor_t *des) {
    mca_btl_ugni_base_frag_t *frag = (mca_btl_ugni_base_frag_t *) des;
    mca_btl_ugni_segment_t *src_seg = (mca_btl_ugni_segment_t *) des->des_remote;
    mca_btl_ugni_segment_t *dst_seg = (mca_btl_ugni_segment_t *) des->des_local;
    size_t size = src_seg->base.seg_len - src_seg->extra_byte_count;
    bool check;
    BTL_VERBOSE(("Using RDMA/FMA Get"));
    (void) mca_btl_ugni_check_endpoint_state(endpoint);
    check = !!((des->des_remote->seg_addr.lval | des->des_local->seg_addr.lval | size) & 3);
    if (OPAL_UNLIKELY(check || size > mca_btl_ugni_component.ugni_get_limit)) {
        return OPAL_ERR_NOT_AVAILABLE;
    }
    if (src_seg->extra_byte_count) {
        memmove ((char *) dst_seg->base.seg_addr.pval + size, src_seg->extra_bytes, src_seg->extra_byte_count);
        src_seg->base.seg_len = size;
        dst_seg->base.seg_len = size;
    }
    des->des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK;
    return mca_btl_ugni_post (frag, true, dst_seg, src_seg);
}
int mca_btl_ugni_get ( struct mca_btl_base_module_t * btl , struct mca_btl_base_endpoint_t * endpoint , struct mca_btl_base_descriptor_t * des ) { mca_btl_ugni_base_frag_t * frag = ( mca_btl_ugni_base_frag_t * ) des ; mca_btl_ugni_segment_t * src_seg = ( mca_btl_ugni_segment_t * ) des -> des_remote ; mca_btl_ugni_segment_t * dst_seg = ( mca_btl_ugni_segment_t * ) des -> des_local ; size_t size = src_seg -> base . seg_len - src_seg -> extra_byte_count ; bool check ; BTL_VERBOSE ( ( " " ) ) ; ( void ) mca_btl_ugni_check_endpoint_state ( endpoint ) ; check = ! ! ( ( des -> des_remote -> seg_addr . lval | des -> des_local -> seg_addr . lval | size ) & 3 ) ; if ( OPAL_UNLIKELY ( check || size > mca_btl_ugni_component . ugni_get_limit ) ) { return OPAL_ERR_NOT_AVAILABLE ; } if ( src_seg -> extra_byte_count ) { memmove ( ( char * ) dst_seg -> base . seg_addr . pval + size , src_seg -> extra_bytes , src_seg -> extra_byte_count ) ; src_seg -> base . seg_len = size ; dst_seg -> base . seg_len = size ; } des -> des_flags |= MCA_BTL_DES_SEND_ALWAYS_CALLBACK ; return mca_btl_ugni_post ( frag , true , dst_seg , src_seg ) ; }
Initiate a get operation.
Initiate a get operation .
/* cause endpoint to bind if it isn't already (bind is sufficient for rdma) */ /* Check if the get is aligned/sized on a multiple of 4 */ /* switch to put */