1 /* selector for collective algorithms based on mvapich decision logic */
3 /* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
4 * All rights reserved. */
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) */
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
16 int (*MV2_pt_Alltoall_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
17 void *recvbuf, int recvcount, MPI_Datatype recvtype,
19 } mv2_alltoall_tuning_element;
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;
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;
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;
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;
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
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;
62 int (*MV2_pt_Allgather_function)(void *sendbuf,
64 MPI_Datatype sendtype,
67 MPI_Datatype recvtype, MPI_Comm comm_ptr);
68 } mv2_allgather_tuning_element;
72 int two_level[MV2_MAX_NB_THRESHOLDS];
74 mv2_allgather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
75 } mv2_allgather_tuning_table;
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;
81 int (*MV2_Allgather_function)(void *sendbuf,
83 MPI_Datatype sendtype,
86 MPI_Datatype recvtype, MPI_Comm comm);
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;
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
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;
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;
116 extern int mv2_size_gather_tuning_table;
117 extern mv2_gather_tuning_table * mv2_gather_thresholds_table;
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;
125 int mv2_size_gather_tuning_table=7;
126 mv2_gather_tuning_table * mv2_gather_thresholds_table=NULL;
128 typedef int (*MV2_Gather_function_ptr) (void *sendbuf,
130 MPI_Datatype sendtype,
133 MPI_Datatype recvtype,
134 int root, MPI_Comm comm);
136 MV2_Gather_function_ptr MV2_Gather_inter_leader_function = NULL;
137 MV2_Gather_function_ptr MV2_Gather_intra_node_function = NULL;
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
149 int (*MV2_pt_Allgatherv_function)(void *sendbuf,
151 MPI_Datatype sendtype,
155 MPI_Datatype recvtype,
157 } mv2_allgatherv_tuning_element;
161 int size_inter_table;
162 mv2_allgatherv_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
163 } mv2_allgatherv_tuning_table;
165 extern int mv2_size_allgatherv_tuning_table;
166 extern mv2_allgatherv_tuning_table *mv2_allgatherv_thresholds_table;
168 int (*MV2_Allgatherv_function)(void *sendbuf,
170 MPI_Datatype sendtype,
174 MPI_Datatype recvtype,
177 int mv2_size_allgatherv_tuning_table = 0;
178 mv2_allgatherv_tuning_table *mv2_allgatherv_thresholds_table = NULL;
180 #define MPIR_Allgatherv_Rec_Doubling_MV2 smpi_coll_tuned_allgatherv_mpich_rdb
181 #define MPIR_Allgatherv_Bruck_MV2 smpi_coll_tuned_allgatherv_ompi_bruck
182 #define MPIR_Allgatherv_Ring_MV2 smpi_coll_tuned_allgatherv_mpich_ring
188 int (*MV2_pt_Allreduce_function)(void *sendbuf,
191 MPI_Datatype datatype,
192 MPI_Op op, MPI_Comm comm);
193 } mv2_allreduce_tuning_element;
198 int is_two_level_allreduce[MV2_MAX_NB_THRESHOLDS];
199 int size_inter_table;
200 mv2_allreduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
201 int size_intra_table;
202 mv2_allreduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
203 } mv2_allreduce_tuning_table;
205 extern int mv2_size_allreduce_tuning_table;
206 extern mv2_allreduce_tuning_table *mv2_allreduce_thresholds_table;
207 extern int mv2_use_old_allreduce;
210 int (*MV2_Allreduce_function)(void *sendbuf,
213 MPI_Datatype datatype,
214 MPI_Op op, MPI_Comm comm)=NULL;
217 int (*MV2_Allreduce_intra_function)( void *sendbuf,
220 MPI_Datatype datatype,
221 MPI_Op op, MPI_Comm comm)=NULL;
223 int mv2_size_allreduce_tuning_table = 0;
224 mv2_allreduce_tuning_table *mv2_allreduce_thresholds_table = NULL;
230 static int MPIR_Allreduce_mcst_reduce_two_level_helper_MV2( void *sendbuf,
233 MPI_Datatype datatype,
234 MPI_Op op, MPI_Comm comm)
239 static int MPIR_Allreduce_mcst_reduce_redscat_gather_MV2( void *sendbuf,
242 MPI_Datatype datatype,
243 MPI_Op op, MPI_Comm comm)
248 static int MPIR_Allreduce_reduce_p2p_MV2( void *sendbuf,
251 MPI_Datatype datatype,
252 MPI_Op op, MPI_Comm comm)
254 mpi_coll_reduce_fun(sendbuf,recvbuf,count,datatype,op,0,comm);
258 static int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf,
261 MPI_Datatype datatype,
262 MPI_Op op, MPI_Comm comm)
264 mpi_coll_reduce_fun(sendbuf,recvbuf,count,datatype,op,0,comm);
268 #define MPIR_Allreduce_pt2pt_rd_MV2 smpi_coll_tuned_allreduce_rdb
269 #define MPIR_Allreduce_pt2pt_rs_MV2 smpi_coll_tuned_allreduce_rab1
274 Bcast deactivated for now, defaults to mpich one
278 int (*MV2_pt_Bcast_function) (void *buf, int count, MPI_Datatype datatype,
279 int root, MPI_Comm comm_ptr);
280 int zcpy_pipelined_knomial_factor;
281 } mv2_bcast_tuning_element;
285 int bcast_segment_size;
286 int intra_node_knomial_factor;
287 int inter_node_knomial_factor;
288 int is_two_level_bcast[MV2_MAX_NB_THRESHOLDS];
289 int size_inter_table;
290 mv2_bcast_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
291 int size_intra_table;
292 mv2_bcast_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
293 } mv2_bcast_tuning_table;
295 extern int mv2_use_pipelined_bcast;
296 extern int mv2_pipelined_knomial_factor;
297 extern int mv2_pipelined_zcpy_knomial_factor;
298 extern int zcpy_knomial_factor;
299 extern int bcast_segment_size;
301 extern int mv2_size_bcast_tuning_table;
302 extern mv2_bcast_tuning_table *mv2_bcast_thresholds_table;
303 extern int mv2_use_old_bcast;
305 int mv2_size_bcast_tuning_table = 0;
306 mv2_bcast_tuning_table *mv2_bcast_thresholds_table = NULL;
309 int (*MV2_Bcast_function) (void *buffer, int count, MPI_Datatype datatype,
310 int root, MPI_Comm comm_ptr) = NULL;
312 int (*MV2_Bcast_intra_node_function) (void *buffer, int count, MPI_Datatype datatype,
313 int root, MPI_Comm comm_ptr) = NULL;
321 int (*MV2_pt_Reduce_function)(void *sendbuf,
324 MPI_Datatype datatype,
328 } mv2_reduce_tuning_element;
334 int is_two_level_reduce[MV2_MAX_NB_THRESHOLDS];
335 int size_inter_table;
336 mv2_reduce_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
337 int size_intra_table;
338 mv2_reduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
339 } mv2_reduce_tuning_table;
341 extern int mv2_size_reduce_tuning_table;
342 extern mv2_reduce_tuning_table *mv2_reduce_thresholds_table;
343 extern int mv2_use_old_reduce;
345 int mv2_size_reduce_tuning_table = 0;
346 mv2_reduce_tuning_table *mv2_reduce_thresholds_table = NULL;
349 int mv2_reduce_intra_knomial_factor = -1;
350 int mv2_reduce_inter_knomial_factor = -1;
352 int (*MV2_Reduce_function)( void *sendbuf,
355 MPI_Datatype datatype,
358 MPI_Comm comm_ptr)=NULL;
360 int (*MV2_Reduce_intra_function)( void *sendbuf,
363 MPI_Datatype datatype,
366 MPI_Comm comm_ptr)=NULL;
369 #define MPIR_Reduce_inter_knomial_wrapper_MV2 smpi_coll_tuned_reduce_ompi_binomial
370 #define MPIR_Reduce_intra_knomial_wrapper_MV2 smpi_coll_tuned_reduce_ompi_binomial
371 #define MPIR_Reduce_binomial_MV2 smpi_coll_tuned_reduce_ompi_binomial
372 #define MPIR_Reduce_redscat_gather_MV2 smpi_coll_tuned_reduce_scatter_gather
373 #define MPIR_Reduce_shmem_MV2 smpi_coll_tuned_reduce_ompi_basic_linear
378 int (*MV2_pt_Red_scat_function)(void *sendbuf,
381 MPI_Datatype datatype,
384 } mv2_red_scat_tuning_element;
388 int size_inter_table;
389 mv2_red_scat_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
390 } mv2_red_scat_tuning_table;
392 extern int mv2_size_red_scat_tuning_table;
393 extern mv2_red_scat_tuning_table *mv2_red_scat_thresholds_table;
395 int mv2_size_red_scat_tuning_table = 0;
396 mv2_red_scat_tuning_table *mv2_red_scat_thresholds_table = NULL;
399 int (*MV2_Red_scat_function)(void *sendbuf,
402 MPI_Datatype datatype,
406 #define MPIR_Reduce_Scatter_Basic_MV2 smpi_coll_tuned_reduce_scatter_mpich_noncomm
407 #define MPIR_Reduce_scatter_non_comm_MV2 smpi_coll_tuned_reduce_scatter_mpich_noncomm
408 #define MPIR_Reduce_scatter_Rec_Halving_MV2 smpi_coll_tuned_reduce_scatter_ompi_basic_recursivehalving
409 #define MPIR_Reduce_scatter_Pair_Wise_MV2 smpi_coll_tuned_reduce_scatter_mpich_pair
413 /* Indicates number of processes per node */
414 extern int *mv2_scatter_table_ppn_conf;
415 /* Indicates total number of configurations */
416 extern int mv2_scatter_num_ppn_conf;
421 int (*MV2_pt_Scatter_function)(void *sendbuf,
423 MPI_Datatype sendtype,
426 MPI_Datatype recvtype,
427 int root, MPI_Comm comm);
428 } mv2_scatter_tuning_element;
432 int size_inter_table;
433 mv2_scatter_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS];
434 int size_intra_table;
435 mv2_scatter_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS];
436 } mv2_scatter_tuning_table;
438 extern int *mv2_size_scatter_tuning_table;
439 extern mv2_scatter_tuning_table **mv2_scatter_thresholds_table;
442 int *mv2_scatter_table_ppn_conf = NULL;
443 int mv2_scatter_num_ppn_conf = 1;
444 int *mv2_size_scatter_tuning_table = NULL;
445 mv2_scatter_tuning_table **mv2_scatter_thresholds_table = NULL;
447 int (*MV2_Scatter_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
448 void *recvbuf, int recvcount, MPI_Datatype recvtype,
449 int root, MPI_Comm comm)=NULL;
451 int (*MV2_Scatter_intra_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
452 void *recvbuf, int recvcount, MPI_Datatype recvtype,
453 int root, MPI_Comm comm)=NULL;
454 int MPIR_Scatter_mcst_wrap_MV2(void *sendbuf,
456 MPI_Datatype sendtype,
459 MPI_Datatype recvtype,
460 int root, MPI_Comm comm_ptr);
462 int MPIR_Scatter_mcst_wrap_MV2(void *sendbuf,
464 MPI_Datatype sendtype,
467 MPI_Datatype recvtype,
468 int root, MPI_Comm comm_ptr)
473 #define MPIR_Scatter_MV2_Binomial smpi_coll_tuned_scatter_ompi_binomial
474 #define MPIR_Scatter_MV2_Direct smpi_coll_tuned_scatter_ompi_basic_linear
475 #define MPIR_Scatter_MV2_two_level_Binomial smpi_coll_tuned_scatter_ompi_binomial
476 #define MPIR_Scatter_MV2_two_level_Direct smpi_coll_tuned_scatter_ompi_basic_linear