This source file includes following definitions.
- ompi_coll_tuned_alltoallv_intra_check_forced_init
- ompi_coll_tuned_alltoallv_intra_do_this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #include "ompi_config.h"
16
17 #include "mpi.h"
18 #include "ompi/constants.h"
19 #include "ompi/datatype/ompi_datatype.h"
20 #include "ompi/communicator/communicator.h"
21 #include "ompi/mca/coll/coll.h"
22 #include "ompi/mca/coll/base/coll_tags.h"
23 #include "ompi/mca/pml/pml.h"
24 #include "coll_tuned.h"
25 #include "ompi/mca/coll/base/coll_base_topo.h"
26 #include "ompi/mca/coll/base/coll_base_util.h"
27
28
29 static int coll_tuned_alltoallv_forced_algorithm = 0;
30
31
32 static mca_base_var_enum_value_t alltoallv_algorithms[] = {
33 {0, "ignore"},
34 {1, "basic_linear"},
35 {2, "pairwise"},
36 {0, NULL}
37 };
38
39
40
41
42
43
44
45
46
47
48 int ompi_coll_tuned_alltoallv_intra_check_forced_init(coll_tuned_force_algorithm_mca_param_indices_t
49 *mca_param_indices)
50 {
51 mca_base_var_enum_t *new_enum;
52 int cnt;
53
54 for( cnt = 0; NULL != alltoallv_algorithms[cnt].string; cnt++ );
55 ompi_coll_tuned_forced_max_algorithms[ALLTOALLV] = cnt;
56
57 (void) mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
58 "alltoallv_algorithm_count",
59 "Number of alltoallv algorithms available",
60 MCA_BASE_VAR_TYPE_INT, NULL, 0,
61 MCA_BASE_VAR_FLAG_DEFAULT_ONLY,
62 OPAL_INFO_LVL_5,
63 MCA_BASE_VAR_SCOPE_CONSTANT,
64 &ompi_coll_tuned_forced_max_algorithms[ALLTOALLV]);
65
66
67 coll_tuned_alltoallv_forced_algorithm = 0;
68 (void) mca_base_var_enum_create("coll_tuned_alltoallv_algorithms", alltoallv_algorithms, &new_enum);
69 mca_param_indices->algorithm_param_index =
70 mca_base_component_var_register(&mca_coll_tuned_component.super.collm_version,
71 "alltoallv_algorithm",
72 "Which alltoallv algorithm is used. "
73 "Can be locked down to choice of: 0 ignore, "
74 "1 basic linear, 2 pairwise.",
75 MCA_BASE_VAR_TYPE_INT, new_enum, 0, MCA_BASE_VAR_FLAG_SETTABLE,
76 OPAL_INFO_LVL_5,
77 MCA_BASE_VAR_SCOPE_ALL,
78 &coll_tuned_alltoallv_forced_algorithm);
79
80 OBJ_RELEASE(new_enum);
81 if (mca_param_indices->algorithm_param_index < 0) {
82 return mca_param_indices->algorithm_param_index;
83 }
84
85 return (MPI_SUCCESS);
86 }
87
88
89
90 int ompi_coll_tuned_alltoallv_intra_do_this(const void *sbuf, const int *scounts, const int *sdisps,
91 struct ompi_datatype_t *sdtype,
92 void* rbuf, const int *rcounts, const int *rdisps,
93 struct ompi_datatype_t *rdtype,
94 struct ompi_communicator_t *comm,
95 mca_coll_base_module_t *module,
96 int algorithm)
97 {
98 OPAL_OUTPUT((ompi_coll_tuned_stream,
99 "coll:tuned:alltoallv_intra_do_this selected algorithm %d ",
100 algorithm));
101
102 switch (algorithm) {
103 case (0):
104 return ompi_coll_tuned_alltoallv_intra_dec_fixed(sbuf, scounts, sdisps, sdtype,
105 rbuf, rcounts, rdisps, rdtype,
106 comm, module);
107 case (1):
108 return ompi_coll_base_alltoallv_intra_basic_linear(sbuf, scounts, sdisps, sdtype,
109 rbuf, rcounts, rdisps, rdtype,
110 comm, module);
111 case (2):
112 return ompi_coll_base_alltoallv_intra_pairwise(sbuf, scounts, sdisps, sdtype,
113 rbuf, rcounts, rdisps, rdtype,
114 comm, module);
115 }
116 OPAL_OUTPUT((ompi_coll_tuned_stream,
117 "coll:tuned:alltoall_intra_do_this attempt to select "
118 "algorithm %d when only 0-%d is valid.",
119 algorithm, ompi_coll_tuned_forced_max_algorithms[ALLTOALLV]));
120 return (MPI_ERR_ARG);
121 }