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 program is xbt_free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "colls_private.h"
11 #include "smpi_mvapich2_selector_stampede.h"
15 int smpi_coll_tuned_alltoall_mvapich2( void *sendbuf, int sendcount,
16 MPI_Datatype sendtype,
17 void* recvbuf, int recvcount,
18 MPI_Datatype recvtype,
22 if(mv2_alltoall_table_ppn_conf==NULL)
23 init_mv2_alltoall_tables_stampede();
25 int sendtype_size, recvtype_size, nbytes, comm_size;
26 char * tmp_buf = NULL;
27 int mpi_errno=MPI_SUCCESS;
29 int range_threshold = 0;
31 comm_size = smpi_comm_size(comm);
33 sendtype_size=smpi_datatype_size(sendtype);
34 recvtype_size=smpi_datatype_size(recvtype);
35 nbytes = sendtype_size * sendcount;
37 /* check if safe to use partial subscription mode */
39 /* Search for the corresponding system size inside the tuning table */
40 while ((range < (mv2_size_alltoall_tuning_table[conf_index] - 1)) &&
41 (comm_size > mv2_alltoall_thresholds_table[conf_index][range].numproc)) {
44 /* Search for corresponding inter-leader function */
45 while ((range_threshold < (mv2_alltoall_thresholds_table[conf_index][range].size_table - 1))
47 mv2_alltoall_thresholds_table[conf_index][range].algo_table[range_threshold].max)
48 && (mv2_alltoall_thresholds_table[conf_index][range].algo_table[range_threshold].max != -1)) {
51 MV2_Alltoall_function = mv2_alltoall_thresholds_table[conf_index][range].algo_table[range_threshold]
52 .MV2_pt_Alltoall_function;
54 if(sendbuf != MPI_IN_PLACE) {
55 mpi_errno = MV2_Alltoall_function(sendbuf, sendcount, sendtype,
56 recvbuf, recvcount, recvtype,
61 mv2_alltoall_thresholds_table[conf_index][range].in_place_algo_table[range_threshold].min
62 ||nbytes > mv2_alltoall_thresholds_table[conf_index][range].in_place_algo_table[range_threshold].max
64 tmp_buf = (char *)xbt_malloc( comm_size * recvcount * recvtype_size );
65 mpi_errno = smpi_datatype_copy((char *)recvbuf,
66 comm_size*recvcount, recvtype,
68 comm_size*recvcount, recvtype);
70 mpi_errno = MV2_Alltoall_function(tmp_buf, recvcount, recvtype,
71 recvbuf, recvcount, recvtype,
75 mpi_errno = MPIR_Alltoall_inplace_MV2(sendbuf, sendcount, sendtype,
76 recvbuf, recvcount, recvtype,
87 int smpi_coll_tuned_allgather_mvapich2(void *sendbuf, int sendcount, MPI_Datatype sendtype,
88 void *recvbuf, int recvcount, MPI_Datatype recvtype,
92 int mpi_errno = MPI_SUCCESS;
93 int nbytes = 0, comm_size, recvtype_size;
95 int partial_sub_ok = 0;
97 int range_threshold = 0;
101 //MPI_Comm *shmem_commptr=NULL;
102 /* Get the size of the communicator */
103 comm_size = smpi_comm_size(comm);
104 recvtype_size=smpi_datatype_size(recvtype);
105 nbytes = recvtype_size * recvcount;
107 if(mv2_allgather_table_ppn_conf==NULL)
108 init_mv2_allgather_tables_stampede();
110 if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
111 smpi_comm_init_smp(comm);
115 if (smpi_comm_is_uniform(comm)){
116 shmem_comm = smpi_comm_get_intra_comm(comm);
117 local_size = smpi_comm_size(shmem_comm);
119 if (mv2_allgather_table_ppn_conf[0] == -1) {
120 // Indicating user defined tuning
125 if (local_size == mv2_allgather_table_ppn_conf[i]) {
131 } while(i < mv2_allgather_num_ppn_conf);
134 if (partial_sub_ok != 1) {
138 /* Search for the corresponding system size inside the tuning table */
139 while ((range < (mv2_size_allgather_tuning_table[conf_index] - 1)) &&
141 mv2_allgather_thresholds_table[conf_index][range].numproc)) {
144 /* Search for corresponding inter-leader function */
145 while ((range_threshold <
146 (mv2_allgather_thresholds_table[conf_index][range].size_inter_table - 1))
147 && (nbytes > mv2_allgather_thresholds_table[conf_index][range].inter_leader[range_threshold].max)
148 && (mv2_allgather_thresholds_table[conf_index][range].inter_leader[range_threshold].max !=
153 /* Set inter-leader pt */
154 MV2_Allgather_function =
155 mv2_allgather_thresholds_table[conf_index][range].inter_leader[range_threshold].
156 MV2_pt_Allgather_function;
158 is_two_level = mv2_allgather_thresholds_table[conf_index][range].two_level[range_threshold];
160 /* intracommunicator */
161 if(is_two_level ==1){
162 if(partial_sub_ok ==1){
163 if (smpi_comm_is_blocked(comm)){
164 mpi_errno = MPIR_2lvl_Allgather_MV2(sendbuf, sendcount, sendtype,
165 recvbuf, recvcount, recvtype,
168 mpi_errno = smpi_coll_tuned_allgather_mpich(sendbuf, sendcount, sendtype,
169 recvbuf, recvcount, recvtype,
173 mpi_errno = MPIR_Allgather_RD_MV2(sendbuf, sendcount, sendtype,
174 recvbuf, recvcount, recvtype,
177 } else if(MV2_Allgather_function == &MPIR_Allgather_Bruck_MV2
178 || MV2_Allgather_function == &MPIR_Allgather_RD_MV2
179 || MV2_Allgather_function == &MPIR_Allgather_Ring_MV2) {
180 mpi_errno = MV2_Allgather_function(sendbuf, sendcount, sendtype,
181 recvbuf, recvcount, recvtype,
184 return MPI_ERR_OTHER;
191 int smpi_coll_tuned_gather_mvapich2(void *sendbuf,
193 MPI_Datatype sendtype,
196 MPI_Datatype recvtype,
197 int root, MPI_Comm comm)
199 if(mv2_gather_thresholds_table==NULL)
200 init_mv2_gather_tables_stampede();
202 int mpi_errno = MPI_SUCCESS;
204 int range_threshold = 0;
205 int range_intra_threshold = 0;
208 int recvtype_size, sendtype_size;
210 comm_size = smpi_comm_size(comm);
211 rank = smpi_comm_rank(comm);
214 recvtype_size=smpi_datatype_size(recvtype);
215 nbytes = recvcnt * recvtype_size;
217 sendtype_size=smpi_datatype_size(sendtype);
218 nbytes = sendcnt * sendtype_size;
221 /* Search for the corresponding system size inside the tuning table */
222 while ((range < (mv2_size_gather_tuning_table - 1)) &&
223 (comm_size > mv2_gather_thresholds_table[range].numproc)) {
226 /* Search for corresponding inter-leader function */
227 while ((range_threshold < (mv2_gather_thresholds_table[range].size_inter_table - 1))
229 mv2_gather_thresholds_table[range].inter_leader[range_threshold].max)
230 && (mv2_gather_thresholds_table[range].inter_leader[range_threshold].max !=
235 /* Search for corresponding intra node function */
236 while ((range_intra_threshold < (mv2_gather_thresholds_table[range].size_intra_table - 1))
238 mv2_gather_thresholds_table[range].intra_node[range_intra_threshold].max)
239 && (mv2_gather_thresholds_table[range].intra_node[range_intra_threshold].max !=
241 range_intra_threshold++;
244 if (smpi_comm_is_blocked(comm) ) {
245 // Set intra-node function pt for gather_two_level
246 MV2_Gather_intra_node_function =
247 mv2_gather_thresholds_table[range].intra_node[range_intra_threshold].
248 MV2_pt_Gather_function;
249 //Set inter-leader pt
250 MV2_Gather_inter_leader_function =
251 mv2_gather_thresholds_table[range].inter_leader[range_threshold].
252 MV2_pt_Gather_function;
253 // We call Gather function
255 MV2_Gather_inter_leader_function(sendbuf, sendcnt, sendtype, recvbuf, recvcnt,
256 recvtype, root, comm);
259 // Indeed, direct (non SMP-aware)gather is MPICH one
260 mpi_errno = smpi_coll_tuned_gather_mpich(sendbuf, sendcnt, sendtype,
261 recvbuf, recvcnt, recvtype,
269 int smpi_coll_tuned_allgatherv_mvapich2(void *sendbuf, int sendcount, MPI_Datatype sendtype,
270 void *recvbuf, int *recvcounts, int *displs,
271 MPI_Datatype recvtype, MPI_Comm comm )
273 int mpi_errno = MPI_SUCCESS;
274 int range = 0, comm_size, total_count, recvtype_size, i;
275 int range_threshold = 0;
278 if(mv2_allgatherv_thresholds_table==NULL)
279 init_mv2_allgatherv_tables_stampede();
281 comm_size = smpi_comm_size(comm);
283 for (i = 0; i < comm_size; i++)
284 total_count += recvcounts[i];
286 recvtype_size=smpi_datatype_size(recvtype);
287 nbytes = total_count * recvtype_size;
289 /* Search for the corresponding system size inside the tuning table */
290 while ((range < (mv2_size_allgatherv_tuning_table - 1)) &&
291 (comm_size > mv2_allgatherv_thresholds_table[range].numproc)) {
294 /* Search for corresponding inter-leader function */
295 while ((range_threshold < (mv2_allgatherv_thresholds_table[range].size_inter_table - 1))
297 comm_size * mv2_allgatherv_thresholds_table[range].inter_leader[range_threshold].max)
298 && (mv2_allgatherv_thresholds_table[range].inter_leader[range_threshold].max !=
302 /* Set inter-leader pt */
303 MV2_Allgatherv_function =
304 mv2_allgatherv_thresholds_table[range].inter_leader[range_threshold].
305 MV2_pt_Allgatherv_function;
307 if (MV2_Allgatherv_function == &MPIR_Allgatherv_Rec_Doubling_MV2)
309 if(!(comm_size & (comm_size - 1)))
312 MPIR_Allgatherv_Rec_Doubling_MV2(sendbuf, sendcount,
318 MPIR_Allgatherv_Bruck_MV2(sendbuf, sendcount,
325 MV2_Allgatherv_function(sendbuf, sendcount, sendtype,
326 recvbuf, recvcounts, displs,
335 int smpi_coll_tuned_allreduce_mvapich2(void *sendbuf,
338 MPI_Datatype datatype,
339 MPI_Op op, MPI_Comm comm)
342 int mpi_errno = MPI_SUCCESS;
346 comm_size = smpi_comm_size(comm);
347 //rank = smpi_comm_rank(comm);
353 if (mv2_allreduce_thresholds_table == NULL)
354 init_mv2_allreduce_tables_stampede();
356 /* check if multiple threads are calling this collective function */
358 MPI_Aint sendtype_size = 0;
360 int range = 0, range_threshold = 0, range_threshold_intra = 0;
361 int is_two_level = 0;
362 int is_commutative = 0;
363 MPI_Aint true_lb, true_extent;
365 sendtype_size=smpi_datatype_size(datatype);
366 nbytes = count * sendtype_size;
368 smpi_datatype_extent(datatype, &true_lb, &true_extent);
370 //is_commutative = smpi_op_is_commute(op);
373 /* Search for the corresponding system size inside the tuning table */
374 while ((range < (mv2_size_allreduce_tuning_table - 1)) &&
375 (comm_size > mv2_allreduce_thresholds_table[range].numproc)) {
378 /* Search for corresponding inter-leader function */
379 /* skip mcast poiters if mcast is not available */
380 if(mv2_allreduce_thresholds_table[range].mcast_enabled != 1){
381 while ((range_threshold < (mv2_allreduce_thresholds_table[range].size_inter_table - 1))
382 && ((mv2_allreduce_thresholds_table[range].
383 inter_leader[range_threshold].MV2_pt_Allreduce_function
384 == &MPIR_Allreduce_mcst_reduce_redscat_gather_MV2) ||
385 (mv2_allreduce_thresholds_table[range].
386 inter_leader[range_threshold].MV2_pt_Allreduce_function
387 == &MPIR_Allreduce_mcst_reduce_two_level_helper_MV2)
392 while ((range_threshold < (mv2_allreduce_thresholds_table[range].size_inter_table - 1))
394 mv2_allreduce_thresholds_table[range].inter_leader[range_threshold].max)
395 && (mv2_allreduce_thresholds_table[range].inter_leader[range_threshold].max != -1)) {
398 if(mv2_allreduce_thresholds_table[range].is_two_level_allreduce[range_threshold] == 1){
401 /* Search for corresponding intra-node function */
402 while ((range_threshold_intra <
403 (mv2_allreduce_thresholds_table[range].size_intra_table - 1))
405 mv2_allreduce_thresholds_table[range].intra_node[range_threshold_intra].max)
406 && (mv2_allreduce_thresholds_table[range].intra_node[range_threshold_intra].max !=
408 range_threshold_intra++;
411 MV2_Allreduce_function = mv2_allreduce_thresholds_table[range].inter_leader[range_threshold]
412 .MV2_pt_Allreduce_function;
414 MV2_Allreduce_intra_function = mv2_allreduce_thresholds_table[range].intra_node[range_threshold_intra]
415 .MV2_pt_Allreduce_function;
417 /* check if mcast is ready, otherwise replace mcast with other algorithm */
418 if((MV2_Allreduce_function == &MPIR_Allreduce_mcst_reduce_redscat_gather_MV2)||
419 (MV2_Allreduce_function == &MPIR_Allreduce_mcst_reduce_two_level_helper_MV2)){
421 MV2_Allreduce_function = &MPIR_Allreduce_pt2pt_rd_MV2;
423 if(is_two_level != 1) {
424 MV2_Allreduce_function = &MPIR_Allreduce_pt2pt_rd_MV2;
428 if(is_two_level == 1){
429 // check if shm is ready, if not use other algorithm first
430 if (is_commutative) {
431 if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){
432 smpi_comm_init_smp(comm);
434 mpi_errno = MPIR_Allreduce_two_level_MV2(sendbuf, recvbuf, count,
437 mpi_errno = MPIR_Allreduce_pt2pt_rd_MV2(sendbuf, recvbuf, count,
441 mpi_errno = MV2_Allreduce_function(sendbuf, recvbuf, count,
446 //comm->ch.intra_node_done=0;
454 int smpi_coll_tuned_alltoallv_mvapich2(void *sbuf, int *scounts, int *sdisps,
456 void *rbuf, int *rcounts, int *rdisps,
462 if (sbuf == MPI_IN_PLACE) {
463 return smpi_coll_tuned_alltoallv_ompi_basic_linear(sbuf, scounts, sdisps, sdtype,
464 rbuf, rcounts, rdisps,rdtype,
466 } else /* For starters, just keep the original algorithm. */
467 return smpi_coll_tuned_alltoallv_ring(sbuf, scounts, sdisps, sdtype,
468 rbuf, rcounts, rdisps,rdtype,
473 int smpi_coll_tuned_barrier_mvapich2(MPI_Comm comm)
475 return smpi_coll_tuned_barrier_mvapich2_pair(comm);
481 int smpi_coll_tuned_bcast_mvapich2(void *buffer,
483 MPI_Datatype datatype,
484 int root, MPI_Comm comm)
487 //TODO : Bcast really needs intra/inter phases in mvapich. Default to mpich if not available
488 return smpi_coll_tuned_bcast_mpich(buffer, count, datatype, root, comm);
494 int smpi_coll_tuned_reduce_mvapich2( void *sendbuf,
497 MPI_Datatype datatype,
498 MPI_Op op, int root, MPI_Comm comm)
500 if(mv2_reduce_thresholds_table == NULL)
501 init_mv2_reduce_tables_stampede();
503 int mpi_errno = MPI_SUCCESS;
505 int range_threshold = 0;
506 int range_intra_threshold = 0;
507 int is_commutative, pof2;
511 int is_two_level = 0;
513 comm_size = smpi_comm_size(comm);
514 sendtype_size=smpi_datatype_size(datatype);
515 nbytes = count * sendtype_size;
520 is_commutative = smpi_op_is_commute(op);
522 /* find nearest power-of-two less than or equal to comm_size */
523 for( pof2 = 1; pof2 <= comm_size; pof2 <<= 1 );
527 /* Search for the corresponding system size inside the tuning table */
528 while ((range < (mv2_size_reduce_tuning_table - 1)) &&
529 (comm_size > mv2_reduce_thresholds_table[range].numproc)) {
532 /* Search for corresponding inter-leader function */
533 while ((range_threshold < (mv2_reduce_thresholds_table[range].size_inter_table - 1))
535 mv2_reduce_thresholds_table[range].inter_leader[range_threshold].max)
536 && (mv2_reduce_thresholds_table[range].inter_leader[range_threshold].max !=
541 /* Search for corresponding intra node function */
542 while ((range_intra_threshold < (mv2_reduce_thresholds_table[range].size_intra_table - 1))
544 mv2_reduce_thresholds_table[range].intra_node[range_intra_threshold].max)
545 && (mv2_reduce_thresholds_table[range].intra_node[range_intra_threshold].max !=
547 range_intra_threshold++;
550 /* Set intra-node function pt for reduce_two_level */
551 MV2_Reduce_intra_function =
552 mv2_reduce_thresholds_table[range].intra_node[range_intra_threshold].
553 MV2_pt_Reduce_function;
554 /* Set inter-leader pt */
555 MV2_Reduce_function =
556 mv2_reduce_thresholds_table[range].inter_leader[range_threshold].
557 MV2_pt_Reduce_function;
559 if(mv2_reduce_intra_knomial_factor<0)
561 mv2_reduce_intra_knomial_factor = mv2_reduce_thresholds_table[range].intra_k_degree;
563 if(mv2_reduce_inter_knomial_factor<0)
565 mv2_reduce_inter_knomial_factor = mv2_reduce_thresholds_table[range].inter_k_degree;
567 if(mv2_reduce_thresholds_table[range].is_two_level_reduce[range_threshold] == 1){
570 /* We call Reduce function */
571 if(is_two_level == 1)
573 /* if (comm->ch.shmem_coll_ok == 1
574 && is_commutative == 1) {
575 mpi_errno = MPIR_Reduce_two_level_helper_MV2(sendbuf, recvbuf, count,
576 datatype, op, root, comm, errflag);
578 mpi_errno = MPIR_Reduce_binomial_MV2(sendbuf, recvbuf, count,
579 datatype, op, root, comm);
581 } else if(MV2_Reduce_function == &MPIR_Reduce_inter_knomial_wrapper_MV2 ){
582 if(is_commutative ==1)
584 mpi_errno = MV2_Reduce_function(sendbuf, recvbuf, count,
585 datatype, op, root, comm);
587 mpi_errno = MPIR_Reduce_binomial_MV2(sendbuf, recvbuf, count,
588 datatype, op, root, comm);
590 } else if(MV2_Reduce_function == &MPIR_Reduce_redscat_gather_MV2){
591 if (/*(HANDLE_GET_KIND(op) == HANDLE_KIND_BUILTIN) &&*/ (count >= pof2))
593 mpi_errno = MV2_Reduce_function(sendbuf, recvbuf, count,
594 datatype, op, root, comm);
596 mpi_errno = MPIR_Reduce_binomial_MV2(sendbuf, recvbuf, count,
597 datatype, op, root, comm);
600 mpi_errno = MV2_Reduce_function(sendbuf, recvbuf, count,
601 datatype, op, root, comm);
610 int smpi_coll_tuned_reduce_scatter_mvapich2(void *sendbuf, void *recvbuf, int *recvcnts,
611 MPI_Datatype datatype, MPI_Op op,
614 int mpi_errno = MPI_SUCCESS;
615 int i = 0, comm_size = smpi_comm_size(comm), total_count = 0, type_size =
618 int range_threshold = 0;
619 int is_commutative = 0;
620 int *disps = xbt_malloc(comm_size * sizeof (int));
622 if(mv2_red_scat_thresholds_table==NULL)
623 init_mv2_reduce_scatter_tables_stampede();
625 is_commutative=smpi_op_is_commute(op);
626 for (i = 0; i < comm_size; i++) {
627 disps[i] = total_count;
628 total_count += recvcnts[i];
631 type_size=smpi_datatype_size(datatype);
632 nbytes = total_count * type_size;
634 if (is_commutative) {
636 /* Search for the corresponding system size inside the tuning table */
637 while ((range < (mv2_size_red_scat_tuning_table - 1)) &&
638 (comm_size > mv2_red_scat_thresholds_table[range].numproc)) {
641 /* Search for corresponding inter-leader function */
642 while ((range_threshold < (mv2_red_scat_thresholds_table[range].size_inter_table - 1))
644 mv2_red_scat_thresholds_table[range].inter_leader[range_threshold].max)
645 && (mv2_red_scat_thresholds_table[range].inter_leader[range_threshold].max !=
650 /* Set inter-leader pt */
651 MV2_Red_scat_function =
652 mv2_red_scat_thresholds_table[range].inter_leader[range_threshold].
653 MV2_pt_Red_scat_function;
655 mpi_errno = MV2_Red_scat_function(sendbuf, recvbuf,
659 int is_block_regular = 1;
660 for (i = 0; i < (comm_size - 1); ++i) {
661 if (recvcnts[i] != recvcnts[i+1]) {
662 is_block_regular = 0;
667 while (pof2 < comm_size) pof2 <<= 1;
668 if (pof2 == comm_size && is_block_regular) {
669 /* noncommutative, pof2 size, and block regular */
670 mpi_errno = MPIR_Reduce_scatter_non_comm_MV2(sendbuf, recvbuf,
674 mpi_errno = smpi_coll_tuned_reduce_scatter_mpich_rdb(sendbuf, recvbuf,
685 int smpi_coll_tuned_scatter_mvapich2(void *sendbuf,
687 MPI_Datatype sendtype,
690 MPI_Datatype recvtype,
691 int root, MPI_Comm comm_ptr)
693 int range = 0, range_threshold = 0, range_threshold_intra = 0;
694 int mpi_errno = MPI_SUCCESS;
695 // int mpi_errno_ret = MPI_SUCCESS;
696 int rank, nbytes, comm_size;
697 int recvtype_size, sendtype_size;
698 int partial_sub_ok = 0;
700 // int local_size = -1;
702 // MPI_Comm shmem_comm;
703 // MPID_Comm *shmem_commptr=NULL;
704 if(mv2_scatter_thresholds_table==NULL)
705 init_mv2_scatter_tables_stampede();
707 comm_size = smpi_comm_size(comm_ptr);
709 rank = smpi_comm_rank(comm_ptr);
712 sendtype_size=smpi_datatype_size(sendtype);
713 nbytes = sendcnt * sendtype_size;
715 recvtype_size=smpi_datatype_size(recvtype);
716 nbytes = recvcnt * recvtype_size;
719 // check if safe to use partial subscription mode
720 if (comm_ptr->ch.shmem_coll_ok == 1 && comm_ptr->ch.is_uniform) {
722 shmem_comm = comm_ptr->ch.shmem_comm;
723 MPID_Comm_get_ptr(shmem_comm, shmem_commptr);
724 local_size = shmem_commptr->local_size;
726 if (mv2_scatter_table_ppn_conf[0] == -1) {
727 // Indicating user defined tuning
732 if (local_size == mv2_scatter_table_ppn_conf[i]) {
738 } while(i < mv2_scatter_num_ppn_conf);
741 if (partial_sub_ok != 1) {
745 /* Search for the corresponding system size inside the tuning table */
746 while ((range < (mv2_size_scatter_tuning_table[conf_index] - 1)) &&
747 (comm_size > mv2_scatter_thresholds_table[conf_index][range].numproc)) {
750 /* Search for corresponding inter-leader function */
751 while ((range_threshold < (mv2_scatter_thresholds_table[conf_index][range].size_inter_table - 1))
753 mv2_scatter_thresholds_table[conf_index][range].inter_leader[range_threshold].max)
754 && (mv2_scatter_thresholds_table[conf_index][range].inter_leader[range_threshold].max != -1)) {
758 /* Search for corresponding intra-node function */
759 while ((range_threshold_intra <
760 (mv2_scatter_thresholds_table[conf_index][range].size_intra_table - 1))
762 mv2_scatter_thresholds_table[conf_index][range].intra_node[range_threshold_intra].max)
763 && (mv2_scatter_thresholds_table[conf_index][range].intra_node[range_threshold_intra].max !=
765 range_threshold_intra++;
768 MV2_Scatter_function = mv2_scatter_thresholds_table[conf_index][range].inter_leader[range_threshold]
769 .MV2_pt_Scatter_function;
771 if(MV2_Scatter_function == &MPIR_Scatter_mcst_wrap_MV2) {
772 #if defined(_MCST_SUPPORT_)
773 if(comm_ptr->ch.is_mcast_ok == 1
774 && mv2_use_mcast_scatter == 1
775 && comm_ptr->ch.shmem_coll_ok == 1) {
776 MV2_Scatter_function = &MPIR_Scatter_mcst_MV2;
778 #endif /*#if defined(_MCST_SUPPORT_) */
780 if(mv2_scatter_thresholds_table[conf_index][range].inter_leader[range_threshold + 1].
781 MV2_pt_Scatter_function != NULL) {
782 MV2_Scatter_function = mv2_scatter_thresholds_table[conf_index][range].inter_leader[range_threshold + 1]
783 .MV2_pt_Scatter_function;
786 MV2_Scatter_function = &MPIR_Scatter_MV2_Binomial;
791 if( (MV2_Scatter_function == &MPIR_Scatter_MV2_two_level_Direct) ||
792 (MV2_Scatter_function == &MPIR_Scatter_MV2_two_level_Binomial)) {
793 /* if( comm_ptr->ch.shmem_coll_ok == 1 &&
794 comm_ptr->ch.is_global_block == 1 ) {
795 MV2_Scatter_intra_function = mv2_scatter_thresholds_table[conf_index][range].intra_node[range_threshold_intra]
796 .MV2_pt_Scatter_function;
799 MV2_Scatter_function(sendbuf, sendcnt, sendtype,
800 recvbuf, recvcnt, recvtype, root,
803 mpi_errno = MPIR_Scatter_MV2_Binomial(sendbuf, sendcnt, sendtype,
804 recvbuf, recvcnt, recvtype, root,
809 mpi_errno = MV2_Scatter_function(sendbuf, sendcnt, sendtype,
810 recvbuf, recvcnt, recvtype, root,