1
1

Add the ownership flags to the PML/BTL interface. The layer

owning the descriptor is responsible for releasing it once
the descriptor is not in use anymore.

This commit was SVN r17497.
Этот коммит содержится в:
George Bosilca 2008-02-18 17:39:30 +00:00
родитель da3e69101d
Коммит fa31ec81d0
25 изменённых файлов: 268 добавлений и 178 удалений

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 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,
@ -273,17 +273,14 @@ typedef struct mca_btl_base_descriptor_t mca_btl_base_descriptor_t;
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_btl_base_descriptor_t);
#define MCA_BTL_DES_FLAGS_DEREGISTER 0x0001
#define MCA_BTL_DES_FLAGS_PRIORITY 0x0002
#define MCA_BTL_DES_FLAGS_PRIORITY 0x0001
#define MCA_BTL_DES_FLAGS_BTL_OWNERSHIP 0x0002
/**
* Maximum number of allowed segments in src/dst fields of a descriptor.
*/
#define MCA_BTL_DES_MAX_SEGMENTS 16
/*
* BTL base header, stores the tag at a minimum
*/

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

@ -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$
@ -238,12 +238,12 @@ mca_btl_elan_alloc( struct mca_btl_base_module_t* btl,
}
frag->segment.seg_addr.pval = (void*)((char*)(frag + 1) + hdr_skip);
frag->segment.seg_len = size;
frag->base.des_src = &(frag->segment);
frag->segment.seg_len = size;
frag->base.des_src = &(frag->segment);
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->btl = (mca_btl_elan_module_t*)btl;
frag->endpoint = peer;
frag->base.order = MCA_BTL_NO_ORDER;
@ -346,7 +346,7 @@ mca_btl_elan_prepare_src( struct mca_btl_base_module_t* btl,
frag->base.order = MCA_BTL_NO_ORDER;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
return &frag->base;
}
@ -396,7 +396,7 @@ mca_btl_elan_prepare_dst( struct mca_btl_base_module_t* btl,
frag->segment.seg_len = *size;
frag->base.des_src = NULL;
frag->base.des_src_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.des_dst = &(frag->segment);
frag->base.des_dst_cnt = 1;
frag->base.order = MCA_BTL_NO_ORDER;
@ -441,25 +441,28 @@ static int mca_btl_elan_send( struct mca_btl_base_module_t* btl,
opal_output( 0, "elan_queueTx failed for destination %d\n", endpoint->elan_vp );
return OMPI_ERROR;
}
if( elan_poll( frag->elan_event, 0 ) ) {
frag->base.des_cbfunc( &(elan_btl->super), frag->endpoint,
&(frag->base), OMPI_SUCCESS );
return OMPI_SUCCESS;
}
} else {
frag->elan_event = elan_tportTxStart( elan_btl->tport, 0, endpoint->elan_vp,
elan_btl->elan_vp, frag->tag,
(void*)elan_hdr, frag->segment.seg_len );
if( elan_tportTxDone(frag->elan_event) ) {
elan_tportTxWait(frag->elan_event);
frag->base.des_cbfunc( &(elan_btl->super), frag->endpoint,
&(frag->base), OMPI_SUCCESS );
return OMPI_SUCCESS;
if( OPAL_UNLIKELY(NULL == frag->elan_event) ) {
opal_output( 0, "elan_tportTxStart failed for destination %d\n", endpoint->elan_vp );
return OMPI_ERROR;
}
}
if( elan_poll( frag->elan_event, 0 ) ) {
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP );
frag->base.des_cbfunc( &(elan_btl->super), frag->endpoint,
&(frag->base), OMPI_SUCCESS );
if( btl_ownership ) {
MCA_BTL_ELAN_FRAG_RETURN(frag);
}
return OMPI_SUCCESS;
}
/* Add the fragment to the pending send list */
opal_list_append( &(elan_btl->send_list), (opal_list_item_t*)frag );
return OMPI_SUCCESS;
return OMPI_ERR_RESOURCE_BUSY;
}

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

