Forgot to add new file in the last commit.
Mark ME as invalid once we see a completion event, and look for events before trying to unlink. This commit was SVN r26198.
Этот коммит содержится в:
родитель
0e91084385
Коммит
2a26d0f9a2
65
ompi/mca/mtl/portals4/mtl_portals4_cancel.c
Обычный файл
65
ompi/mca/mtl/portals4/mtl_portals4_cancel.c
Обычный файл
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include <portals4.h>
|
||||
|
||||
#include "mtl_portals4.h"
|
||||
#include "mtl_portals4_request.h"
|
||||
|
||||
|
||||
int
|
||||
ompi_mtl_portals4_cancel(struct mca_mtl_base_module_t* mtl,
|
||||
mca_mtl_request_t *mtl_request,
|
||||
int flag)
|
||||
{
|
||||
ompi_mtl_portals4_base_request_t *base_request =
|
||||
(ompi_mtl_portals4_base_request_t*) mtl_request;
|
||||
int ret;
|
||||
|
||||
switch (base_request->type) {
|
||||
case portals4_req_isend:
|
||||
/* can't cancel sends yet */
|
||||
break;
|
||||
|
||||
case portals4_req_recv:
|
||||
{
|
||||
ompi_mtl_portals4_recv_request_t *recvreq =
|
||||
(ompi_mtl_portals4_recv_request_t*) base_request;
|
||||
|
||||
/* Cancel receive requests if not yet matched (otherwise,
|
||||
they are guaranteed to complete and don't need to be
|
||||
cancelled). If the me_h is already INVALID, that means
|
||||
that not only has matching occurred, but the
|
||||
communication end event has been seen. If MEUnlink
|
||||
fails, that means that either something bad has
|
||||
happened or the ME is in use (meaning no cancel). Need
|
||||
to drain queue to make sure there isn't a pending
|
||||
receive completion event... */
|
||||
ompi_mtl_portals4_progress();
|
||||
|
||||
if (PTL_INVALID_HANDLE != recvreq->me_h) {
|
||||
ret = PtlMEUnlink(recvreq->me_h);
|
||||
if (PTL_OK == ret) {
|
||||
recvreq->super.super.ompi_req->req_status._cancelled = true;
|
||||
recvreq->super.super.completion_callback(&recvreq->super.super);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,8 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
|
||||
goto callback_error;
|
||||
}
|
||||
|
||||
ptl_request->me_h = PTL_INVALID_HANDLE;
|
||||
|
||||
msg_length = MTL_PORTALS4_GET_LENGTH(ev->hdr_data);
|
||||
ptl_request->super.super.ompi_req->req_status.MPI_SOURCE =
|
||||
MTL_PORTALS4_GET_SOURCE(ev->match_bits);
|
||||
@ -179,6 +181,8 @@ ompi_mtl_portals4_recv_progress(ptl_event_t *ev,
|
||||
goto callback_error;
|
||||
}
|
||||
|
||||
ptl_request->me_h = PTL_INVALID_HANDLE;
|
||||
|
||||
msg_length = MTL_PORTALS4_GET_LENGTH(ev->hdr_data);
|
||||
ptl_request->super.super.ompi_req->req_status.MPI_SOURCE =
|
||||
MTL_PORTALS4_GET_SOURCE(ev->match_bits);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user