1
1

* Start of fix for #258 -- implement cancel so that we pass down to the

MTL layer.  Needed to include more knowledge of which fragment was
  which since both thin and heavy requests can be canceled

This commit was SVN r11207.
Этот коммит содержится в:
Brian Barrett 2006-08-15 21:12:03 +00:00
родитель 66c53dccdc
Коммит 1cf4d0bd18
8 изменённых файлов: 65 добавлений и 26 удалений

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

@ -19,19 +19,55 @@
#include "pml_cm_recvreq.h"
int
mca_pml_cm_cancel(struct ompi_request_t *request, int flag)
mca_pml_cm_cancel(struct ompi_request_t *ompi_req, int flag)
{
/* Temporarily silence a compiler warning. Remove this when the
cancel is fully implemented */
#if 1
return OMPI_SUCCESS;
#else
int ret
/* mca_pml_cm_request_t *base_request = */
/* (mca_pml_cm_request_t*) request; */
/* ret = OMPI_MTL_CALL(cancel(ompi_mtl, */
/* &base_request->req_mtl, */
/* flag)); */
int ret;
mca_pml_cm_request_t *base_request =
(mca_pml_cm_request_t*) ompi_req;
mca_mtl_request_t *mtl_req = NULL;
switch (base_request->req_pml_type) {
case MCA_PML_CM_REQUEST_SEND_HEAVY:
{
mca_pml_cm_hvy_send_request_t *request =
(mca_pml_cm_hvy_send_request_t*) base_request;
mtl_req = &request->req_mtl;
}
break;
case MCA_PML_CM_REQUEST_SEND_THIN:
{
mca_pml_cm_thin_send_request_t *request =
(mca_pml_cm_thin_send_request_t*) base_request;
mtl_req = &request->req_mtl;
}
break;
case MCA_PML_CM_REQUEST_RECV_HEAVY:
{
mca_pml_cm_hvy_recv_request_t *request =
(mca_pml_cm_hvy_recv_request_t*) base_request;
mtl_req = &request->req_mtl;
}
break;
case MCA_PML_CM_REQUEST_RECV_THIN:
{
mca_pml_cm_thin_recv_request_t *request =
(mca_pml_cm_thin_recv_request_t*) base_request;
mtl_req = &request->req_mtl;
}
break;
default:
abort();
ret = OMPI_ERROR;
}
ret = OMPI_MTL_CALL(cancel(ompi_mtl,
mtl_req,
flag));
return ret;
#endif
}

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

@ -38,8 +38,6 @@ mca_pml_cm_irecv_init(void *addr,
MCA_PML_CM_HVY_RECV_REQUEST_INIT(recvreq, ompi_proc, comm, tag, src,
datatype, addr, count, true);
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV;
*request = (ompi_request_t*) recvreq;
return OMPI_SUCCESS;

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

@ -69,6 +69,7 @@ mca_pml_cm_thin_recv_request_construct(mca_pml_cm_thin_recv_request_t* recvreq)
recvreq->req_base.req_ompi.req_free = mca_pml_cm_thin_recv_request_free;
recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_THIN;
}
@ -80,6 +81,7 @@ mca_pml_cm_hvy_recv_request_construct(mca_pml_cm_hvy_recv_request_t* recvreq)
recvreq->req_base.req_ompi.req_free = mca_pml_cm_hvy_recv_request_free;
recvreq->req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
recvreq->req_base.req_pml_type = MCA_PML_CM_REQUEST_RECV_HEAVY;
}

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

@ -284,3 +284,6 @@ do { \
#endif


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

@ -28,11 +28,11 @@
* Type of request.
*/
typedef enum {
MCA_PML_CM_REQUEST_NULL,
MCA_PML_CM_REQUEST_SEND,
MCA_PML_CM_REQUEST_RECV,
MCA_PML_CM_REQUEST_IPROBE,
MCA_PML_CM_REQUEST_PROBE
MCA_PML_CM_REQUEST_SEND_HEAVY,
MCA_PML_CM_REQUEST_SEND_THIN,
MCA_PML_CM_REQUEST_RECV_HEAVY,
MCA_PML_CM_REQUEST_RECV_THIN,
MCA_PML_CM_REQUEST_NULL
} mca_pml_cm_request_type_t;

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

@ -37,8 +37,6 @@ mca_pml_cm_isend_init(void* buf,
MCA_PML_CM_HVY_SEND_REQUEST_INIT(sendreq, ompi_proc, comm, tag, dst,
datatype, sendmode, true, false, buf, count);
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND;
*request = (ompi_request_t*) sendreq;
return OMPI_SUCCESS;

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

@ -52,6 +52,7 @@ static void mca_pml_cm_thin_send_request_construct(mca_pml_cm_thin_send_request_
sendreq->req_mtl.completion_callback = mca_pml_cm_thin_send_request_completion;
sendreq->req_send.req_base.req_ompi.req_free = mca_pml_cm_thin_send_request_free;
sendreq->req_send.req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_THIN;
}
@ -62,6 +63,7 @@ static void mca_pml_cm_hvy_send_request_construct(mca_pml_cm_hvy_send_request_t*
sendreq->req_mtl.completion_callback = mca_pml_cm_hvy_send_request_completion;
sendreq->req_send.req_base.req_ompi.req_free = mca_pml_cm_hvy_send_request_free;
sendreq->req_send.req_base.req_ompi.req_cancel = mca_pml_cm_cancel;
sendreq->req_send.req_base.req_pml_type = MCA_PML_CM_REQUEST_SEND_HEAVY;
}

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

@ -70,7 +70,7 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
/* allocate a new request */
switch (pml_request->req_pml_type) {
case MCA_PML_CM_REQUEST_SEND: {
case MCA_PML_CM_REQUEST_SEND_HEAVY: {
mca_pml_cm_hvy_send_request_t* sendreq = (mca_pml_cm_hvy_send_request_t*) pml_request;
rc = mca_pml_cm_isend_init(
sendreq->req_addr,
@ -83,7 +83,7 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
&request);
break;
}
case MCA_PML_CM_REQUEST_RECV:{
case MCA_PML_CM_REQUEST_RECV_HEAVY: {
mca_pml_cm_hvy_recv_request_t* recvreq = (mca_pml_cm_hvy_recv_request_t*) pml_request;
rc = mca_pml_cm_irecv_init(
recvreq->req_addr,
@ -113,7 +113,7 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
/* start the request */
switch (pml_request->req_pml_type) {
case MCA_PML_CM_REQUEST_SEND:
case MCA_PML_CM_REQUEST_SEND_HEAVY:
{
mca_pml_cm_hvy_send_request_t* sendreq =
(mca_pml_cm_hvy_send_request_t*)pml_request;
@ -122,7 +122,7 @@ mca_pml_cm_start(size_t count, ompi_request_t** requests)
return rc;
break;
}
case MCA_PML_CM_REQUEST_RECV:
case MCA_PML_CM_REQUEST_RECV_HEAVY:
{
mca_pml_cm_hvy_recv_request_t* recvreq =
(mca_pml_cm_hvy_recv_request_t*)pml_request;