@ -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$
@ -269,6 +269,7 @@ int mca_btl_elan_component_progress( void )
for( i = 0; i < (int)mca_btl_elan_component.elan_num_btls; i++ ) {
mca_btl_elan_module_t* elan_btl = mca_btl_elan_component.elan_btls[i];
/* This is a fast receive over the queue */
if( elan_queueRxPoll( elan_btl->rx_queue, 0 ) ) {
mca_btl_active_message_callback_t* reg;
mca_btl_elan_hdr_t* elan_hdr = NULL;
@ -284,11 +285,11 @@ int mca_btl_elan_component_progress( void )
reg = mca_btl_base_active_message_trigger + frag.tag;
reg->cbfunc( &(elan_btl->super), frag.tag, &(frag.base), reg->cbdata );
elan_queueRxComplete( elan_btl->rx_queue );
num_progressed++;
}
if(elan_btl->expect_tport_recv) { /* There is a pending message on the tport */
/* This is the slower receive over the tport */
if(elan_btl->expect_tport_recv) {
mca_btl_elan_frag_t* frag = (mca_btl_elan_frag_t*)opal_list_get_first( &(elan_btl->recv_list) );
if( elan_done(frag->elan_event, 0) ) {
int tag;
@ -327,7 +328,9 @@ int mca_btl_elan_component_progress( void )
/* If there are any pending sends check their completion */
if( !opal_list_is_empty( &(elan_btl->send_list) ) ) {
mca_btl_elan_frag_t* frag = (mca_btl_elan_frag_t*)opal_list_get_first( &(elan_btl->send_list) );
if( elan_poll(frag->elan_event, 1) ) {
if( elan_poll(frag->elan_event, 0) ) {
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP );
OPAL_THREAD_LOCK(&elan_btl->elan_lock);
opal_list_remove_first( &(elan_btl->send_list) );
OPAL_THREAD_UNLOCK(&elan_btl->elan_lock);
@ -335,12 +338,17 @@ int mca_btl_elan_component_progress( void )
frag->base.des_cbfunc( &(elan_btl->super), frag->endpoint,
&(frag->base), OMPI_SUCCESS );
if( btl_ownership ) {
MCA_BTL_ELAN_FRAG_RETURN(frag);
}
}
}
/* If any RDMA have been posted, check their status */
if( !opal_list_is_empty( &(elan_btl->rdma_list) ) ) {
mca_btl_elan_frag_t* frag = (mca_btl_elan_frag_t*)opal_list_get_first( &(elan_btl->rdma_list) );
if( elan_poll(frag->elan_event, 1) ) {
if( elan_poll(frag->elan_event, 0) ) {
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP );
OPAL_THREAD_LOCK(&elan_btl->elan_lock);
opal_list_remove_first( &(elan_btl->rdma_list) );
OPAL_THREAD_UNLOCK(&elan_btl->elan_lock);
@ -348,6 +356,9 @@ int mca_btl_elan_component_progress( void )
frag->base.des_cbfunc( &(elan_btl->super), frag->endpoint,
&(frag->base), OMPI_SUCCESS );
if( btl_ownership ) {
MCA_BTL_ELAN_FRAG_RETURN(frag);
}
}
}
}

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 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
* 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,
@ -216,7 +216,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_alloc(
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -299,12 +299,12 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
frag->base.des_src = &frag->segment;
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.order = MCA_BTL_NO_ORDER;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -341,13 +341,13 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_src(
return NULL;
}
*size = max_data;
frag->segment.seg_len = max_data + reserve;
frag->base.des_src = &frag->segment;
frag->segment.seg_len = max_data + reserve;
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.order = MCA_BTL_NO_ORDER;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -386,11 +386,6 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_dst(
if(NULL == frag) {
return NULL;
}
/*
* just assign it something..
* we will assign the real value in put/get
*/
frag->type = MCA_BTL_GM_PUT;
/*
* we don't know that this is for a PUT,
@ -406,7 +401,7 @@ mca_btl_base_descriptor_t* mca_btl_gm_prepare_dst(
frag->base.des_src_cnt = 0;
frag->base.des_dst = &frag->segment;
frag->base.des_dst_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
if(NULL == registration) {
@ -447,6 +442,7 @@ static void mca_btl_gm_send_callback( struct gm_port* port, void* context, gm_st
{
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)context;
mca_btl_gm_module_t* btl = frag->btl;
int btl_ownership = frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP;
switch(status) {
case GM_TRY_AGAIN:
@ -479,7 +475,9 @@ static void mca_btl_gm_send_callback( struct gm_port* port, void* context, gm_st
OPAL_THREAD_UNLOCK(&mca_btl_gm_component.gm_lock);
frag->base.des_cbfunc(&btl->super, frag->endpoint, &frag->base, OMPI_SUCCESS);
OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock);
if( btl_ownership ) {
mca_btl_gm_free(btl, frag);
}
/* return the send token and deque pending fragments */
MCA_BTL_GM_RETURN_TOKEN(btl);
break;
@ -495,6 +493,9 @@ static void mca_btl_gm_send_callback( struct gm_port* port, void* context, gm_st
OPAL_THREAD_UNLOCK(&mca_btl_gm_component.gm_lock);
frag->base.des_cbfunc(&btl->super, frag->endpoint, &frag->base, OMPI_ERROR);
OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock);
if( btl_ownership ) {
mca_btl_gm_free(btl, frag);
}
break;
}
}
@ -633,6 +634,7 @@ static void mca_btl_gm_put_callback( struct gm_port* port, void* context, gm_sta
{
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)context;
mca_btl_gm_module_t* btl = frag->btl;
int btl_ownership = frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP;
/* call the completion callback */
switch(status) {
@ -667,6 +669,9 @@ static void mca_btl_gm_put_callback( struct gm_port* port, void* context, gm_sta
OPAL_THREAD_UNLOCK(&mca_btl_gm_component.gm_lock);
frag->base.des_cbfunc(&btl->super, frag->endpoint, &frag->base, OMPI_SUCCESS);
OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock);
if( btl_ownership ) {
mca_btl_gm_free(btl, frag);
}
/* return the send token and deque pending fragments */
MCA_BTL_GM_RETURN_TOKEN(btl);
@ -682,6 +687,9 @@ static void mca_btl_gm_put_callback( struct gm_port* port, void* context, gm_sta
OPAL_THREAD_UNLOCK(&mca_btl_gm_component.gm_lock);
frag->base.des_cbfunc(&btl->super, frag->endpoint, &frag->base, OMPI_ERROR);
OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock);
if( btl_ownership ) {
mca_btl_gm_free(btl, frag);
}
break;
}
}
@ -781,6 +789,7 @@ static void mca_btl_gm_get_callback( struct gm_port* port, void* context, gm_sta
{
mca_btl_gm_frag_t* frag = (mca_btl_gm_frag_t*)context;
mca_btl_gm_module_t* btl = frag->btl;
int btl_ownership = frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP;
/* call the completion callback */
switch(status) {
@ -814,6 +823,9 @@ static void mca_btl_gm_get_callback( struct gm_port* port, void* context, gm_sta
OPAL_THREAD_UNLOCK(&mca_btl_gm_component.gm_lock);
frag->base.des_cbfunc(&btl->super, frag->endpoint, &frag->base, OMPI_SUCCESS);
OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock);
if( btl_ownership ) {
mca_btl_gm_free(btl, frag);
}
/* return the send token and deque pending fragments */
MCA_BTL_GM_RETURN_TOKEN(btl);
@ -829,6 +841,9 @@ static void mca_btl_gm_get_callback( struct gm_port* port, void* context, gm_sta
OPAL_THREAD_UNLOCK(&mca_btl_gm_component.gm_lock);
frag->base.des_cbfunc(&btl->super, frag->endpoint, &frag->base, OMPI_ERROR);
OPAL_THREAD_LOCK(&mca_btl_gm_component.gm_lock);
if( btl_ownership ) {
mca_btl_gm_free(btl, frag);
}
break;
}
}

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

@ -179,7 +179,7 @@ mca_btl_base_descriptor_t* mca_btl_mx_alloc( struct mca_btl_base_module_t* btl,
frag->segment[0].seg_addr.pval = (void*)(frag+1);
frag->base.des_src = frag->segment;
frag->base.des_src_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return (mca_btl_base_descriptor_t*)frag;
@ -272,8 +272,9 @@ mca_btl_mx_prepare_src( struct mca_btl_base_module_t* btl,
frag->segment[1].seg_len = max_data;
frag->segment[1].seg_addr.pval = iov.iov_base;
}
frag->base.des_src = frag->segment;
frag->base.order = MCA_BTL_NO_ORDER;
frag->base.des_src = frag->segment;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -339,11 +340,11 @@ mca_btl_base_descriptor_t* mca_btl_mx_prepare_dst( struct mca_btl_base_module_t*
#endif
/* Allow the fragment to be recycled using the mca_btl_mx_free function */
frag->type = MCA_BTL_MX_SEND;
frag->base.des_dst = frag->segment;
frag->type = MCA_BTL_MX_SEND;
frag->base.des_dst = frag->segment;
frag->base.des_dst_cnt = 1;
frag->base.order = MCA_BTL_NO_ORDER;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -416,6 +417,7 @@ int mca_btl_mx_send( struct mca_btl_base_module_t* btl,
mx_return_t mx_return;
uint64_t total_length = 0, tag64;
uint32_t i = 0;
int btl_ownership = (descriptor->des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if( OPAL_UNLIKELY(MCA_BTL_MX_CONNECTED != ((mca_btl_mx_endpoint_t*)endpoint)->status) ) {
if( MCA_BTL_MX_NOT_REACHEABLE == ((mca_btl_mx_endpoint_t*)endpoint)->status )
@ -456,6 +458,9 @@ int mca_btl_mx_send( struct mca_btl_base_module_t* btl,
if( mx_result ) {
mx_return = mx_forget( mx_btl->mx_endpoint, &(frag->mx_request) );
frag->base.des_cbfunc( &(mx_btl->super), frag->endpoint, &(frag->base), OMPI_SUCCESS);
if( btl_ownership ) {
MCA_BTL_MX_FRAG_RETURN( mx_btl, frag );
}
if( OPAL_UNLIKELY(MX_SUCCESS != mx_return) ) {
opal_output( 0, "mx_forget failed with error %d (%s)\n",
mx_return, mx_strerror(mx_return) );
@ -476,6 +481,9 @@ int mca_btl_mx_send( struct mca_btl_base_module_t* btl,
/* call the completion callback */
if( mx_result ) {
frag->base.des_cbfunc( &(mx_btl->super), frag->endpoint, &(frag->base), OMPI_SUCCESS);
if( btl_ownership ) {
MCA_BTL_MX_FRAG_RETURN( mx_btl, frag );
}
return OMPI_SUCCESS;
}
}

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

@ -618,9 +618,13 @@ int mca_btl_mx_component_progress(void)
frag = mx_status.context;
if( NULL != frag ) {
if( MCA_BTL_MX_SEND == frag->type ) { /* it's a send */
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
/* call the completion callback */
frag->base.des_cbfunc( &(mx_btl->super), frag->endpoint,
&(frag->base), OMPI_SUCCESS );
if( btl_ownership ) {
MCA_BTL_MX_FRAG_RETURN( mx_btl, frag );
}
} else if( !mca_btl_mx_component.mx_use_unexpected ) { /* and this one is a receive */
mca_btl_active_message_callback_t* reg;
mx_segment_t mx_segment;

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

@ -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-2005 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,
@ -215,6 +215,7 @@ mca_btl_base_descriptor_t* mca_btl_ud_alloc(struct mca_btl_base_module_t* btl,
}
frag->base.order = MCA_BTL_NO_ORDER;
frag->base.des_flags = flags;
frag->segment.seg_len = size;
return (mca_btl_base_descriptor_t*)frag;
}
@ -304,7 +305,7 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
frag->segment.seg_len = max_data;
frag->segment.seg_addr.pval = iov.iov_base;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
if(NULL == registration) {
@ -355,7 +356,7 @@ mca_btl_base_descriptor_t* mca_btl_ud_prepare_src(
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
*size = max_data;

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

@ -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-2005 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,
@ -420,7 +420,7 @@ mca_btl_base_module_t** mca_btl_ud_component_init(int* num_btl_modules,
int mca_btl_ud_component_progress(void)
{
uint32_t i;
int count = 0, ne, j;
int count = 0, ne, j, btl_ownership;
mca_btl_ud_frag_t* frag;
struct ibv_recv_wr* bad_wr;
struct ibv_recv_wr* head_wr;
@ -458,9 +458,12 @@ int mca_btl_ud_component_progress(void)
case MCA_BTL_UD_FRAG_USER:
{
assert(cwc->opcode == IBV_WC_SEND);
btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
frag->base.des_cbfunc(&ud_btl->super,
frag->endpoint, &frag->base, OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_ud_free( &ud_btl->super, &frag->base );
}
/* Increment send counter, post if any sends are queued */
OPAL_THREAD_ADD32(&ud_btl->sd_wqe, 1);

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

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* 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 (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -560,7 +560,8 @@ mca_btl_base_descriptor_t* mca_btl_openib_alloc(
assert(qp != MCA_BTL_NO_ORDER);
if(mca_btl_openib_component.use_message_coalescing) {
if(mca_btl_openib_component.use_message_coalescing &&
(flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP)) {
int prio = !(flags & MCA_BTL_DES_FLAGS_PRIORITY);
sfrag = check_coalescing(&ep->qps[qp].qp->pending_frags[prio],
&ep->qps[qp].qp->lock, ep, size);
@ -751,6 +752,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
frag->sg_entry.addr = (uint64_t)(uintptr_t)iov.iov_base;
to_base_frag(frag)->base.order = order;
to_base_frag(frag)->base.des_flags = flags;
to_base_frag(frag)->segment.seg_len = max_data;
to_base_frag(frag)->segment.seg_addr.pval = iov.iov_base;
to_base_frag(frag)->segment.seg_key.key32[0] =
@ -790,6 +792,7 @@ mca_btl_base_descriptor_t* mca_btl_openib_prepare_src(
/* not all upper layer users set this */
to_base_frag(frag)->segment.seg_len = max_data + reserve;
to_base_frag(frag)->base.des_flags = flags;
return &to_base_frag(frag)->base;
}

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

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* 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 (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -1810,7 +1810,7 @@ static void handle_wc(mca_btl_openib_hca_t* hca, const uint32_t cq,
mca_btl_openib_endpoint_t* endpoint;
mca_btl_openib_module_t *openib_btl = NULL;
ompi_proc_t* remote_proc = NULL;
int qp;
int qp, btl_ownership;
des = (mca_btl_base_descriptor_t*)(uintptr_t)wc->wr_id;
frag = to_com_frag(des);
@ -1837,12 +1837,21 @@ static void handle_wc(mca_btl_openib_hca_t* hca, const uint32_t cq,
case IBV_WC_SEND:
if(openib_frag_type(des) == MCA_BTL_OPENIB_FRAG_SEND) {
opal_list_item_t *i;
while((i = opal_list_remove_first(&to_send_frag(des)->coalesced_frags)))
while((i = opal_list_remove_first(&to_send_frag(des)->coalesced_frags))) {
btl_ownership = (to_base_frag(i)->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
to_base_frag(i)->base.des_cbfunc(&openib_btl->super, endpoint,
&to_base_frag(i)->base, OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_openib_free(&openib_btl->super, &to_base_frag(i)->base);
}
}
}
/* Process a completed send/put/get */
btl_ownership = (des->des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
des->des_cbfunc(&openib_btl->super, endpoint, des,OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_openib_free(&openib_btl->super, des);
}
/* return send wqe */
qp_put_wqe(endpoint, qp);

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 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
* 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,
@ -249,7 +249,7 @@ mca_btl_portals_alloc(struct mca_btl_base_module_t* btl_base,
}
frag->base.des_src_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
@ -407,7 +407,7 @@ mca_btl_portals_prepare_src(struct mca_btl_base_module_t* btl_base,
frag->base.des_src = frag->segments;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -451,7 +451,7 @@ mca_btl_portals_prepare_dst(struct mca_btl_base_module_t* btl_base,
frag->base.des_src_cnt = 0;
frag->base.des_dst = frag->segments;
frag->base.des_dst_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
OPAL_OUTPUT_VERBOSE((90, mca_btl_portals_component.portals_output,
"rdma dest posted for frag 0x%x, callback 0x%x, bits %lld",

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

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2008 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.
@ -301,7 +301,7 @@ int
mca_btl_portals_component_progress(void)
{
int num_progressed = 0;
int ret, which;
int ret, which, btl_ownership;
static ptl_event_t ev;
mca_btl_portals_frag_t *frag = NULL;
mca_btl_portals_recv_block_t *block = NULL;
@ -320,6 +320,7 @@ mca_btl_portals_component_progress(void)
switch (ret) {
case PTL_OK:
frag = ev.md.user_ptr;
btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
num_progressed++;
switch (ev.type) {
@ -432,6 +433,9 @@ mca_btl_portals_component_progress(void)
frag->endpoint,
&frag->base,
OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_portals_free(btl, &frag->base);
}
break;
@ -450,6 +454,9 @@ mca_btl_portals_component_progress(void)
frag->endpoint,
&frag->base,
OMPI_ERROR);
if( btl_ownership ) {
mca_btl_portals_free(btl, &frag->base);
}
}
#endif
break;
@ -468,6 +475,9 @@ mca_btl_portals_component_progress(void)
frag->endpoint,
&frag->base,
OMPI_ERROR);
if( btl_ownership ) {
mca_btl_portals_free(btl, &frag->base);
}
}
#endif
break;
@ -490,6 +500,9 @@ mca_btl_portals_component_progress(void)
frag->endpoint,
&frag->base,
OMPI_ERROR);
if( btl_ownership ) {
mca_btl_portals_free(btl, &frag->base);
}
} else
#endif
@ -514,6 +527,9 @@ mca_btl_portals_component_progress(void)
frag->endpoint,
&frag->base,
OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_portals_free(btl, &frag->base);
}
}
opal_output_verbose(50, mca_btl_portals_component.portals_output, "fuck");

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

@ -191,7 +191,7 @@ mca_btl_base_descriptor_t* mca_btl_sctp_alloc(
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
frag->btl = (mca_btl_sctp_module_t*)btl;
return (mca_btl_base_descriptor_t*)frag;
@ -299,7 +299,7 @@ mca_btl_base_descriptor_t* mca_btl_sctp_prepare_src(
frag->base.des_src = frag->segments;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
*size = max_data;
return &frag->base;
}
@ -346,7 +346,7 @@ mca_btl_base_descriptor_t* mca_btl_sctp_prepare_dst(
frag->base.des_src_cnt = 0;
frag->base.des_dst = frag->segments;
frag->base.des_dst_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
return &frag->base;
}

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

@ -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,
@ -337,8 +337,12 @@ int mca_btl_sctp_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_sc
if (btl_endpoint->endpoint_send_frag == NULL) {
if(frag->base.des_flags & MCA_BTL_DES_FLAGS_PRIORITY &&
mca_btl_sctp_frag_send(frag, btl_endpoint->endpoint_sd)) {
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc);
if( btl_ownership ) {
MCA_BTL_STCP_FRAG_RETURN(frag);
}
return OMPI_SUCCESS;
} else {
btl_endpoint->endpoint_send_frag = frag;
@ -377,13 +381,17 @@ int mca_btl_sctp_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_sc
if (btl_endpoint->endpoint_send_frag == NULL) {
if(frag->base.des_flags & MCA_BTL_DES_FLAGS_PRIORITY &&
mca_btl_sctp_frag_send(frag, btl_endpoint->endpoint_sd)) {
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc);
if( btl_ownership ) {
MCA_BTL_STCP_FRAG_RETURN(frag);
}
return OMPI_SUCCESS;
} else {
btl_endpoint->endpoint_send_frag = frag;
/* TOOD make this all a function since repeated below */
/* TODO make this all a function since repeated below */
/* if this endpoint is already in the sending_endpoints list; don't add duplicate */
/* if the associated endpoint is this one, avoid putting into the list */
@ -1148,6 +1156,7 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
break;
case MCA_BTL_SCTP_CONNECTED:
{
int btl_ownership;
/* complete the current send */
do {
mca_btl_sctp_frag_t* frag = btl_endpoint->endpoint_send_frag;
@ -1158,11 +1167,14 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
btl_endpoint->endpoint_send_frag = (mca_btl_sctp_frag_t*)
opal_list_remove_first(&btl_endpoint->endpoint_frags);
btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
/* if required - update request status and release fragment */
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc);
OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock);
if( btl_ownership ) {
MCA_BTL_STCP_FRAG_RETURN(frag);
}
} while (NULL != btl_endpoint->endpoint_send_frag);
/* if nothing else to do unregister for send event notifications */
@ -1188,7 +1200,8 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
send_handler_1_to_many_different_endpoint:
vpid = btl_endpoint->endpoint_proc->proc_name.vpid;
OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock);
if((mca_btl_sctp_proc_check_vpid(vpid, sender_proc_table)) == VALID_ENTRY) {
if((mca_btl_sctp_proc_check_vpid(vpid, sender_proc_table)) == VALID_ENTRY) { int btl_ownership;
/* complete the current send */
do {
mca_btl_sctp_frag_t* frag = btl_endpoint->endpoint_send_frag;
@ -1202,10 +1215,14 @@ static void mca_btl_sctp_endpoint_send_handler(int sd, short flags, void* user)
btl_endpoint->endpoint_send_frag = (mca_btl_sctp_frag_t*)
opal_list_remove_first(&btl_endpoint->endpoint_frags);
btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
/* if required - update request status and release fragment */
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc);
OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock);
if( btl_ownership ) {
MCA_BTL_STCP_FRAG_RETURN(frag);
}
}while (NULL != btl_endpoint->endpoint_send_frag);

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 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,
@ -144,7 +144,7 @@ mca_btl_base_descriptor_t* mca_btl_self_alloc(
return NULL;
}
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.des_src = &(frag->segment);
frag->base.des_src_cnt = 1;
return (mca_btl_base_descriptor_t*)frag;
@ -219,7 +219,6 @@ struct mca_btl_base_descriptor_t* mca_btl_self_prepare_src(
MCA_BTL_SELF_FRAG_RETURN_SEND(frag);
return NULL;
}
frag->base.des_flags = 0;
frag->segment.seg_addr.pval = frag+1;
frag->segment.seg_len = reserve + max_data;
*size = max_data;
@ -239,9 +238,9 @@ struct mca_btl_base_descriptor_t* mca_btl_self_prepare_src(
}
frag->segment.seg_addr.pval = iov.iov_base;
frag->segment.seg_len = max_data;
frag->base.des_flags = 0;
*size = max_data;
}
frag->base.des_flags = flags;
frag->base.des_src = &frag->segment;
frag->base.des_src_cnt = 1;
frag->segment.seg_key.key64 = (uint64_t)(intptr_t)convertor;
@ -276,7 +275,7 @@ struct mca_btl_base_descriptor_t* mca_btl_self_prepare_dst(
frag->segment.seg_key.key64 = (uint64_t)(intptr_t)convertor;
frag->base.des_dst = &frag->segment;
frag->base.des_dst_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
return &frag->base;
}
@ -293,6 +292,7 @@ int mca_btl_self_send( struct mca_btl_base_module_t* btl,
mca_btl_base_tag_t tag )
{
mca_btl_active_message_callback_t* reg;
int btl_ownership = (des->des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
/**
* We have to set the dst before the call to the function and reset them
@ -306,7 +306,10 @@ int mca_btl_self_send( struct mca_btl_base_module_t* btl,
des->des_dst = NULL;
des->des_dst_cnt = 0;
/* send completion */
des->des_cbfunc(btl,endpoint,des,OMPI_SUCCESS);
des->des_cbfunc( btl, endpoint, des, OMPI_SUCCESS );
if( btl_ownership ) {
mca_btl_self_free( btl, des );
}
return OMPI_SUCCESS;
}
@ -329,6 +332,7 @@ int mca_btl_self_rdma( struct mca_btl_base_module_t* btl,
size_t src_len = src->seg_len;
unsigned char* dst_addr = (unsigned char*)ompi_ptr_ltop(dst->seg_addr.lval);
size_t dst_len = dst->seg_len;
int btl_ownership = (des->des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
while(src_len && dst_len) {
@ -384,7 +388,10 @@ int mca_btl_self_rdma( struct mca_btl_base_module_t* btl,
}
/* rdma completion */
des->des_cbfunc(btl,endpoint,des,OMPI_SUCCESS);
des->des_cbfunc( btl, endpoint, des, OMPI_SUCCESS );
if( btl_ownership ) {
mca_btl_self_free( btl, des );
}
return OMPI_SUCCESS;
}

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 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-2007 High Performance Computing Center Stuttgart,
@ -712,6 +712,7 @@ extern mca_btl_base_descriptor_t* mca_btl_sm_alloc(
if (frag != NULL) {
frag->segment.seg_len = size;
frag->base.des_flags = flags;
}
return (mca_btl_base_descriptor_t*)frag;
@ -774,6 +775,7 @@ struct mca_btl_base_descriptor_t* mca_btl_sm_prepare_src(
return NULL;
}
frag->segment.seg_len = reserve + max_data;
frag->base.des_flags = flags;
*size = max_data;
return &frag->base;
}

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 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,
@ -409,14 +409,23 @@ int mca_btl_sm_component_progress(void)
case MCA_BTL_SM_FRAG_ACK:
{
int status = (uintptr_t)hdr & MCA_BTL_SM_FRAG_STATUS_MASK;
struct mca_btl_base_endpoint_t* endpoint;
int btl_ownership;
frag = (mca_btl_sm_frag_t *)((char*)((uintptr_t)hdr &
(~(MCA_BTL_SM_FRAG_TYPE_MASK |
MCA_BTL_SM_FRAG_STATUS_MASK))));
endpoint = frag->endpoint;
btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
/* completion callback */
frag->base.des_cbfunc(&mca_btl_sm.super, frag->endpoint,
&frag->base, status?OMPI_ERROR:OMPI_SUCCESS);
if(opal_list_get_size(&frag->endpoint->pending_sends))
process_pending_send(frag->endpoint);
if( btl_ownership ) {
MCA_BTL_SM_FRAG_RETURN(frag);
}
if(opal_list_get_size(&endpoint->pending_sends)) {
process_pending_send(endpoint);
}
break;
}
case MCA_BTL_SM_FRAG_SEND:

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* 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 (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -193,7 +193,7 @@ mca_btl_base_descriptor_t* mca_btl_tcp_alloc(
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
frag->btl = (mca_btl_tcp_module_t*)btl;
return (mca_btl_base_descriptor_t*)frag;
@ -295,7 +295,7 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_src(
frag->base.des_src = frag->segments;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
*size = max_data;
return &frag->base;
@ -344,7 +344,7 @@ mca_btl_base_descriptor_t* mca_btl_tcp_prepare_dst(
frag->base.des_src_cnt = 0;
frag->base.des_dst = frag->segments;
frag->base.des_dst_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}

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

@ -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-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 (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -249,8 +249,13 @@ int mca_btl_tcp_endpoint_send(mca_btl_base_endpoint_t* btl_endpoint, mca_btl_tcp
if (btl_endpoint->endpoint_send_frag == NULL) {
if(frag->base.des_flags & MCA_BTL_DES_FLAGS_PRIORITY &&
mca_btl_tcp_frag_send(frag, btl_endpoint->endpoint_sd)) {
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc);
if( btl_ownership ) {
MCA_BTL_TCP_FRAG_RETURN(frag);
}
return OMPI_SUCCESS;
} else {
btl_endpoint->endpoint_send_frag = frag;
@ -727,6 +732,8 @@ static void mca_btl_tcp_endpoint_send_handler(int sd, short flags, void* user)
/* complete the current send */
while (NULL != btl_endpoint->endpoint_send_frag) {
mca_btl_tcp_frag_t* frag = btl_endpoint->endpoint_send_frag;
int btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if(mca_btl_tcp_frag_send(frag, btl_endpoint->endpoint_sd) == false) {
break;
}
@ -737,6 +744,9 @@ static void mca_btl_tcp_endpoint_send_handler(int sd, short flags, void* user)
/* if required - update request status and release fragment */
OPAL_THREAD_UNLOCK(&btl_endpoint->endpoint_send_lock);
frag->base.des_cbfunc(&frag->btl->super, frag->endpoint, &frag->base, frag->rc);
if( btl_ownership ) {
MCA_BTL_TCP_FRAG_RETURN(frag);
}
OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock);
}

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

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 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
* 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,
@ -861,7 +861,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_alloc(
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -966,7 +966,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -1014,7 +1014,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_src(
frag->base.des_src_cnt = 1;
frag->base.des_dst = NULL;
frag->base.des_dst_cnt = 0;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->base.order = MCA_BTL_NO_ORDER;
return &frag->base;
}
@ -1074,7 +1074,7 @@ mca_btl_base_descriptor_t* mca_btl_udapl_prepare_dst(
frag->base.des_src_cnt = 0;
frag->base.des_dst = &frag->segment;
frag->base.des_dst_cnt = 1;
frag->base.des_flags = 0;
frag->base.des_flags = flags;
frag->segment.seg_key.key32[0] =
((mca_btl_udapl_reg_t*)registration)->rmr_context;

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

@ -3,7 +3,7 @@
* Copyright (c) 2004-2007 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
* 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,
@ -780,7 +780,9 @@ int mca_btl_udapl_component_progress()
DAT_EVENT event;
size_t i;
int32_t j, rdma_ep_count;
int count = 0;
int count = 0, btl_ownership;
mca_btl_udapl_frag_t* frag;
mca_btl_base_endpoint_t* endpoint;
/* prevent deadlock - only one thread should be 'progressing' at a time */
if(OPAL_THREAD_ADD32(&inprogress, 1) > 1) {
@ -797,7 +799,6 @@ int mca_btl_udapl_component_progress()
while(DAT_SUCCESS ==
dat_evd_dequeue(btl->udapl_evd_dto, &event)) {
DAT_DTO_COMPLETION_EVENT_DATA* dto;
mca_btl_udapl_frag_t* frag;
switch(event.event_number) {
case DAT_DTO_COMPLETION_EVENT:
@ -812,6 +813,8 @@ int mca_btl_udapl_component_progress()
dto->status, frag->type, (unsigned long)frag->size, dto->ep_handle));
break;
}
endpoint = frag->endpoint;
btl_ownership = (frag->base.des_flags & MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
switch(frag->type) {
case MCA_BTL_UDAPL_RDMA_WRITE:
@ -822,40 +825,42 @@ int mca_btl_udapl_component_progress()
assert(frag->base.des_dst_cnt == 0);
assert(frag->type == MCA_BTL_UDAPL_RDMA_WRITE);
frag->base.des_cbfunc(&btl->super, frag->endpoint,
frag->base.des_cbfunc(&btl->super, endpoint,
&frag->base, OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_udapl_free(btl, &frag->base);
}
mca_btl_udapl_frag_progress_pending(btl,
frag->endpoint,
BTL_UDAPL_EAGER_CONNECTION);
endpoint, BTL_UDAPL_EAGER_CONNECTION);
break;
}
case MCA_BTL_UDAPL_SEND:
{
int connection = BTL_UDAPL_EAGER_CONNECTION;
assert(frag->base.des_src == &frag->segment);
assert(frag->base.des_src_cnt == 1);
assert(frag->base.des_dst == NULL);
assert(frag->base.des_dst_cnt == 0);
assert(frag->type == MCA_BTL_UDAPL_SEND);
frag->base.des_cbfunc(&btl->super, frag->endpoint,
&frag->base, OMPI_SUCCESS);
if(frag->size ==
if(frag->size !=
mca_btl_udapl_component.udapl_eager_frag_size) {
mca_btl_udapl_frag_progress_pending(btl,
frag->endpoint,
BTL_UDAPL_EAGER_CONNECTION);
} else {
assert(frag->size ==
mca_btl_udapl_component.udapl_max_frag_size);
mca_btl_udapl_frag_progress_pending(btl,
frag->endpoint,
BTL_UDAPL_MAX_CONNECTION);
connection = BTL_UDAPL_MAX_CONNECTION;
}
frag->base.des_cbfunc(&btl->super, endpoint,
&frag->base, OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_udapl_free(btl, &frag->base);
}
mca_btl_udapl_frag_progress_pending(btl,
endpoint, connection);
break;
}
case MCA_BTL_UDAPL_RECV:
@ -949,14 +954,16 @@ int mca_btl_udapl_component_progress()
assert(frag->base.des_dst_cnt == 1);
assert(frag->type == MCA_BTL_UDAPL_PUT);
frag->base.des_cbfunc(&btl->super, frag->endpoint,
frag->base.des_cbfunc(&btl->super, endpoint,
&frag->base, OMPI_SUCCESS);
if( btl_ownership ) {
mca_btl_udapl_free(btl, &frag->base);
}
OPAL_THREAD_ADD32(&(frag->endpoint->endpoint_sr_tokens[BTL_UDAPL_MAX_CONNECTION]), 1);
OPAL_THREAD_ADD32(&(endpoint->endpoint_sr_tokens[BTL_UDAPL_MAX_CONNECTION]), 1);
mca_btl_udapl_frag_progress_pending(btl,
frag->endpoint,
BTL_UDAPL_MAX_CONNECTION);
endpoint, BTL_UDAPL_MAX_CONNECTION);
break;
}

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

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* 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 (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -313,8 +313,6 @@ static void mca_pml_ob1_fin_completion( mca_btl_base_module_t* btl,
{
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) des->des_context;
mca_bml_base_free(bml_btl, des);
/* check for pending requests */
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
@ -331,13 +329,12 @@ int mca_pml_ob1_send_fin( ompi_proc_t* proc,
int rc;
mca_bml_base_alloc(bml_btl, &fin, order, sizeof(mca_pml_ob1_fin_hdr_t),
MCA_BTL_DES_FLAGS_PRIORITY);
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if(NULL == fin) {
MCA_PML_OB1_ADD_FIN_TO_PENDING(proc, hdr_des, bml_btl, order, status);
return OMPI_ERR_OUT_OF_RESOURCE;
}
fin->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
fin->des_cbfunc = mca_pml_ob1_fin_completion;
fin->des_cbdata = NULL;

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

@ -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-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 (c) 2004-2008 High Performance Computing Center Stuttgart,
@ -165,8 +165,6 @@ static void mca_pml_ob1_recv_ctl_completion( mca_btl_base_module_t* btl,
{
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*)des->des_context;
mca_bml_base_free(bml_btl, des);
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
}
@ -188,6 +186,7 @@ static void mca_pml_ob1_put_completion( mca_btl_base_module_t* btl,
0, bytes_received );
}
OPAL_THREAD_ADD_SIZE_T(&recvreq->req_pipeline_depth,-1);
mca_bml_base_free(bml_btl, des);
/* check completion status */
@ -214,7 +213,8 @@ int mca_pml_ob1_recv_request_ack_send_btl(
/* allocate descriptor */
mca_bml_base_alloc(bml_btl, &des, MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_ack_hdr_t), MCA_BTL_DES_FLAGS_PRIORITY);
sizeof(mca_pml_ob1_ack_hdr_t),
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if( OPAL_UNLIKELY(NULL == des) ) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
@ -230,7 +230,6 @@ int mca_pml_ob1_recv_request_ack_send_btl(
ob1_hdr_hton(ack, MCA_PML_OB1_HDR_TYPE_ACK, proc);
/* initialize descriptor */
des->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
des->des_cbfunc = mca_pml_ob1_recv_ctl_completion;
rc = mca_bml_base_send(bml_btl, des, MCA_BTL_TAG_PML);
@ -338,11 +337,6 @@ static void mca_pml_ob1_rget_completion( mca_btl_base_module_t* btl,
MCA_PML_OB1_RDMA_FRAG_RETURN(frag);
/* return rdma descriptor - do this after queuing the fin message - as
* release rdma resources (unpin memory) can take some time.
*/
mca_bml_base_free(bml_btl, des);
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
}
@ -365,7 +359,7 @@ int mca_pml_ob1_recv_request_get_frag( mca_pml_ob1_rdma_frag_t* frag )
MCA_BTL_NO_ORDER,
0,
&frag->rdma_length,
0,
MCA_BTL_DES_FLAGS_BTL_OWNERSHIP,
&descriptor );
if( OPAL_UNLIKELY(NULL == descriptor) ) {
frag->rdma_length = save_size;
@ -702,7 +696,7 @@ int mca_pml_ob1_recv_request_schedule_once(
/* prepare a descriptor for RDMA */
mca_bml_base_prepare_dst(bml_btl, reg,
&recvreq->req_recv.req_base.req_convertor,
MCA_BTL_NO_ORDER, 0, &size, 0, &dst);
MCA_BTL_NO_ORDER, 0, &size, MCA_BTL_DES_FLAGS_BTL_OWNERSHIP, &dst);
OPAL_THREAD_UNLOCK(&recvreq->lock);
if(OPAL_UNLIKELY(dst == NULL)) {
@ -720,13 +714,12 @@ int mca_pml_ob1_recv_request_schedule_once(
}
mca_bml_base_alloc(bml_btl, &ctl, MCA_BTL_NO_ORDER, hdr_size,
MCA_BTL_DES_FLAGS_PRIORITY);
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if( OPAL_UNLIKELY(NULL == ctl) ) {
mca_bml_base_free(bml_btl,dst);
continue;
}
ctl->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
ctl->des_cbfunc = mca_pml_ob1_recv_ctl_completion;
/* fill in rdma header */

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

@ -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-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 (c) 2004-2008 High Performance Computing Center Stuttgart,
@ -161,9 +161,6 @@ mca_pml_ob1_match_completion_free( struct mca_btl_base_module_t* btl,
orte_errmgr.abort();
}
/* free the descriptor */
mca_bml_base_free( bml_btl, descriptor );
/* signal request completion */
send_request_pml_complete(sendreq);
@ -208,9 +205,6 @@ mca_pml_ob1_rndv_completion( mca_btl_base_module_t* btl,
OPAL_THREAD_ADD_SIZE_T(&sendreq->req_bytes_delivered, req_bytes_delivered);
/* return the descriptor */
mca_bml_base_free(bml_btl, descriptor);
/* advance the request */
OPAL_THREAD_ADD32(&sendreq->req_state, -1);
@ -241,9 +235,10 @@ mca_pml_ob1_rget_completion( mca_btl_base_module_t* btl,
OPAL_THREAD_ADD_SIZE_T(&sendreq->req_bytes_delivered, req_bytes_delivered);
send_request_pml_complete_check(sendreq);
#if 0
/* release resources */
btl->btl_free(btl,des);
#endif
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
}
@ -258,9 +253,7 @@ mca_pml_ob1_send_ctl_completion( mca_btl_base_module_t* btl,
struct mca_btl_base_descriptor_t* descriptor,
int status )
{
/* return the descriptor */
mca_bml_base_btl_t* bml_btl = (mca_bml_base_btl_t*) descriptor->des_context;
mca_bml_base_free(bml_btl, descriptor);
/* check for pending requests */
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
@ -295,10 +288,6 @@ mca_pml_ob1_frag_completion( mca_btl_base_module_t* btl,
req_bytes_delivered );
OPAL_THREAD_ADD_SIZE_T(&sendreq->req_pipeline_depth, -1);
/* return the descriptor */
mca_bml_base_free(bml_btl, descriptor);
OPAL_THREAD_ADD_SIZE_T(&sendreq->req_bytes_delivered, req_bytes_delivered);
if(send_request_pml_complete_check(sendreq) == false)
@ -329,7 +318,7 @@ int mca_pml_ob1_send_request_start_buffered(
mca_bml_base_alloc(bml_btl, &descriptor,
MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_rendezvous_hdr_t) + size,
MCA_BTL_DES_FLAGS_PRIORITY);
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if( OPAL_UNLIKELY(NULL == descriptor) ) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
@ -367,7 +356,6 @@ int mca_pml_ob1_send_request_start_buffered(
segment->seg_len = sizeof(mca_pml_ob1_rendezvous_hdr_t) + max_data;
descriptor->des_cbfunc = mca_pml_ob1_rndv_completion;
descriptor->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
descriptor->des_cbdata = sendreq;
/* buffer the remainder of the message */
@ -433,7 +421,7 @@ int mca_pml_ob1_send_request_start_copy( mca_pml_ob1_send_request_t* sendreq,
mca_bml_base_alloc( bml_btl, &descriptor,
MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_match_hdr_t) + size,
MCA_BTL_DES_FLAGS_PRIORITY);
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if( OPAL_UNLIKELY(NULL == descriptor) ) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
@ -485,7 +473,6 @@ int mca_pml_ob1_send_request_start_copy( mca_pml_ob1_send_request_t* sendreq,
segment->seg_len = sizeof(mca_pml_ob1_match_hdr_t) + max_data;
/* short message */
descriptor->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
descriptor->des_cbdata = sendreq;
descriptor->des_cbfunc = mca_pml_ob1_match_completion_free;
@ -531,7 +518,7 @@ int mca_pml_ob1_send_request_start_prepare( mca_pml_ob1_send_request_t* sendreq,
MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_match_hdr_t),
&size,
MCA_BTL_DES_FLAGS_PRIORITY,
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP,
&descriptor );
if( OPAL_UNLIKELY(NULL == descriptor) ) {
return OMPI_ERR_OUT_OF_RESOURCE;
@ -553,7 +540,6 @@ int mca_pml_ob1_send_request_start_prepare( mca_pml_ob1_send_request_t* sendreq,
/* short message */
descriptor->des_cbfunc = mca_pml_ob1_match_completion_free;
descriptor->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
descriptor->des_cbdata = sendreq;
/* send */
@ -603,7 +589,7 @@ int mca_pml_ob1_send_request_start_rdma(
MCA_BTL_NO_ORDER,
0,
&size,
0,
MCA_BTL_DES_FLAGS_BTL_OWNERSHIP,
&src );
if( OPAL_UNLIKELY(NULL == src) ) {
ompi_convertor_set_position(&sendreq->req_send.req_base.req_convertor,
@ -617,7 +603,7 @@ int mca_pml_ob1_send_request_start_rdma(
mca_bml_base_alloc(bml_btl, &des, MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_rget_hdr_t) +
(sizeof(mca_btl_base_segment_t) * (src->des_src_cnt-1)),
MCA_BTL_DES_FLAGS_PRIORITY);
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if( OPAL_UNLIKELY(NULL == des) ) {
ompi_convertor_set_position(
&sendreq->req_send.req_base.req_convertor,
@ -670,7 +656,7 @@ int mca_pml_ob1_send_request_start_rdma(
mca_bml_base_alloc(bml_btl, &des,
MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_rendezvous_hdr_t),
MCA_BTL_DES_FLAGS_PRIORITY);
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP);
if( OPAL_UNLIKELY(NULL == des)) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
@ -700,7 +686,6 @@ int mca_pml_ob1_send_request_start_rdma(
sendreq->req_state = 2;
}
des->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
des->des_cbdata = sendreq;
/* send */
@ -733,7 +718,7 @@ int mca_pml_ob1_send_request_start_rndv( mca_pml_ob1_send_request_t* sendreq,
&des,
MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_rendezvous_hdr_t),
MCA_BTL_DES_FLAGS_PRIORITY );
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP );
} else {
mca_bml_base_prepare_src( bml_btl,
NULL,
@ -741,7 +726,7 @@ int mca_pml_ob1_send_request_start_rndv( mca_pml_ob1_send_request_t* sendreq,
MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_rendezvous_hdr_t),
&size,
MCA_BTL_DES_FLAGS_PRIORITY,
MCA_BTL_DES_FLAGS_PRIORITY | MCA_BTL_DES_FLAGS_BTL_OWNERSHIP,
&des );
}
@ -765,7 +750,6 @@ int mca_pml_ob1_send_request_start_rndv( mca_pml_ob1_send_request_t* sendreq,
sendreq->req_send.req_base.req_proc);
/* first fragment of a long message */
des->des_flags |= MCA_BTL_DES_FLAGS_PRIORITY;
des->des_cbdata = sendreq;
des->des_cbfunc = mca_pml_ob1_rndv_completion;
@ -939,7 +923,7 @@ cannot_pack:
&sendreq->req_send.req_base.req_convertor,
MCA_BTL_NO_ORDER,
sizeof(mca_pml_ob1_frag_hdr_t),
&size, 0, &des);
&size, MCA_BTL_DES_FLAGS_BTL_OWNERSHIP, &des);
if( OPAL_UNLIKELY(des == NULL || size == 0) ) {
if(des) {
@ -1027,12 +1011,6 @@ static void mca_pml_ob1_put_completion( mca_btl_base_module_t* btl,
send_request_pml_complete_check(sendreq);
MCA_PML_OB1_RDMA_FRAG_RETURN(frag);
/* return rdma descriptor - do this after queuing the fin message - as
* release rdma resources (unpin memory) can take some time.
*/
des->des_dst = NULL;
des->des_dst_cnt = 0;
mca_bml_base_free(bml_btl, des);
MCA_PML_OB1_PROGRESS_PENDING(bml_btl);
}
@ -1052,7 +1030,7 @@ int mca_pml_ob1_send_request_put_frag( mca_pml_ob1_rdma_frag_t* frag )
MCA_BTL_NO_ORDER,
0,
&frag->rdma_length,
0,
MCA_BTL_DES_FLAGS_BTL_OWNERSHIP,
&des );
if( OPAL_UNLIKELY(NULL == des) ) {

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

@ -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-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 (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -241,7 +241,7 @@ send_request_pml_complete(mca_pml_ob1_send_request_t *sendreq)
sendreq->req_send.req_base.req_pml_complete = true;
if(sendreq->req_send.req_base.req_free_called) {
MCA_PML_OB1_SEND_REQUEST_RETURN(sendreq);
MCA_PML_OB1_SEND_REQUEST_RETURN(sendreq);
}
OPAL_THREAD_UNLOCK(&ompi_request_lock);
}