| 
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;  | 
@@ -428,6 +427,12 @@ static int mca_bml_r2_add_proc (struct ompi_proc_t *proc)  | 
428 | 427 |     /* compute metrics for registered btls */  | 
429 | 428 |     mca_bml_r2_compute_endpoint_metrics (bml_endpoint);  | 
430 | 429 | 
 
  | 
 | 430 | +    /* do it last, for the lazy initialization check in bml_base_get* */  | 
 | 431 | +#if OPAL_ENABLE_THREAD_MULTI  | 
 | 432 | +    opal_atomic_wmb();  | 
 | 433 | +#endif /* OPAL_ENABLE_THREAD_MULTI */  | 
 | 434 | +    proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML] = bml_endpoint;  | 
 | 435 | + | 
431 | 436 |     return OMPI_SUCCESS;  | 
432 | 437 | }  | 
433 | 438 | 
 
  | 
@@ -521,6 +526,7 @@ static int mca_bml_r2_add_procs( size_t nprocs,  | 
521 | 526 | 
 
  | 
522 | 527 |             if (NULL == bml_endpoint) {  | 
523 | 528 |                 bml_endpoint = mca_bml_r2_allocate_endpoint (proc);  | 
 | 529 | +                proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_BML] = bml_endpoint;  | 
524 | 530 |                 if (NULL == bml_endpoint) {  | 
525 | 531 |                     free(btl_endpoints);  | 
526 | 532 |                     free(new_procs);  | 
 | 
0 commit comments