mtl_mxm: support canceling messages
This commit was SVN r26256.
Этот коммит содержится в:
родитель
fe25b8704b
Коммит
34acf769d4
@ -14,23 +14,13 @@
|
||||
int ompi_mtl_mxm_cancel(struct mca_mtl_base_module_t* mtl,
|
||||
struct mca_mtl_request_t *mtl_request, int flag)
|
||||
{
|
||||
|
||||
mxm_error_t err;
|
||||
mca_mtl_mxm_request_t *mtl_mxm_request = (mca_mtl_mxm_request_t*) mtl_request;
|
||||
mxm_error_t err;
|
||||
|
||||
err = mxm_req_cancel(&mtl_mxm_request->mxm.base);
|
||||
if (MXM_OK == err) {
|
||||
err = mxm_req_test(&mtl_mxm_request->mxm.base);
|
||||
if (MXM_OK == err) {
|
||||
mtl_request->ompi_req->req_status._cancelled = true;
|
||||
mtl_mxm_request->super.completion_callback(&mtl_mxm_request->super);
|
||||
return OMPI_SUCCESS;
|
||||
} else {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
} else if (MXM_ERR_NO_MESSAGE == err) {
|
||||
return OMPI_SUCCESS;
|
||||
if ((err != MXM_OK) && (err != MXM_ERR_NO_PROGRESS)) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
return OMPI_ERROR;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
@ -27,9 +27,9 @@ int ompi_mtl_mxm_iprobe(struct mca_mtl_base_module_t* mtl,
|
||||
if (MXM_OK == err) {
|
||||
*flag = 1;
|
||||
if (MPI_STATUS_IGNORE != status) {
|
||||
ompi_mtl_mxm_to_mpi_status(err, status);
|
||||
status->MPI_SOURCE = req.completion.sender_imm;
|
||||
status->MPI_TAG = req.completion.sender_tag;
|
||||
status->MPI_ERROR = ompi_mtl_mxm_to_mpi_status(err);
|
||||
status->_ucount = req.completion.sender_len;
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
|
@ -25,9 +25,9 @@ static void ompi_mtl_mxm_recv_completion_cb(void *context)
|
||||
mxm_recv_req_t *mxm_recv_req = &req->mxm.recv;
|
||||
|
||||
/* Set completion status and envelope */
|
||||
ompi_mtl_mxm_to_mpi_status(mxm_recv_req->base.error, &ompi_req->req_status);
|
||||
ompi_req->req_status.MPI_TAG = mxm_recv_req->completion.sender_tag;
|
||||
ompi_req->req_status.MPI_SOURCE = mxm_recv_req->completion.sender_imm;
|
||||
ompi_req->req_status.MPI_ERROR = ompi_mtl_mxm_to_mpi_status(mxm_recv_req->base.error);
|
||||
ompi_req->req_status._ucount = mxm_recv_req->completion.actual_len;
|
||||
|
||||
/* Copy data and free the buffer */
|
||||
|
@ -19,14 +19,14 @@
|
||||
|
||||
static void ompi_mtl_mxm_send_completion_cb(void *context)
|
||||
{
|
||||
mca_mtl_mxm_request_t *mtl_mxm_request = context;
|
||||
mca_mtl_mxm_request_t *mtl_mxm_request = context;
|
||||
|
||||
if (mtl_mxm_request->free_after) {
|
||||
free(mtl_mxm_request->buf);
|
||||
}
|
||||
|
||||
mtl_mxm_request->super.ompi_req->req_status.MPI_ERROR = ompi_mtl_mxm_to_mpi_status(mtl_mxm_request->mxm.base.error);
|
||||
|
||||
ompi_mtl_mxm_to_mpi_status(mtl_mxm_request->mxm.base.error,
|
||||
&mtl_mxm_request->super.ompi_req->req_status);
|
||||
mtl_mxm_request->super.completion_callback(&mtl_mxm_request->super);
|
||||
}
|
||||
|
||||
|
@ -58,13 +58,20 @@ static inline mxm_mq_h ompi_mtl_mxm_mq_lookup(struct ompi_communicator_t* comm)
|
||||
return (mxm_mq_h)comm->c_pml_comm;
|
||||
}
|
||||
|
||||
static inline int ompi_mtl_mxm_to_mpi_status(mxm_error_t status) {
|
||||
if (MXM_OK == status) {
|
||||
return OMPI_SUCCESS;
|
||||
} else if (MXM_ERR_MESSAGE_TRUNCATED == status) {
|
||||
return MPI_ERR_TRUNCATE;
|
||||
} else {
|
||||
return MPI_ERR_INTERN;
|
||||
static inline void ompi_mtl_mxm_to_mpi_status(mxm_error_t status, ompi_status_public_t *ompi_status) {
|
||||
switch (status) {
|
||||
case MXM_OK:
|
||||
ompi_status->MPI_ERROR = OMPI_SUCCESS;
|
||||
break;
|
||||
case MXM_ERR_CANCELED:
|
||||
ompi_status->_cancelled = true;
|
||||
break;
|
||||
case MXM_ERR_MESSAGE_TRUNCATED:
|
||||
ompi_status->MPI_ERROR = MPI_ERR_TRUNCATE;
|
||||
break;
|
||||
default:
|
||||
ompi_status->MPI_ERROR = MPI_ERR_INTERN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user