|
12 | 12 | * reserved. |
13 | 13 | * Copyright (c) 2010 IBM Corporation. All rights reserved. |
14 | 14 | * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. |
15 | | - * Copyright (c) 2015 Research Organization for Information Science |
| 15 | + * Copyright (c) 2015-2016 Research Organization for Information Science |
16 | 16 | * and Technology (RIST). All rights reserved. |
17 | 17 | * $COPYRIGHT$ |
18 | 18 | * |
@@ -213,15 +213,17 @@ ompi_osc_pt2pt_start(ompi_group_t *group, |
213 | 213 | "ompi_osc_pt2pt_start entering with group size %d...", |
214 | 214 | group_size)); |
215 | 215 |
|
216 | | - ranks = get_comm_ranks(module, module->sc_group); |
217 | | - if (NULL == ranks) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; |
| 216 | + if (OPAL_LIKELY(0 < group_size)) { |
| 217 | + ranks = get_comm_ranks(module, module->sc_group); |
| 218 | + if (NULL == ranks) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; |
218 | 219 |
|
219 | | - for (int i = 0 ; i < group_size ; ++i) { |
220 | | - /* when the post comes in we will be in an access epoch with this proc */ |
221 | | - module->peers[ranks[i]].access_epoch = true; |
| 220 | + for (int i = 0 ; i < group_size ; ++i) { |
| 221 | + /* when the post comes in we will be in an access epoch with this proc */ |
| 222 | + module->peers[ranks[i]].access_epoch = true; |
| 223 | + } |
| 224 | + free (ranks); |
222 | 225 | } |
223 | 226 |
|
224 | | - free (ranks); |
225 | 227 |
|
226 | 228 | OPAL_LIST_FOREACH_SAFE(pending_post, next, &module->pending_posts, ompi_osc_pt2pt_pending_post_t) { |
227 | 229 | ompi_proc_t *pending_proc = ompi_comm_peer_lookup (module->comm, pending_post->rank); |
@@ -284,8 +286,10 @@ ompi_osc_pt2pt_complete(ompi_win_t *win) |
284 | 286 | return OMPI_ERR_RMA_SYNC; |
285 | 287 | } |
286 | 288 |
|
287 | | - ranks = get_comm_ranks(module, module->sc_group); |
288 | | - if (NULL == ranks) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; |
| 289 | + if (OPAL_LIKELY(0 < ompi_group_size(module->sc_group))) { |
| 290 | + ranks = get_comm_ranks(module, module->sc_group); |
| 291 | + if (NULL == ranks) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; |
| 292 | + } |
289 | 293 |
|
290 | 294 | OPAL_THREAD_LOCK(&module->lock); |
291 | 295 |
|
@@ -375,9 +379,7 @@ ompi_osc_pt2pt_complete(ompi_win_t *win) |
375 | 379 |
|
376 | 380 | OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, |
377 | 381 | "ompi_osc_pt2pt_complete complete")); |
378 | | - free (ranks); |
379 | | - |
380 | | - return OMPI_SUCCESS; |
| 382 | + ret = OMPI_SUCCESS; |
381 | 383 |
|
382 | 384 | cleanup: |
383 | 385 | if (NULL != ranks) free(ranks); |
@@ -428,6 +430,10 @@ ompi_osc_pt2pt_post(ompi_group_t *group, |
428 | 430 | OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, |
429 | 431 | "sending post messages")); |
430 | 432 |
|
| 433 | + if (OPAL_UNLIKELY(0 == ompi_group_size(module->pw_group))) { |
| 434 | + return OMPI_SUCCESS; |
| 435 | + } |
| 436 | + |
431 | 437 | ranks = get_comm_ranks(module, module->pw_group); |
432 | 438 | if (NULL == ranks) { |
433 | 439 | return OMPI_ERR_OUT_OF_RESOURCE; |
|
0 commit comments