|
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;
|
@@ -192,6 +199,10 @@ int ompi_request_default_wait_all( size_t count,
|
192 | 199 | int mpi_error = OMPI_SUCCESS;
|
193 | 200 | ompi_wait_sync_t sync;
|
194 | 201 |
|
| 202 | + if (OPAL_UNLIKELY(0 == count)) { |
| 203 | + return OMPI_SUCCESS; |
| 204 | + } |
| 205 | + |
195 | 206 | WAIT_SYNC_INIT(&sync, count);
|
196 | 207 | rptr = requests;
|
197 | 208 | for (i = 0; i < count; i++) {
|
@@ -361,6 +372,11 @@ int ompi_request_default_wait_some(size_t count,
|
361 | 372 | ompi_wait_sync_t sync;
|
362 | 373 | size_t sync_sets = 0, sync_unsets = 0;
|
363 | 374 |
|
| 375 | + if (OPAL_UNLIKELY(0 == count)) { |
| 376 | + *outcount = MPI_UNDEFINED; |
| 377 | + return OMPI_SUCCESS; |
| 378 | + } |
| 379 | + |
364 | 380 | WAIT_SYNC_INIT(&sync, 1);
|
365 | 381 |
|
366 | 382 | *outcount = 0;
|
|
0 commit comments