1
1

Correctly handle the MPI_STATUSES_IGNORE, and trigger the MPI error handler and return the

same error code.

This commit was SVN r9206.
Этот коммит содержится в:
George Bosilca 2006-03-06 16:59:46 +00:00
родитель 0ef924769a
Коммит 679ccbcac7
2 изменённых файлов: 19 добавлений и 15 удалений

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

@ -38,7 +38,8 @@ int MPI_Testsome(int incount, MPI_Request requests[],
MPI_Status statuses[])
{
int rc, index, completed;
ompi_status_public_t status;
ompi_status_public_t *pstatus;
if ( MPI_PARAM_CHECK ) {
int rc = MPI_SUCCESS;
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@ -50,16 +51,19 @@ int MPI_Testsome(int incount, MPI_Request requests[],
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if( MPI_STATUSES_IGNORE != statuses ) {
pstatus = statuses;
} else {
pstatus = MPI_STATUS_IGNORE;
}
/* optimize this in the future */
rc = ompi_request_test_any(incount, requests, &index, &completed, &status);
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
rc = ompi_request_test_any(incount, requests, &index, &completed, pstatus);
if(completed) {
*outcount = (index == MPI_UNDEFINED) ? MPI_UNDEFINED : 1;
indices[0] = index;
statuses[0] = status;
} else {
*outcount = 0;
}
return MPI_SUCCESS;
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}

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

@ -39,9 +39,8 @@ int MPI_Waitsome(int incount, MPI_Request *requests,
int *outcount, int *indices,
MPI_Status *statuses)
{
int index;
int rc;
MPI_Status status;
int index, rc;
MPI_Status *pstatus;
if ( MPI_PARAM_CHECK ) {
int rc = MPI_SUCCESS;
@ -52,18 +51,19 @@ int MPI_Waitsome(int incount, MPI_Request *requests,
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if( MPI_STATUSES_IGNORE != statuses ) {
pstatus = statuses;
} else {
pstatus = MPI_STATUS_IGNORE;
}
/* optimize this in the future */
rc = ompi_request_wait_any( incount, requests, &index, &status );
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
if( MPI_UNDEFINED ==index ) {
rc = ompi_request_wait_any( incount, requests, &index, pstatus );
if( MPI_UNDEFINED == index ) {
*outcount = MPI_UNDEFINED;
} else {
*outcount = 1;
indices[0] = index;
if( MPI_STATUSES_IGNORE != statuses ) {
statuses[0] = status;
}
}
return MPI_SUCCESS;
OMPI_ERRHANDLER_RETURN(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}