Skip to content

Commit

Permalink
integrate allgather_reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
wenduwan committed Aug 28, 2023
1 parent f8e36c7 commit f0bf7ee
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions ompi/mca/coll/tuned/coll_tuned_decision_fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ompi_coll_tuned_allreduce_intra_dec_fixed(const void *sbuf, void *rbuf, int coun
{
size_t dsize, total_dsize;
int communicator_size, alg;
static int prev_alg = 0;
communicator_size = ompi_comm_size(comm);
OPAL_OUTPUT((ompi_coll_tuned_stream, "ompi_coll_tuned_allreduce_intra_dec_fixed"));

Expand All @@ -72,26 +73,41 @@ ompi_coll_tuned_allreduce_intra_dec_fixed(const void *sbuf, void *rbuf, int coun
* {3, "recursive_doubling"},
* {4, "ring"},
* {5, "segmented_ring"},
* {6, "rabenseifner"
* {6, "rabenseifner"},
* {7, "allgather_reduce"}.
*
* Currently, ring, segmented ring, and rabenseifner do not support
* non-commutative operations.
*/
if( !ompi_op_is_commute(op) ) {
if (communicator_size < 4) {
if (total_dsize < 131072) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else if (total_dsize < 131072) {
alg = 3;
} else {
alg = 1;
}
} else if (communicator_size < 8) {
alg = 3;
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else {
alg = 3;
}
} else if (communicator_size < 16) {
if (total_dsize < 1048576) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else if (total_dsize < 1048576) {
alg = 3;
} else {
alg = 2;
}
} else if (communicator_size < 64) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else {
alg = 3;
}
} else if (communicator_size < 128) {
alg = 3;
} else if (communicator_size < 256) {
Expand Down Expand Up @@ -119,7 +135,9 @@ ompi_coll_tuned_allreduce_intra_dec_fixed(const void *sbuf, void *rbuf, int coun
}
} else {
if (communicator_size < 4) {
if (total_dsize < 8) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else if (total_dsize < 8) {
alg = 4;
} else if (total_dsize < 4096) {
alg = 3;
Expand All @@ -135,29 +153,37 @@ ompi_coll_tuned_allreduce_intra_dec_fixed(const void *sbuf, void *rbuf, int coun
alg = 6;
}
} else if (communicator_size < 8) {
if (total_dsize < 16) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else if (total_dsize < 16) {
alg = 4;
} else if (total_dsize < 8192) {
alg = 3;
} else {
alg = 6;
}
} else if (communicator_size < 16) {
if (total_dsize < 8192) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else if (total_dsize < 8192) {
alg = 3;
} else {
alg = 6;
}
} else if (communicator_size < 32) {
if (total_dsize < 64) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else if (total_dsize < 64) {
alg = 5;
} else if (total_dsize < 4096) {
alg = 3;
} else {
alg = 6;
}
} else if (communicator_size < 64) {
if (total_dsize < 128) {
if (OMPI_COMM_IS_DISJOINT(comm) && total_dsize < 8192) {
alg = 7;
} else if (total_dsize < 128) {
alg = 5;
} else {
alg = 6;
Expand Down

0 comments on commit f0bf7ee

Please sign in to comment.