Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Begin to add a MVAPICH2 collectives selector. Alltoall, Allgather and gather done.
[simgrid.git] / src / smpi / colls / smpi_mvapich2_selector_stampede.h
1 /* selector for collective algorithms based on mvapich decision logic */
2
3 /* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This is the tuning used by MVAPICH for Stampede platform based on (MV2_ARCH_INTEL_XEON_E5_2680_16, MV2_HCA_MLX_CX_FDR) */
7
8 /* Indicates number of processes per node */
9 extern int *mv2_alltoall_table_ppn_conf;
10 /* Indicates total number of configurations */
11 extern int mv2_alltoall_num_ppn_conf;
12 #define MV2_MAX_NB_THRESHOLDS  32
13 typedef struct {
14     int min;
15     int max;
16     int (*MV2_pt_Alltoall_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
17                                      void *recvbuf, int recvcount, MPI_Datatype recvtype,
18                                      MPI_Comm comm_ptr );
19 } mv2_alltoall_tuning_element;
20
21 typedef struct {
22     int numproc;
23     int size_table;
24     mv2_alltoall_tuning_element algo_table[MV2_MAX_NB_THRESHOLDS];
25     mv2_alltoall_tuning_element in_place_algo_table[MV2_MAX_NB_THRESHOLDS];
26 } mv2_alltoall_tuning_table;
27
28 extern int *mv2_size_alltoall_tuning_table;
29 extern mv2_alltoall_tuning_table **mv2_alltoall_thresholds_table;
30 extern int mv2_use_old_alltoall;
31
32
33 int (*MV2_Alltoall_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
34                               void *recvbuf, int recvcount, MPI_Datatype recvtype,
35                               MPI_Comm comm_ptr)=NULL;
36                               
37                               
38 int *mv2_alltoall_table_ppn_conf = NULL;
39 int mv2_alltoall_num_ppn_conf = 1;
40 int *mv2_size_alltoall_tuning_table = NULL;
41 mv2_alltoall_tuning_table **mv2_alltoall_thresholds_table = NULL;
42
43
44
45
46 #define MPIR_Alltoall_bruck_MV2 smpi_coll_tuned_alltoall_bruck
47 #define MPIR_Alltoall_RD_MV2 smpi_coll_tuned_alltoall_rdb
48 #define MPIR_Alltoall_Scatter_dest_MV2 smpi_coll_tuned_alltoall_ring
49 #define MPIR_Alltoall_pairwise_MV2 smpi_coll_tuned_alltoall_pair
50 #define MPIR_Alltoall_inplace_MV2 smpi_coll_tuned_alltoall_ring 
51
52
53
54 /* Indicates number of processes per node */
55 extern int *mv2_allgather_table_ppn_conf;
56 /* Indicates total number of configurations */
57 extern int mv2_allgather_num_ppn_conf;
58
59 typedef struct {
60     int min;
61     int max;
62     int (*MV2_pt_Allgather_function)(void *sendbuf,
63                                  int sendcount,
64                                  MPI_Datatype sendtype,
65                                  void *recvbuf,
66                                  int recvcount,
67                                  MPI_Datatype recvtype, MPI_Comm comm_ptr);
68 } mv2_allgather_tuning_element;
69
70 typedef struct {
71     int numproc; 
72     int two_level[MV2_MAX_NB_THRESHOLDS];
73     int size_inter_table;
74     mv2_allgather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
75 } mv2_allgather_tuning_table;
76
77 extern int *mv2_size_allgather_tuning_table;
78 extern mv2_allgather_tuning_table **mv2_allgather_thresholds_table;
79 extern int mv2_use_old_allgather;
80
81 int (*MV2_Allgather_function)(void *sendbuf,
82                              int sendcount,
83                              MPI_Datatype sendtype,
84                              void *recvbuf,
85                              int recvcount,
86                              MPI_Datatype recvtype, MPI_Comm comm);
87
88 int *mv2_allgather_table_ppn_conf = NULL;
89 int mv2_allgather_num_ppn_conf = 1;
90 int *mv2_size_allgather_tuning_table = NULL;
91 mv2_allgather_tuning_table **mv2_allgather_thresholds_table = NULL;
92
93 #define MPIR_Allgather_Bruck_MV2 smpi_coll_tuned_allgather_bruck
94 #define MPIR_Allgather_RD_MV2 smpi_coll_tuned_allgather_rdb
95 #define MPIR_Allgather_RD_Allgather_Comm_MV2 smpi_coll_tuned_allgather_rdb
96 #define MPIR_Allgather_Ring_MV2 smpi_coll_tuned_allgather_ring
97
98
99 typedef struct {
100     int min;
101     int max;
102     int (*MV2_pt_Gather_function)(void *sendbuf, int sendcnt,
103                                   MPI_Datatype sendtype, void *recvbuf, int recvcnt,
104                                   MPI_Datatype recvtype, int root, MPI_Comm  comm_ptr);
105 } mv2_gather_tuning_element;
106
107
108 typedef struct {
109     int numproc;
110     int size_inter_table;
111     mv2_gather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
112     int size_intra_table;
113     mv2_gather_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
114 } mv2_gather_tuning_table;
115
116 extern int mv2_size_gather_tuning_table;
117 extern mv2_gather_tuning_table * mv2_gather_thresholds_table;
118
119 extern int mv2_user_gather_switch_point;
120 extern int mv2_use_two_level_gather;
121 extern int mv2_gather_direct_system_size_small;
122 extern int mv2_gather_direct_system_size_medium;
123 extern int mv2_use_direct_gather;
124
125 int mv2_size_gather_tuning_table=7;
126 mv2_gather_tuning_table * mv2_gather_thresholds_table=NULL; 
127
128 typedef int (*MV2_Gather_function_ptr) (void *sendbuf,
129                                         int sendcnt,
130                                         MPI_Datatype sendtype,
131                                         void *recvbuf,
132                                         int recvcnt,
133                                         MPI_Datatype recvtype,
134                                         int root, MPI_Comm comm);
135
136 MV2_Gather_function_ptr MV2_Gather_inter_leader_function = NULL;
137 MV2_Gather_function_ptr MV2_Gather_intra_node_function = NULL;
138
139
140 #define MPIR_Gather_MV2_Direct smpi_coll_tuned_gather_ompi_basic_linear
141 #define MPIR_Gather_MV2_two_level_Direct smpi_coll_tuned_gather_ompi_basic_linear
142 #define MPIR_Gather_intra smpi_coll_tuned_gather_mpich