First step toward cancelation. We decided not to allow sends to be cancelled. For the others cases:
a completed request cannot be cancelled and a receive where the match was already realized cannot be cancelled as well. This commit was SVN r5295.
Этот коммит содержится в:
родитель
86b0630d31
Коммит
6df8cb0f02
@ -1,3 +1,4 @@
|
||||
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
||||
/*
|
||||
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
||||
* All rights reserved.
|
||||
@ -18,16 +19,34 @@
|
||||
|
||||
#include "pml_teg.h"
|
||||
|
||||
|
||||
int mca_pml_teg_cancel(ompi_request_t* request)
|
||||
{
|
||||
mca_pml_base_request_t* teg_request = (mca_pml_base_request_t*)request;
|
||||
|
||||
if( true == request->req_complete ) { /* way to late to cancel this one */
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
/* we dont cancel send requests by now */
|
||||
if( MCA_PML_REQUEST_SEND == teg_request->req_type ) {
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
request->req_status._cancelled = true;
|
||||
request->req_complete = true; /* mark it as completed so all the test/wait functions
|
||||
* on this particular request will finish */
|
||||
/* Now we have a problem if we are in a multi-threaded environment. We shou ld
|
||||
* broadcast the condition on the request in order to allow the other threa ds
|
||||
* to complete their test/wait functions.
|
||||
*/
|
||||
if(ompi_request_waiting) {
|
||||
ompi_condition_broadcast(&ompi_request_cond);
|
||||
}
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
int mca_pml_teg_cancelled(ompi_request_t* request, int* flag)
|
||||
{
|
||||
if(NULL != flag)
|
||||
*flag = 0;
|
||||
*flag = (true == request->req_status._cancelled ? 1 : 0);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user