File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -604,17 +604,31 @@ void mca_spml_ucx_ctx_destroy(shmem_ctx_t ctx)
604
604
605
605
MCA_SPML_CALL (quiet (ctx ));
606
606
607
+ oshmem_shmem_barrier ();
608
+
607
609
SHMEM_MUTEX_LOCK (mca_spml_ucx .internal_mutex );
608
610
609
611
/* delete context object from list */
610
612
OPAL_LIST_FOREACH_SAFE (ctx_item , next , & (mca_spml_ucx .ctx_list ),
611
613
mca_spml_ucx_ctx_list_item_t ) {
612
614
if ((shmem_ctx_t )(& ctx_item -> ctx ) == ctx ) {
613
615
opal_list_remove_item (& (mca_spml_ucx .ctx_list ), & ctx_item -> super );
614
- for (i = 0 ; i < nprocs ; i ++ ) {
615
- ucp_ep_destroy (ctx_item -> ctx .ucp_peers [i ].ucp_conn );
616
+
617
+ opal_common_ucx_del_proc_t * del_procs ;
618
+ del_procs = malloc (sizeof (* del_procs ) * nprocs );
619
+
620
+ for (i = 0 ; i < nprocs ; ++ i ) {
621
+ del_procs [i ].ep = ctx_item -> ctx .ucp_peers [i ].ucp_conn ;
622
+ del_procs [i ].vpid = i ;
623
+ ctx_item -> ctx .ucp_peers [i ].ucp_conn = NULL ;
616
624
}
625
+
626
+ opal_common_ucx_del_procs (del_procs , nprocs , oshmem_my_proc_id (),
627
+ mca_spml_ucx .num_disconnect ,
628
+ ctx_item -> ctx .ucp_worker );
629
+ free (del_procs );
617
630
free (ctx_item -> ctx .ucp_peers );
631
+
618
632
ucp_worker_destroy (ctx_item -> ctx .ucp_worker );
619
633
OBJ_RELEASE (ctx_item );
620
634
break ;
You can’t perform that action at this time.
0 commit comments