2005-11-12 17:04:46 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2008-03-09 16:17:13 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2005-11-12 17:04:46 +03:00
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
2008-03-09 16:17:13 +03:00
|
|
|
*
|
2005-11-12 17:04:46 +03:00
|
|
|
* Additional copyrights may follow
|
2008-03-09 16:17:13 +03:00
|
|
|
*
|
2005-11-12 17:04:46 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
2005-06-30 09:50:55 +04:00
|
|
|
#include "btl_sm_frag.h"
|
|
|
|
|
|
|
|
|
2007-03-05 17:17:50 +03:00
|
|
|
static inline void mca_btl_sm_frag_common_constructor(mca_btl_sm_frag_t* frag)
|
2005-06-30 09:50:55 +04:00
|
|
|
{
|
2007-03-05 17:24:09 +03:00
|
|
|
frag->hdr = (mca_btl_sm_hdr_t*)frag->base.super.ptr;
|
|
|
|
if(frag->hdr != NULL) {
|
|
|
|
frag->hdr->frag = (mca_btl_sm_frag_t*)((uintptr_t)frag |
|
|
|
|
MCA_BTL_SM_FRAG_ACK);
|
|
|
|
frag->segment.seg_addr.pval = ((char*)frag->hdr) +
|
|
|
|
sizeof(mca_btl_sm_hdr_t);
|
|
|
|
}
|
2006-05-16 20:48:43 +04:00
|
|
|
frag->segment.seg_len = frag->size;
|
2005-06-30 09:50:55 +04:00
|
|
|
frag->base.des_src = &frag->segment;
|
|
|
|
frag->base.des_src_cnt = 1;
|
2006-03-21 21:20:17 +03:00
|
|
|
frag->base.des_dst = &frag->segment;
|
|
|
|
frag->base.des_dst_cnt = 1;
|
2005-06-30 09:50:55 +04:00
|
|
|
frag->base.des_flags = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_sm_frag1_constructor(mca_btl_sm_frag_t* frag)
|
|
|
|
{
|
|
|
|
frag->size = mca_btl_sm_component.eager_limit;
|
2008-05-30 07:58:39 +04:00
|
|
|
frag->my_list = &mca_btl_sm_component.sm_frags_eager;
|
2007-03-05 17:17:50 +03:00
|
|
|
mca_btl_sm_frag_common_constructor(frag);
|
2005-06-30 09:50:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_sm_frag2_constructor(mca_btl_sm_frag_t* frag)
|
|
|
|
{
|
|
|
|
frag->size = mca_btl_sm_component.max_frag_size;
|
2008-05-30 07:58:39 +04:00
|
|
|
frag->my_list = &mca_btl_sm_component.sm_frags_max;
|
2007-03-05 17:17:50 +03:00
|
|
|
mca_btl_sm_frag_common_constructor(frag);
|
2005-06-30 09:50:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void mca_btl_sm_frag_destructor(mca_btl_sm_frag_t* frag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_btl_sm_frag1_t,
|
|
|
|
mca_btl_base_descriptor_t,
|
|
|
|
mca_btl_sm_frag1_constructor,
|
|
|
|
mca_btl_sm_frag_destructor);
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_btl_sm_frag2_t,
|
|
|
|
mca_btl_base_descriptor_t,
|
|
|
|
mca_btl_sm_frag2_constructor,
|
|
|
|
mca_btl_sm_frag_destructor);
|
|
|
|
|