1
1

Update the sm BTL to fulfill the requirements for #1713.

This commit was SVN r20150.
Этот коммит содержится в:
George Bosilca 2008-12-17 22:14:59 +00:00
родитель 7cec018149
Коммит 341ee1389c
2 изменённых файлов: 10 добавлений и 12 удалений

Просмотреть файл

@ -618,17 +618,15 @@ extern mca_btl_base_descriptor_t* mca_btl_sm_alloc(
size_t size,
uint32_t flags)
{
mca_btl_sm_frag_t* frag;
mca_btl_sm_frag_t* frag = NULL;
int rc;
if(size <= mca_btl_sm_component.eager_limit) {
MCA_BTL_SM_FRAG_ALLOC1(frag,rc);
MCA_BTL_SM_FRAG_ALLOC_EAGER(frag,rc);
} else if (size <= mca_btl_sm_component.max_frag_size) {
MCA_BTL_SM_FRAG_ALLOC2(frag,rc);
} else {
return NULL;
MCA_BTL_SM_FRAG_ALLOC_MAX(frag,rc);
}
if (frag != NULL) {
if (OPAL_LIKELY(frag != NULL)) {
frag->segment.seg_len = size;
frag->base.des_flags = flags;
}
@ -673,8 +671,8 @@ struct mca_btl_base_descriptor_t* mca_btl_sm_prepare_src(
size_t max_data = *size;
int rc;
MCA_BTL_SM_FRAG_ALLOC2(frag, rc);
if(NULL == frag) {
MCA_BTL_SM_FRAG_ALLOC_MAX(frag, rc);
if(OPAL_UNLIKELY(NULL == frag)) {
return NULL;
}
@ -751,7 +749,7 @@ int mca_btl_sm_sendi( struct mca_btl_base_module_t* btl,
int rc;
if( length < mca_btl_sm_component.eager_limit ) {
MCA_BTL_SM_FRAG_ALLOC1(frag, rc);
MCA_BTL_SM_FRAG_ALLOC_EAGER(frag, rc);
if( OPAL_UNLIKELY(NULL == frag) ) {
*descriptor = NULL;
return rc;

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -69,14 +69,14 @@ OBJ_CLASS_DECLARATION(mca_btl_sm_frag_t);
OBJ_CLASS_DECLARATION(mca_btl_sm_frag1_t);
OBJ_CLASS_DECLARATION(mca_btl_sm_frag2_t);
#define MCA_BTL_SM_FRAG_ALLOC1(frag, rc) \
#define MCA_BTL_SM_FRAG_ALLOC_EAGER(frag, rc) \
{ \
ompi_free_list_item_t* item; \
OMPI_FREE_LIST_GET(&mca_btl_sm_component.sm_frags_eager, item, rc); \
frag = (mca_btl_sm_frag_t*)item; \
}
#define MCA_BTL_SM_FRAG_ALLOC2(frag, rc) \
#define MCA_BTL_SM_FRAG_ALLOC_MAX(frag, rc) \
{ \
ompi_free_list_item_t* item; \
OMPI_FREE_LIST_GET(&mca_btl_sm_component.sm_frags_max, item, rc); \