46
46
#include "opal/mca/threads/mutex.h"
47
47
#include "opal/util/bit_ops.h"
48
48
#include "opal/util/output.h"
49
+ #include "opal/util/show_help.h"
49
50
#include "ompi/mca/topo/topo.h"
50
51
#include "ompi/mca/topo/base/base.h"
51
52
#include "ompi/dpm/dpm.h"
@@ -79,6 +80,21 @@ static const ompi_comm_split_type_hw_guided_t ompi_comm_split_type_hw_guided_sup
79
80
{.info_value = NULL },
80
81
};
81
82
83
+ static const char * ompi_comm_split_type_to_str (int split_type ) {
84
+ for (int i = 0 ; NULL != ompi_comm_split_type_hw_guided_support [i ].info_value ; ++ i ) {
85
+ if (split_type == ompi_comm_split_type_hw_guided_support [i ].split_type ) {
86
+ return ompi_comm_split_type_hw_guided_support [i ].info_value ;
87
+ }
88
+ }
89
+ if (MPI_COMM_TYPE_HW_GUIDED == split_type ) {
90
+ return "MPI_COMM_TYPE_HW_GUIDED" ;
91
+ }
92
+ else if (MPI_COMM_TYPE_HW_UNGUIDED == split_type ) {
93
+ return "MPI_COMM_TYPE_HW_UNGUIDED" ;
94
+ }
95
+ return "Unknown" ;
96
+ }
97
+
82
98
/*
83
99
** sort-function for MPI_Comm_split
84
100
*/
@@ -793,7 +809,11 @@ static int ompi_comm_split_type_get_part (ompi_group_t *group, const int split_t
793
809
* We should not get here as the split type will be changed
794
810
* at a higher level.
795
811
*/
796
- opal_output (0 , "Error: in ompi_comm_split_type_get_part() unexpected split_type=%d" , split_type );
812
+ opal_show_help ("help-comm.txt" ,
813
+ "unexpected-split-type" ,
814
+ true,
815
+ ompi_comm_split_type_to_str (split_type ),
816
+ split_type );
797
817
return OMPI_ERR_BAD_PARAM ;
798
818
}
799
819
@@ -871,6 +891,8 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
871
891
int global_split_type , global_orig_split_type , ok [2 ], tmp [6 ];
872
892
int rc ;
873
893
int orig_split_type = split_type ;
894
+ int flag ;
895
+ opal_cstring_t * value = NULL ;
874
896
875
897
/* silence clang warning. newcomm should never be NULL */
876
898
if (OPAL_UNLIKELY (NULL == newcomm )) {
@@ -881,9 +903,6 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
881
903
882
904
/* Step 0: Convert MPI_COMM_TYPE_HW_GUIDED to the internal type */
883
905
if (MPI_COMM_TYPE_HW_GUIDED == split_type ) {
884
- int flag ;
885
- opal_cstring_t * value = NULL ;
886
-
887
906
opal_info_get (info , "mpi_hw_resource_type" , & value , & flag );
888
907
/* If key is not in the 'info', then return MPI_COMM_NULL.
889
908
* This is caught at the MPI interface level, but it doesn't hurt to
@@ -963,11 +982,16 @@ int ompi_comm_split_type (ompi_communicator_t *comm, int split_type, int key,
963
982
964
983
if (OPAL_UNLIKELY (!ok [0 ] || !ok [1 ])) {
965
984
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" );
985
+ opal_info_get (info , "mpi_hw_resource_type" , & value , & flag );
986
+ if (!flag ) {
987
+ value = NULL ;
970
988
}
989
+ opal_show_help ("help-comm.txt" ,
990
+ "mismatched-split_type-values" ,
991
+ true,
992
+ ompi_comm_split_type_to_str (orig_split_type ),
993
+ orig_split_type ,
994
+ NULL == value ? "" : value -> string );
971
995
}
972
996
return OMPI_ERR_BAD_PARAM ;
973
997
}
0 commit comments