1
1

Correct the thin and heavy requests management for the CM PML.

This commit was SVN r15361.
Этот коммит содержится в:
George Bosilca 2007-07-11 15:10:01 +00:00
родитель ef7d17d814
Коммит 9ed3ede73e
4 изменённых файлов: 40 добавлений и 34 удалений

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

@ -45,8 +45,7 @@ mca_pml_cm_recv_request_free(struct ompi_request_t** request)
}
static void
mca_pml_cm_recv_request_completion(struct mca_mtl_request_t *mtl_request)
void mca_pml_cm_recv_request_completion(struct mca_mtl_request_t *mtl_request)
{
mca_pml_cm_request_t *base_request =
(mca_pml_cm_request_t*) mtl_request->ompi_req;
@ -60,9 +59,6 @@ mca_pml_cm_recv_request_completion(struct mca_mtl_request_t *mtl_request)
static void
mca_pml_cm_recv_request_construct(mca_pml_cm_thin_recv_request_t* recvreq)
{
recvreq->req_mtl.ompi_req = (ompi_request_t*) recvreq;
recvreq->req_mtl.completion_callback = mca_pml_cm_recv_request_completion;
recvreq->req_base.req_ompi.req_free = mca_pml_cm_recv_request_free;
recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
OBJ_CONSTRUCT( &(recvreq->req_base.req_convertor), ompi_convertor_t );

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

@ -51,20 +51,24 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_recv_request_t);
* @param rc (OUT) OMPI_SUCCESS or error status on failure.
* @return Receive request.
*/
#define MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, rc) \
do { \
ompi_free_list_item_t*item; \
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
recvreq = (mca_pml_cm_thin_recv_request_t*) item; \
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_THIN; \
#define MCA_PML_CM_THIN_RECV_REQUEST_ALLOC(recvreq, rc) \
do { \
ompi_free_list_item_t*item; \
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
recvreq = (mca_pml_cm_thin_recv_request_t*) item; \
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_THIN; \
recvreq->req_mtl.ompi_req = (ompi_request_t*) recvreq; \
recvreq->req_mtl.completion_callback = mca_pml_cm_recv_request_completion; \
} while (0)
#define MCA_PML_CM_HVY_RECV_REQUEST_ALLOC(recvreq, rc) \
do { \
ompi_free_list_item_t*item; \
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
recvreq = (mca_pml_cm_hvy_recv_request_t*) item; \
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_HEAVY; \
#define MCA_PML_CM_HVY_RECV_REQUEST_ALLOC(recvreq, rc) \
do { \
ompi_free_list_item_t*item; \
OMPI_FREE_LIST_GET(&mca_pml_base_recv_requests, item, rc); \
recvreq = (mca_pml_cm_hvy_recv_request_t*) item; \
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_HEAVY; \
recvreq->req_mtl.ompi_req = (ompi_request_t*) recvreq; \
recvreq->req_mtl.completion_callback = mca_pml_cm_recv_request_completion; \
} while (0)
@ -290,6 +294,7 @@ do { \
(ompi_free_list_item_t*)(recvreq)); \
}
extern void mca_pml_cm_recv_request_completion(struct mca_mtl_request_t *mtl_request);
#endif

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

@ -51,7 +51,7 @@ mca_pml_cm_send_request_free(struct ompi_request_t** request)
return OMPI_SUCCESS;
}
static void
void
mca_pml_cm_send_request_completion(struct mca_mtl_request_t *mtl_request)
{
mca_pml_cm_send_request_t *base_request =
@ -66,8 +66,6 @@ mca_pml_cm_send_request_completion(struct mca_mtl_request_t *mtl_request)
static void mca_pml_cm_send_request_construct(mca_pml_cm_hvy_send_request_t* sendreq)
{
/* no need to reinit for every send -- never changes */
sendreq->req_mtl.ompi_req = (ompi_request_t*) sendreq;
sendreq->req_mtl.completion_callback = mca_pml_cm_send_request_completion;
sendreq->req_send.req_base.req_ompi.req_free = mca_pml_cm_send_request_free;
sendreq->req_send.req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
}

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

@ -58,21 +58,23 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
#define MCA_PML_CM_THIN_SEND_REQUEST_ALLOC(sendreq, comm, dst, \
ompi_proc, rc) \
do { \
ompi_free_list_item_t* item; \
ompi_proc = ompi_comm_peer_lookup( comm, dst ); \
do { \
ompi_free_list_item_t* item; \
ompi_proc = ompi_comm_peer_lookup( comm, dst ); \
\
if(OPAL_UNLIKELY(NULL == ompi_proc)) { \
rc = OMPI_ERR_OUT_OF_RESOURCE; \
sendreq = NULL; \
} else { \
rc = OMPI_SUCCESS; \
OMPI_FREE_LIST_WAIT(&mca_pml_base_send_requests, \
item, rc); \
sendreq = (mca_pml_cm_thin_send_request_t*)item; \
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_THIN; \
} \
} while(0)
if(OPAL_UNLIKELY(NULL == ompi_proc)) { \
rc = OMPI_ERR_OUT_OF_RESOURCE; \
sendreq = NULL; \
} else { \
rc = OMPI_SUCCESS; \
OMPI_FREE_LIST_WAIT(&mca_pml_base_send_requests, \
item, rc); \
sendreq = (mca_pml_cm_thin_send_request_t*)item; \
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_THIN; \
sendreq->req_mtl.ompi_req = (ompi_request_t*) sendreq; \
sendreq->req_mtl.completion_callback = mca_pml_cm_send_request_completion; \
} \
} while(0)
#define MCA_PML_CM_HVY_SEND_REQUEST_ALLOC(sendreq, comm, dst, \
@ -89,6 +91,8 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(mca_pml_cm_hvy_send_request_t);
item, rc); \
sendreq = (mca_pml_cm_hvy_send_request_t*)item; \
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_HEAVY; \
sendreq->req_mtl.ompi_req = (ompi_request_t*) sendreq; \
sendreq->req_mtl.completion_callback = mca_pml_cm_send_request_completion; \
} \
}
@ -351,4 +355,7 @@ do { \
(ompi_free_list_item_t*)sendreq); \
}
extern void
mca_pml_cm_send_request_completion(struct mca_mtl_request_t *mtl_request);
#endif