diff --git a/ompi/mca/btl/sm/btl_sm.c b/ompi/mca/btl/sm/btl_sm.c index bf674f7183..da5fd57b26 100644 --- a/ompi/mca/btl/sm/btl_sm.c +++ b/ompi/mca/btl/sm/btl_sm.c @@ -516,6 +516,22 @@ int mca_btl_sm_add_procs( diff = tmp_ptr[mca_btl_sm_component.my_smp_rank] - tmp_ptr[j]; mca_btl_sm_component.fifo[j] = (ompi_fifo_t*)((char*)fifo_tmp[j]+diff); mca_btl_sm_component.sm_offset[j] = diff; + + } + + for( j=mca_btl_sm_component.num_smp_procs ; j < + mca_btl_sm_component.num_smp_procs+n_local_procs ; j++ ) { + if(j == mca_btl_sm_component.my_smp_rank) + continue; + return_code = ompi_fifo_init((int)mca_btl_sm_component.size_of_cb_queue, + (int)mca_btl_sm_component.cb_lazy_free_freq, + 0,0,0, + &mca_btl_sm_component.fifo[j][mca_btl_sm_component.my_smp_rank], + mca_btl_sm_component.sm_offset[j], + mca_btl_sm_component.sm_mpool); + + if(return_code != OMPI_SUCCESS) + goto CLEANUP; } /* initialize some of the free-lists */ diff --git a/ompi/mca/btl/sm/btl_sm_fifo.h b/ompi/mca/btl/sm/btl_sm_fifo.h index b3915efa57..41ada80eaa 100644 --- a/ompi/mca/btl/sm/btl_sm_fifo.h +++ b/ompi/mca/btl/sm/btl_sm_fifo.h @@ -12,23 +12,6 @@ do { \ /* thread lock */ \ if(opal_using_threads()) \ opal_atomic_lock(fifo->head_lock); \ - if(OMPI_CB_FREE == fifo->head) { \ - /* no queues have been allocated - allocate now */ \ - rc=ompi_fifo_init( \ - (int)mca_btl_sm_component.size_of_cb_queue, \ - (int)mca_btl_sm_component.cb_lazy_free_freq, \ - /* at this stage we are not doing anything with memory \ - * locality */ \ - 0,0,0, \ - fifo, mca_btl_sm_component.sm_offset[peer_smp_rank], \ - mca_btl_sm_component.sm_mpool); \ - if( rc != OMPI_SUCCESS ) { \ - if(opal_using_threads()) \ - opal_atomic_unlock(fifo->head_lock); \ - break; \ - } \ - } \ - \ /* post fragment */ \ while(ompi_fifo_write_to_head(hdr, fifo, \ mca_btl_sm_component.sm_mpool) != OMPI_SUCCESS) \