1
1

Make the MVAPI BTL thread safe again. The problem was a double locking on the endpoint mutex.

It's still not very clean as we still lock the mvapi_btl mutex inside a critical section
protected by the endpoint mutex ...

This commit was SVN r8810.
Этот коммит содержится в:
George Bosilca 2006-01-25 23:14:06 +00:00
родитель ddc22d8c7e
Коммит 0f1c6d79e8
3 изменённых файлов: 10 добавлений и 11 удалений

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

@ -560,7 +560,6 @@ int mca_btl_mvapi_put( mca_btl_base_module_t* btl,
/* check for a send wqe */
if (OPAL_THREAD_ADD32(&endpoint->sd_wqe_lp,-1) < 0) {
OPAL_THREAD_ADD32(&endpoint->sd_wqe_lp,1);
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
opal_list_append(&endpoint->pending_frags_lp, (opal_list_item_t *)frag);

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

@ -77,9 +77,9 @@ static inline int mca_btl_mvapi_endpoint_post_send(
if (OPAL_THREAD_ADD32(&endpoint->sd_wqe_hp,-1) < 0) {
OPAL_THREAD_ADD32(&endpoint->sd_wqe_hp,1);
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_LOCK(&endpoint->endpoint_lock);*/
opal_list_append(&endpoint->pending_frags_hp, (opal_list_item_t *)frag);
OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);*/
return OMPI_SUCCESS;
/* check for a token */
@ -88,9 +88,9 @@ static inline int mca_btl_mvapi_endpoint_post_send(
OPAL_THREAD_ADD32(&endpoint->sd_wqe_hp,1);
OPAL_THREAD_ADD32(&endpoint->sd_tokens_hp,1);
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_LOCK(&endpoint->endpoint_lock);*/
opal_list_append(&endpoint->pending_frags_hp, (opal_list_item_t *)frag);
OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);*/
return OMPI_SUCCESS;
} else if( mca_btl_mvapi_component.use_srq &&
@ -117,9 +117,9 @@ static inline int mca_btl_mvapi_endpoint_post_send(
if (OPAL_THREAD_ADD32(&endpoint->sd_wqe_lp,-1) < 0) {
OPAL_THREAD_ADD32(&endpoint->sd_wqe_lp,1);
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_LOCK(&endpoint->endpoint_lock);*/
opal_list_append(&endpoint->pending_frags_lp, (opal_list_item_t *)frag);
OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);*/
return OMPI_SUCCESS;
/* check for a token */
@ -128,9 +128,9 @@ static inline int mca_btl_mvapi_endpoint_post_send(
OPAL_THREAD_ADD32(&endpoint->sd_wqe_lp,1);
OPAL_THREAD_ADD32(&endpoint->sd_tokens_lp,1);
OPAL_THREAD_LOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_LOCK(&endpoint->endpoint_lock);*/
opal_list_append(&endpoint->pending_frags_lp, (opal_list_item_t *)frag);
OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);
/*OPAL_THREAD_UNLOCK(&endpoint->endpoint_lock);*/
return OMPI_SUCCESS;
} else if(mca_btl_mvapi_component.use_srq &&

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

@ -144,8 +144,8 @@ struct mca_btl_base_endpoint_t {
int32_t rd_credits_lp; /**< number of low priority credits to return to peer */
int32_t sd_credits_hp; /**< number of send wqe entries being used to return credits */
int32_t sd_credits_lp; /**< number of send wqe entries being used to return credits */
int32_t sd_wqe_hp; /**< number of available send wqe entries */
int32_t sd_wqe_lp; /**< number of available send wqe entries */
int32_t sd_wqe_hp; /**< number of available high priority send wqe entries */
int32_t sd_wqe_lp; /**< number of available low priority send wqe entries */
uint32_t subnet;
#if 0