|
16 | 16 | * Copyright (c) 2016 Los Alamos National Security, LLC. All rights |
17 | 17 | * reserved. |
18 | 18 | * Copyright (c) 2016 Mellanox Technologies. All rights reserved. |
| 19 | + * Copyright (c) 2016 Research Organization for Information Science |
| 20 | + * and Technology (RIST). All rights reserved. |
19 | 21 | * $COPYRIGHT$ |
20 | 22 | * |
21 | 23 | * Additional copyrights may follow |
@@ -89,6 +91,11 @@ int ompi_request_default_wait_any(size_t count, |
89 | 91 | ompi_request_t *request=NULL; |
90 | 92 | ompi_wait_sync_t sync; |
91 | 93 |
|
| 94 | + if (OPAL_UNLIKELY(0 == count)) { |
| 95 | + *index = MPI_UNDEFINED; |
| 96 | + return OMPI_SUCCESS; |
| 97 | + } |
| 98 | + |
92 | 99 | WAIT_SYNC_INIT(&sync, 1); |
93 | 100 |
|
94 | 101 | num_requests_null_inactive = 0; |
@@ -197,6 +204,10 @@ int ompi_request_default_wait_all( size_t count, |
197 | 204 | int mpi_error = OMPI_SUCCESS; |
198 | 205 | ompi_wait_sync_t sync; |
199 | 206 |
|
| 207 | + if (OPAL_UNLIKELY(0 == count)) { |
| 208 | + return OMPI_SUCCESS; |
| 209 | + } |
| 210 | + |
200 | 211 | WAIT_SYNC_INIT(&sync, count); |
201 | 212 | rptr = requests; |
202 | 213 | for (i = 0; i < count; i++) { |
@@ -374,6 +385,11 @@ int ompi_request_default_wait_some(size_t count, |
374 | 385 | ompi_wait_sync_t sync; |
375 | 386 | size_t sync_sets = 0, sync_unsets = 0; |
376 | 387 |
|
| 388 | + if (OPAL_UNLIKELY(0 == count)) { |
| 389 | + *outcount = MPI_UNDEFINED; |
| 390 | + return OMPI_SUCCESS; |
| 391 | + } |
| 392 | + |
377 | 393 | WAIT_SYNC_INIT(&sync, 1); |
378 | 394 |
|
379 | 395 | *outcount = 0; |
|
0 commit comments