1
1

Modified some of lines to be 76 columns only to fit 80x24 screens.

A minor point to folks who like long lines: 
  Our coding style is shiftwidth=4 textwidth=76

This commit was SVN r1801.
Этот коммит содержится в:
Weikuan Yu 2004-07-25 16:15:52 +00:00
родитель e6fead1328
Коммит e6ee369852

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

@ -14,74 +14,75 @@
#include "pml_teg_proc.h" #include "pml_teg_proc.h"
#include "pml_teg_ptl.h" #include "pml_teg_ptl.h"
#define MCA_PML_TEG_SEND_REQUEST_ALLOC( \ #define MCA_PML_TEG_SEND_REQUEST_ALLOC( \
comm, \ comm, \
dst, \ dst, \
sendreq, \ sendreq, \
rc) \ rc) \
{ \ { \
mca_pml_proc_t *proc = mca_pml_teg_proc_lookup_remote(comm,dst); \ mca_pml_proc_t *proc = mca_pml_teg_proc_lookup_remote(comm,dst); \
mca_ptl_proc_t* ptl_proc; \ mca_ptl_proc_t* ptl_proc; \
mca_pml_base_ptl_t* ptl_base; \ mca_pml_base_ptl_t* ptl_base; \
\ \
THREAD_SCOPED_LOCK(&proc->proc_lock, \ THREAD_SCOPED_LOCK(&proc->proc_lock, \
(ptl_proc = mca_ptl_array_get_next(&proc->proc_ptl_first))); \ (ptl_proc = mca_ptl_array_get_next(&proc->proc_ptl_first))); \
ptl_base = ptl_proc->ptl_base; \ ptl_base = ptl_proc->ptl_base; \
/* \ /* \
* check to see if there is a cache of send requests associated with \ * check to see if there is a cache of send requests associated with \
* this ptl - if so try the allocation from there. \ * this ptl - if so try the allocation from there. \
*/ \ */ \
if(NULL != ptl_base) { \ if(NULL != ptl_base) { \
OMPI_THREAD_LOCK(&ptl_base->ptl_cache_lock); \ OMPI_THREAD_LOCK(&ptl_base->ptl_cache_lock); \
sendreq = (mca_pml_base_send_request_t*) \ sendreq = (mca_pml_base_send_request_t*) \
ompi_list_remove_first(&ptl_base->ptl_cache); \ ompi_list_remove_first(&ptl_base->ptl_cache); \
OMPI_THREAD_UNLOCK(&ptl_base->ptl_cache_lock); \ OMPI_THREAD_UNLOCK(&ptl_base->ptl_cache_lock); \
if(NULL != sendreq) { \ if(NULL != sendreq) { \
rc = OMPI_SUCCESS; \ rc = OMPI_SUCCESS; \
} else { \ } else { \
mca_ptl_t* ptl = ptl_base->ptl; \ mca_ptl_t* ptl = ptl_base->ptl; \
ompi_list_item_t* item; \ ompi_list_item_t* item; \
OMPI_FREE_LIST_WAIT(&mca_pml_teg.teg_send_requests, item, rc); \ OMPI_FREE_LIST_WAIT(&mca_pml_teg.teg_send_requests, item, rc); \
sendreq = (mca_pml_base_send_request_t*)item; \ sendreq = (mca_pml_base_send_request_t*)item; \
sendreq->req_ptl = ptl; \ sendreq->req_ptl = ptl; \
sendreq->req_peer = ptl_proc->ptl_peer; \ sendreq->req_peer = ptl_proc->ptl_peer; \
ptl->ptl_request_init(ptl, sendreq); \ ptl->ptl_request_init(ptl, sendreq); \
} \ } \
\ \
/* otherwise - take the allocation from the global list */ \ /* otherwise - take the allocation from the global list */ \
} else { \ } else { \
ompi_list_item_t* item; \ ompi_list_item_t* item; \
OMPI_FREE_LIST_WAIT(&mca_pml_teg.teg_send_requests, item, rc); \ OMPI_FREE_LIST_WAIT(&mca_pml_teg.teg_send_requests, item, rc); \
sendreq = (mca_pml_base_send_request_t*)item; \ sendreq = (mca_pml_base_send_request_t*)item; \
sendreq->req_ptl = ptl_proc->ptl; \ sendreq->req_ptl = ptl_proc->ptl; \
sendreq->req_peer = ptl_proc->ptl_peer; \ sendreq->req_peer = ptl_proc->ptl_peer; \
} \ } \
} }
#define MCA_PML_TEG_SEND_REQUEST_RETURN(request) \ #define MCA_PML_TEG_SEND_REQUEST_RETURN(request) \
{ \ { \
mca_ptl_t* ptl = sendreq->req_ptl; \ mca_ptl_t* ptl = sendreq->req_ptl; \
mca_pml_base_ptl_t* ptl_base = ptl->ptl_base; \ mca_pml_base_ptl_t* ptl_base = ptl->ptl_base; \
/* \ /* \
* If there is a cache associated with the ptl - first attempt \ * If there is a cache associated with the ptl - first attempt \
* to return the send descriptor to the cache. \ * to return the send descriptor to the cache. \
*/ \ */ \
if(NULL != ptl->ptl_base) { \ if(NULL != ptl->ptl_base) { \
OMPI_THREAD_LOCK(&ptl_base->ptl_cache_lock); \ OMPI_THREAD_LOCK(&ptl_base->ptl_cache_lock); \
if(ompi_list_get_size(&ptl_base->ptl_cache) >= ptl_base->ptl_cache_size) { \ if(ompi_list_get_size(&ptl_base->ptl_cache) >= ptl_base->ptl_cache_) {\
/* if cache limit is exceeded - return to global pool */ \ /* if cache limit is exceeded - return to global pool */ \
ptl->ptl_request_fini(ptl, sendreq); \ ptl->ptl_request_fini(ptl, sendreq); \
OMPI_FREE_LIST_RETURN( \ OMPI_FREE_LIST_RETURN(&mca_pml_teg.teg_send_requests, \
&mca_pml_teg.teg_send_requests, (ompi_list_item_t*)sendreq); \ (ompi_list_item_t*)sendreq); \
} else { \ } else { \
ompi_list_prepend(&ptl_base->ptl_cache, (ompi_list_item_t*)sendreq); \ ompi_list_prepend(&ptl_base->ptl_cache, \
} \ (ompi_list_item_t*)sendreq); \
OMPI_THREAD_UNLOCK(&ptl_base->ptl_cache_lock); \ } \
} else { \ OMPI_THREAD_UNLOCK(&ptl_base->ptl_cache_lock); \
OMPI_FREE_LIST_RETURN( \ } else { \
&mca_pml_teg.teg_send_requests, (ompi_list_item_t*)request); \ OMPI_FREE_LIST_RETURN( \
} \ &mca_pml_teg.teg_send_requests, (ompi_list_item_t*)request); \
} \
} }