@@ -868,7 +868,7 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
868
868
ompi_communicator_t * newcomp = MPI_COMM_NULL ;
869
869
int my_size , my_rsize = 0 , mode , inter ;
870
870
int * lranks = NULL , * rranks = NULL ;
871
- int global_split_type , global_orig_split_type , ok , tmp [6 ];
871
+ int global_split_type , global_orig_split_type , ok [ 2 ] , tmp [6 ];
872
872
int rc ;
873
873
int orig_split_type = split_type ;
874
874
@@ -941,26 +941,34 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
941
941
global_orig_split_type = tmp [0 ];
942
942
global_split_type = tmp [4 ];
943
943
944
- if (tmp [0 ] != - tmp [1 ] || inter ) {
944
+ if (tmp [0 ] != - tmp [1 ] || tmp [ 4 ] != - tmp [ 5 ] || inter ) {
945
945
/* at least one rank supplied a different split type check if our split_type is ok */
946
- ok = (MPI_UNDEFINED == orig_split_type ) || global_orig_split_type == orig_split_type ;
946
+ ok [0 ] = (MPI_UNDEFINED == orig_split_type ) || global_orig_split_type == orig_split_type ;
947
+ ok [1 ] = (MPI_UNDEFINED == orig_split_type ) || global_split_type == split_type ;
947
948
948
- rc = comm -> c_coll -> coll_allreduce (MPI_IN_PLACE , & ok , 1 , MPI_INT , MPI_MIN , comm ,
949
+ rc = comm -> c_coll -> coll_allreduce (MPI_IN_PLACE , & ok , 2 , MPI_INT , MPI_MIN , comm ,
949
950
comm -> c_coll -> coll_allreduce_module );
950
951
if (OPAL_UNLIKELY (OMPI_SUCCESS != rc )) {
951
952
return rc ;
952
953
}
953
954
954
955
if (inter ) {
955
956
/* need an extra allreduce to ensure that all ranks have the same result */
956
- rc = comm -> c_coll -> coll_allreduce (MPI_IN_PLACE , & ok , 1 , MPI_INT , MPI_MIN , comm ,
957
+ rc = comm -> c_coll -> coll_allreduce (MPI_IN_PLACE , & ok , 2 , MPI_INT , MPI_MIN , comm ,
957
958
comm -> c_coll -> coll_allreduce_module );
958
959
if (OPAL_UNLIKELY (OMPI_SUCCESS != rc )) {
959
960
return rc ;
960
961
}
961
962
}
962
963
963
- if (OPAL_UNLIKELY (!ok )) {
964
+ if (OPAL_UNLIKELY (!ok [0 ] || !ok [1 ])) {
965
+ if (0 == ompi_comm_rank (comm )) {
966
+ if (!ok [1 ]) {
967
+ opal_output (0 , "Error: Mismatched info values for MPI_COMM_TYPE_HW_GUIDED" );
968
+ } else {
969
+ opal_output (0 , "Error: Mismatched info values for split_type" );
970
+ }
971
+ }
964
972
return OMPI_ERR_BAD_PARAM ;
965
973
}
966
974
@@ -978,14 +986,6 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
978
986
return OMPI_SUCCESS ;
979
987
}
980
988
981
- /* MPI_COMM_TYPE_HW_GUIDED: Check if 'value' the same at all ranks */
982
- if (tmp [4 ] != - tmp [5 ]) {
983
- if (0 == ompi_comm_rank (comm )) {
984
- opal_output (0 , "Error: Mismatched info values for MPI_COMM_TYPE_HW_GUIDED" );
985
- }
986
- return OMPI_ERR_BAD_PARAM ;
987
- }
988
-
989
989
/* TODO: Make this better...
990
990
*
991
991
* See Example 7.4 in the MPI 4.0 standard for example usage.
0 commit comments