1
1

Per request from Jeremiah Willcock, support the array-based MPI_TEST

and MPI_WAIT functions with a count of 0 (i.e., just return SUCCESS
and don't do anything).

This commit was SVN r26138.
Этот коммит содержится в:
Jeff Squyres 2012-03-14 14:36:04 +00:00
родитель 03ea0245f0
Коммит 1e92bc0fd1
6 изменённых файлов: 35 добавлений и 7 удалений

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

@ -60,12 +60,16 @@ int MPI_Testall(int count, MPI_Request requests[], int *flag,
}
}
}
if ((NULL == flag) || (0 > count)) {
if ((NULL == flag) || (count < 0)) {
rc = MPI_ERR_ARG;
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if (OPAL_UNLIKELY(0 == count)) {
return MPI_SUCCESS;
}
OPAL_CR_ENTER_LIBRARY();
if (OMPI_SUCCESS == ompi_request_test_all(count, requests, flag,

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

@ -59,12 +59,17 @@ int MPI_Testany(int count, MPI_Request requests[], int *indx, int *completed, MP
}
}
}
if ((NULL == indx) || (NULL == completed) || (0 > count)) {
if (((NULL == indx || NULL == completed) && count > 0) ||
count < 0) {
rc = MPI_ERR_ARG;
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if (OPAL_UNLIKELY(0 == count)) {
return MPI_SUCCESS;
}
OPAL_CR_ENTER_LIBRARY();
if (OMPI_SUCCESS == ompi_request_test_any(count, requests,

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

@ -61,12 +61,17 @@ int MPI_Testsome(int incount, MPI_Request *requests,
}
}
}
if ((NULL == outcount) || (NULL == indices) || (0 > incount)) {
rc = MPI_ERR_ARG;
if (((NULL == outcount || NULL == indices) && incount > 0) ||
incount < 0) {
return MPI_ERR_ARG;
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if (OPAL_UNLIKELY(0 == incount)) {
return OMPI_SUCCESS;
}
OPAL_CR_ENTER_LIBRARY();
if (OMPI_SUCCESS == ompi_request_test_some(incount, requests, outcount,

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

@ -59,12 +59,16 @@ int MPI_Waitall(int count, MPI_Request *requests, MPI_Status *statuses)
}
}
}
if (0 > count) {
if (count < 0) {
rc = MPI_ERR_ARG;
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if (OPAL_UNLIKELY(0 == count)) {
return MPI_SUCCESS;
}
OPAL_CR_ENTER_LIBRARY();
if (OMPI_SUCCESS == ompi_request_wait_all(count, requests, statuses)) {

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

@ -59,12 +59,17 @@ int MPI_Waitany(int count, MPI_Request *requests, int *indx, MPI_Status *status)
}
}
}
if ((NULL == indx) || (0 > count)) {
if ((NULL == indx && count > 0) ||
count < 0) {
rc = MPI_ERR_ARG;
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if (OPAL_UNLIKELY(0 == count)) {
return MPI_SUCCESS;
}
OPAL_CR_ENTER_LIBRARY();
if (OMPI_SUCCESS == ompi_request_wait_any(count, requests, indx, status)) {

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

@ -61,12 +61,17 @@ int MPI_Waitsome(int incount, MPI_Request *requests,
}
}
}
if ((NULL == outcount) || (NULL == indices) || (0 > incount)) {
if (((NULL == outcount || NULL == indices) && incount > 0) ||
incount < 0) {
rc = MPI_ERR_ARG;
}
OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
}
if (OPAL_UNLIKELY(0 == incount)) {
return MPI_SUCCESS;
}
OPAL_CR_ENTER_LIBRARY();
if (OMPI_SUCCESS == ompi_request_wait_some( incount, requests,