1
1

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

This commit was SVN r20149.
Этот коммит содержится в:
George Bosilca 2008-12-17 22:14:45 +00:00
родитель c954045989
Коммит 7cec018149
3 изменённых файлов: 25 добавлений и 38 удалений

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

@ -193,7 +193,7 @@ static int mca_btl_elan_add_procs( struct mca_btl_base_module_t* btl,
mca_btl_elan_frag_t* frag;
MCA_BTL_ELAN_FRAG_ALLOC_EAGER(frag, rc );
if( NULL == frag ) {
if( OPAL_UNLIKELY(NULL == frag) ) {
return OMPI_ERROR;
}
frag->segment.seg_addr.pval = (void*)(frag + 1);
@ -255,9 +255,6 @@ mca_btl_elan_alloc( struct mca_btl_base_module_t* btl,
if( size <= btl->btl_eager_limit ) {
MCA_BTL_ELAN_FRAG_ALLOC_EAGER(frag, rc);
if( NULL == frag ) {
return NULL;
}
if( size <= mca_btl_elan_component.queue_max_size ) { /* This will be going over the queue */
hdr_skip = sizeof(mca_btl_elan_hdr_t);
}
@ -331,27 +328,25 @@ mca_btl_elan_prepare_src( struct mca_btl_base_module_t* btl,
if( 0 != reserve ) {
if( max_data + reserve <= btl->btl_eager_limit ) {
MCA_BTL_ELAN_FRAG_ALLOC_EAGER(frag, rc);
if( NULL == frag ) {
return NULL;
}
if( (max_data + reserve) <= mca_btl_elan_component.queue_max_size ) {
skip = sizeof(mca_btl_elan_hdr_t);
}
} else {
MCA_BTL_ELAN_FRAG_ALLOC_MAX(frag, rc);
if( NULL == frag ) {
return NULL;
}
if( (max_data + reserve) > btl->btl_max_send_size ) {
max_data = btl->btl_max_send_size - reserve;
}
}
if( OPAL_UNLIKELY(NULL == frag) ) {
return NULL;
}
frag->segment.seg_addr.pval = (void*)((unsigned char*)(frag + 1) + skip);
iov.iov_len = max_data;
iov.iov_base = (unsigned char*)frag->segment.seg_addr.pval + reserve;
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
*size = max_data;
if( rc < 0 ) {
MCA_BTL_ELAN_FRAG_RETURN(frag);
@ -360,7 +355,7 @@ mca_btl_elan_prepare_src( struct mca_btl_base_module_t* btl,
frag->segment.seg_len = max_data + reserve;
} else { /* this is a real RDMA operation */
MCA_BTL_ELAN_FRAG_ALLOC_USER(frag, rc);
if(NULL == frag) {
if(OPAL_UNLIKELY(NULL == frag)) {
return NULL;
}
frag->type = MCA_BTL_ELAN_HDR_TYPE_PUT;
@ -414,7 +409,7 @@ mca_btl_elan_prepare_dst( struct mca_btl_base_module_t* btl,
*size = (size_t)UINT32_MAX;
}
MCA_BTL_ELAN_FRAG_ALLOC_USER(frag, rc);
if( NULL == frag ) {
if( OPAL_UNLIKELY(NULL == frag) ) {
return NULL;
}

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

@ -1,5 +1,5 @@
/*
* 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$
@ -24,19 +24,22 @@ static void mca_btl_elan_frag_common_constructor(mca_btl_elan_frag_t* frag)
static void mca_btl_elan_frag_eager_constructor(mca_btl_elan_frag_t* frag)
{
frag->size = mca_btl_elan_module.super.btl_eager_limit;
frag->size = mca_btl_elan_module.super.btl_eager_limit;
frag->my_list = &mca_btl_elan_component.elan_frag_eager;
mca_btl_elan_frag_common_constructor(frag);
}
static void mca_btl_elan_frag_max_constructor(mca_btl_elan_frag_t* frag)
{
frag->size = mca_btl_elan_module.super.btl_max_send_size;
frag->size = mca_btl_elan_module.super.btl_max_send_size;
frag->my_list = &mca_btl_elan_component.elan_frag_max;
mca_btl_elan_frag_common_constructor(frag);
}
static void mca_btl_elan_frag_user_constructor(mca_btl_elan_frag_t* frag)
{
frag->size = 0;
frag->size = 0;
frag->my_list = &mca_btl_elan_component.elan_frag_user;
mca_btl_elan_frag_common_constructor(frag);
}

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

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2007 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$
@ -57,32 +57,21 @@ OBJ_CLASS_DECLARATION(mca_btl_elan_frag_user_t);
* Macros to allocate/return descriptors from module specific
* free list(s).
*/
#define MCA_BTL_ELAN_FRAG_ALLOC_LIST( list, frag, rc ) \
{ \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_GET(&(list), item, rc); \
frag = (mca_btl_elan_frag_t*) item; \
}
#define MCA_BTL_ELAN_FRAG_ALLOC_EAGER(frag, rc) \
{ \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&mca_btl_elan_component.elan_frag_eager, item, rc); \
frag = (mca_btl_elan_frag_t*) item; \
frag->my_list = &mca_btl_elan_component.elan_frag_eager; \
}
MCA_BTL_ELAN_FRAG_ALLOC_LIST(mca_btl_elan_component.elan_frag_eager, frag, rc)
#define MCA_BTL_ELAN_FRAG_ALLOC_MAX(frag, rc) \
{ \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&mca_btl_elan_component.elan_frag_max, item, rc); \
frag = (mca_btl_elan_frag_t*) item; \
frag->my_list = &mca_btl_elan_component.elan_frag_max; \
}
MCA_BTL_ELAN_FRAG_ALLOC_LIST(mca_btl_elan_component.elan_frag_max, frag, rc)
#define MCA_BTL_ELAN_FRAG_ALLOC_USER(frag, rc) \
{ \
ompi_free_list_item_t *item; \
OMPI_FREE_LIST_WAIT(&mca_btl_elan_component.elan_frag_user, item, rc); \
frag = (mca_btl_elan_frag_t*) item; \
frag->my_list = &mca_btl_elan_component.elan_frag_user; \
}
MCA_BTL_ELAN_FRAG_ALLOC_LIST(mca_btl_elan_component.elan_frag_user, frag, rc)
#define MCA_BTL_ELAN_FRAG_RETURN(frag) \
{ \