ompi/mpi/c/request_get_status.c (MPI_Request_get_status): If
opal_progress is called then check the status of the request before returning. opal_progress is called only once. This logic parallels MPI_Test (ompi_request_default_test). Thanks to Shaun Jackman for submitting the patch. This commit was SVN r23215.
Этот коммит содержится в:
родитель
464bd8c56e
Коммит
0061f2170d
@ -9,7 +9,7 @@
|
||||
* University of Stuttgart. All rights reserved.
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -44,6 +44,10 @@ static const char FUNC_NAME[] = "MPI_Request_get_status";
|
||||
int MPI_Request_get_status(MPI_Request request, int *flag,
|
||||
MPI_Status *status)
|
||||
{
|
||||
#if OPAL_ENABLE_PROGRESS_THREADS == 0
|
||||
int do_it_once = 0;
|
||||
#endif
|
||||
|
||||
MEMCHECKER(
|
||||
memchecker_request(&request);
|
||||
);
|
||||
@ -60,6 +64,9 @@ int MPI_Request_get_status(MPI_Request request, int *flag,
|
||||
}
|
||||
}
|
||||
|
||||
#if OPAL_ENABLE_PROGRESS_THREADS == 0
|
||||
recheck_request_status:
|
||||
#endif
|
||||
opal_atomic_mb();
|
||||
if( (request == MPI_REQUEST_NULL) || (request->req_state == OMPI_REQUEST_INACTIVE) ) {
|
||||
*flag = true;
|
||||
@ -81,9 +88,16 @@ int MPI_Request_get_status(MPI_Request request, int *flag,
|
||||
}
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
*flag = false;
|
||||
#if OPAL_ENABLE_PROGRESS_THREADS == 0
|
||||
opal_progress();
|
||||
if( 0 == do_it_once ) {
|
||||
/* If we run the opal_progress then check the status of the
|
||||
request before leaving. We will call the opal_progress only
|
||||
once per call. */
|
||||
opal_progress();
|
||||
do_it_once++;
|
||||
goto recheck_request_status;
|
||||
}
|
||||
#endif
|
||||
*flag = false;
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user