@@ -99,6 +99,7 @@ struct ompi_comm_cid_context_t {
9999 int iter ;
100100 /** storage for activate barrier */
101101 int max_local_peers ;
102+ int local_peers ;
102103 char * port_string ;
103104 bool send_first ;
104105 int pml_tag ;
@@ -267,6 +268,7 @@ static ompi_comm_cid_context_t *mca_comm_cid_context_alloc (ompi_communicator_t
267268 context -> send_first = send_first ;
268269 context -> iter = 0 ;
269270 context -> max_local_peers = ompi_group_count_local_peers (newcomm -> c_local_group );
271+ context -> local_peers = context -> max_local_peers ;
270272
271273 return context ;
272274}
@@ -774,6 +776,11 @@ static int ompi_comm_activate_nb_complete (ompi_comm_request_t *request);
774776/* Callback function to set communicator disjointness flags */
775777static inline void ompi_comm_set_disjointness_nb_complete (ompi_comm_cid_context_t * context )
776778{
779+ /* Only set the disjoint flags when it is intra-communicator */
780+ if (OMPI_COMM_IS_INTER (* context -> newcommp )) {
781+ return ;
782+ }
783+
777784 if (OMPI_COMM_IS_DISJOINT_SET (* context -> newcommp )) {
778785 opal_show_help ("help-comm.txt" , "disjointness-set-again" , true);
779786 return ;
@@ -870,7 +877,7 @@ int ompi_comm_activate_nb (ompi_communicator_t **newcomm, ompi_communicator_t *c
870877 ompi_comm_cid_context_t * context ;
871878 ompi_comm_request_t * request ;
872879 ompi_request_t * subreq ;
873- int ret = 0 , local_peers = -1 ;
880+ int ret = 0 ;
874881
875882 /* the caller should not pass NULL for comm (it may be the same as *newcomm) */
876883 assert (NULL != comm );
@@ -907,9 +914,8 @@ int ompi_comm_activate_nb (ompi_communicator_t **newcomm, ompi_communicator_t *c
907914 * 1. The communicator's disjointness is inferred from max_local_peers.
908915 * 2. After the operation it is allowed to send messages over the new communicator.
909916 */
910- local_peers = context -> max_local_peers ;
911- ret = context -> iallreduce_fn (& local_peers , & context -> max_local_peers , 1 , MPI_MAX , context ,
912- & subreq );
917+ ret = context -> iallreduce_fn (& context -> local_peers , & context -> max_local_peers , 1 , MPI_MAX , context ,
918+ & subreq );
913919 if (OMPI_SUCCESS != ret ) {
914920 ompi_comm_request_return (request );
915921 return ret ;
0 commit comments