|
3 | 3 | * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana |
4 | 4 | * University Research and Technology |
5 | 5 | * Corporation. All rights reserved. |
6 | | - * Copyright (c) 2004-2014 The University of Tennessee and The University |
| 6 | + * Copyright (c) 2004-2016 The University of Tennessee and The University |
7 | 7 | * of Tennessee Research Foundation. All rights |
8 | 8 | * reserved. |
9 | 9 | * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, |
@@ -160,7 +160,6 @@ static mca_bml_base_endpoint_t *mca_bml_r2_allocate_endpoint (ompi_proc_t *proc) |
160 | 160 | mca_bml_base_btl_array_reserve(&bml_endpoint->btl_rdma, mca_bml_r2.num_btl_modules); |
161 | 161 | bml_endpoint->btl_max_send_size = -1; |
162 | 162 | bml_endpoint->btl_proc = proc; |
163 | | - proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML] = bml_endpoint; |
164 | 163 |
|
165 | 164 | bml_endpoint->btl_flags_or = 0; |
166 | 165 | return bml_endpoint; |
@@ -430,6 +429,12 @@ static int mca_bml_r2_add_proc (struct ompi_proc_t *proc) |
430 | 429 | /* compute metrics for registered btls */ |
431 | 430 | mca_bml_r2_compute_endpoint_metrics (bml_endpoint); |
432 | 431 |
|
| 432 | + /* do it last, for the lazy initialization check in bml_base_get* */ |
| 433 | +#if OPAL_ENABLE_THREAD_MULTI |
| 434 | + opal_atomic_wmb(); |
| 435 | +#endif /* OPAL_ENABLE_THREAD_MULTI */ |
| 436 | + proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML] = bml_endpoint; |
| 437 | + |
433 | 438 | return OMPI_SUCCESS; |
434 | 439 | } |
435 | 440 |
|
@@ -523,6 +528,7 @@ static int mca_bml_r2_add_procs( size_t nprocs, |
523 | 528 |
|
524 | 529 | if (NULL == bml_endpoint) { |
525 | 530 | bml_endpoint = mca_bml_r2_allocate_endpoint (proc); |
| 531 | + proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML] = bml_endpoint; |
526 | 532 | if (NULL == bml_endpoint) { |
527 | 533 | free(btl_endpoints); |
528 | 534 | free(new_procs); |
|
0 commit comments