1
1

1. Do not try to get the remote proc if we will not use it

2. Always release the request lock before calling FREE ...

This commit was SVN r5753.
Этот коммит содержится в:
George Bosilca 2005-05-19 06:53:57 +00:00
родитель e9cc404c33
Коммит a5fc2762dd

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

@ -80,9 +80,7 @@ OBJ_CLASS_INSTANCE(
int mca_pml_uniq_send_request_schedule(mca_ptl_base_send_request_t* req)
{
ompi_proc_t *proc = ompi_comm_peer_lookup(req->req_send.req_base.req_comm, req->req_send.req_base.req_peer);
mca_pml_proc_t* proc_pml = proc->proc_pml;
int send_count = 0, rc;
int rc;
size_t bytes_remaining;
/*
@ -92,6 +90,9 @@ int mca_pml_uniq_send_request_schedule(mca_ptl_base_send_request_t* req)
* the scheduling logic once for every call.
*/
if(OMPI_THREAD_ADD32(&req->req_lock,1) == 1) {
mca_pml_proc_t* proc_pml = mca_pml_uniq_proc_lookup_remote( req->req_send.req_base.req_comm,
req->req_send.req_base.req_peer );
#if PML_UNIQ_ACCEPT_NEXT_PTL
mca_ptl_proc_t* ptl_proc = &(proc_pml->proc_ptl_next);
#else
@ -109,24 +110,22 @@ int mca_pml_uniq_send_request_schedule(mca_ptl_base_send_request_t* req)
rc = ptl->ptl_put(ptl, ptl_proc->ptl_peer, req, req->req_offset, bytes_remaining, 0);
if(rc == OMPI_SUCCESS) {
send_count++;
bytes_remaining = req->req_send.req_bytes_packed - req->req_offset;
}
/* unable to complete send - queue for later */
if(send_count == 0) {
} else { /* unable to complete send - queue for later */
OMPI_THREAD_LOCK(&mca_pml_uniq.uniq_lock);
ompi_list_append(&mca_pml_uniq.uniq_send_pending, (ompi_list_item_t*)req);
OMPI_THREAD_UNLOCK(&mca_pml_uniq.uniq_lock);
req->req_lock = 0;
return OMPI_ERR_OUT_OF_RESOURCE;
}
OMPI_THREAD_ADD32(&req->req_lock,-1);
/* free the request if completed while in the scheduler */
if (req->req_send.req_base.req_free_called && req->req_send.req_base.req_pml_complete) {
MCA_PML_UNIQ_FREE((ompi_request_t**)&req);
}
return OMPI_SUCCESS;
}
OMPI_THREAD_ADD32(&req->req_lock,-1);
return OMPI_SUCCESS;
}