@@ -218,6 +218,13 @@ progress_callback(void)
218218 count ++ ;
219219
220220 if (NULL != ev .user_ptr ) {
221+ /* be sure that we receive the PTL_EVENT_LINK */
222+ if (ev .type == PTL_EVENT_LINK ) {
223+ * (int * )ev .user_ptr = * (int * )ev .user_ptr + 1 ;
224+ opal_condition_broadcast (& mca_osc_portals4_component .cond );
225+ continue ;
226+ }
227+
221228 req = (ompi_osc_portals4_request_t * ) ev .user_ptr ;
222229 opal_atomic_add_size_t (& req -> super .req_status ._ucount , ev .mlength );
223230 ops = opal_atomic_add_32 (& req -> ops_committed , 1 );
@@ -503,7 +510,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
503510 module -> pt_idx ,
504511 & me ,
505512 PTL_PRIORITY_LIST ,
506- NULL ,
513+ & module -> ct_link ,
507514 & module -> data_me_h );
508515 if (PTL_OK != ret ) {
509516 opal_output_verbose (1 , ompi_osc_base_framework .framework_output ,
@@ -526,7 +533,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
526533 module -> pt_idx ,
527534 & me ,
528535 PTL_PRIORITY_LIST ,
529- NULL ,
536+ & module -> ct_link ,
530537 & module -> control_me_h );
531538 if (PTL_OK != ret ) {
532539 opal_output_verbose (1 , ompi_osc_base_framework .framework_output ,
@@ -574,6 +581,13 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
574581 PtlAtomicSync ();
575582
576583 /* Make sure that everyone's ready to receive. */
584+ OPAL_THREAD_LOCK (& mca_osc_portals4_component .lock );
585+ while (module -> ct_link != 2 ) {
586+ opal_condition_wait (& mca_osc_portals4_component .cond ,
587+ & mca_osc_portals4_component .lock );
588+ }
589+ OPAL_THREAD_UNLOCK (& mca_osc_portals4_component .lock );
590+
577591 module -> comm -> c_coll .coll_barrier (module -> comm ,
578592 module -> comm -> c_coll .coll_barrier_module );
579593
@@ -618,6 +632,7 @@ ompi_osc_portals4_free(struct ompi_win_t *win)
618632 module -> comm -> c_coll .coll_barrier_module );
619633
620634 /* cleanup */
635+ PtlMEUnlink (module -> control_me_h );
621636 PtlMEUnlink (module -> data_me_h );
622637 PtlMDRelease (module -> md_h );
623638 PtlMDRelease (module -> req_md_h );
0 commit comments