diff --git a/src/mpi/coll/coll_algorithms.txt b/src/mpi/coll/coll_algorithms.txt index edca0b068af..96a86da3fe0 100644 --- a/src/mpi/coll/coll_algorithms.txt +++ b/src/mpi/coll/coll_algorithms.txt @@ -81,8 +81,11 @@ ibcast-intra: cvar_params: TREE_TYPE, TREE_KVAL, TREE_PIPELINE_CHUNK_SIZE tsp_scatterv_recexch_allgatherv func_name: scatterv_allgatherv - extra_params: scatterv_k, allgatherv_k - cvar_params: SCATTERV_KVAL, ALLGATHERV_RECEXCH_KVAL + extra_params: allgatherv_algo=MPIR_CVAR_IALLGATHERV_INTRA_ALGORITHM_tsp_recexch_doubling, scatterv_k, allgatherv_k + cvar_params: -, SCATTERV_KVAL, ALLGATHERV_RECEXCH_KVAL + tsp_scatterv_ring_allgatherv + extra_params: scatterv_k + cvar_params: SCATTERV_KVAL tsp_ring func_name: tree extra_params: tree_type=MPIR_TREE_TYPE_KARY, k=1, chunk_size diff --git a/src/mpi/coll/cvars.txt b/src/mpi/coll/cvars.txt index 74cfac7b223..afb1b4d80ef 100644 --- a/src/mpi/coll/cvars.txt +++ b/src/mpi/coll/cvars.txt @@ -299,6 +299,7 @@ cvars: sched_scatter_ring_allgather - Force Scatter Ring Allgather algorithm tsp_tree - Force Generic Transport Tree algorithm tsp_scatterv_recexch_allgatherv - Force Generic Transport Scatterv followed by Recursive Exchange Allgatherv algorithm + tsp_scatterv_ring_allgatherv - Force Generic Transport Scatterv followed by Ring Allgatherv algorithm tsp_ring - Force Generic Transport Ring algorithm - name : MPIR_CVAR_IBCAST_SCATTERV_KVAL diff --git a/src/mpi/coll/ibcast/Makefile.mk b/src/mpi/coll/ibcast/Makefile.mk index eb4d2fa5aaa..909553902f4 100644 --- a/src/mpi/coll/ibcast/Makefile.mk +++ b/src/mpi/coll/ibcast/Makefile.mk @@ -14,6 +14,7 @@ mpi_core_sources += \ src/mpi/coll/ibcast/ibcast_intra_sched_smp.c \ src/mpi/coll/ibcast/ibcast_inter_sched_flat.c \ src/mpi/coll/ibcast/ibcast_tsp_scatterv_allgatherv.c \ + src/mpi/coll/ibcast/ibcast_tsp_scatterv_ring_allgatherv.c \ src/mpi/coll/ibcast/ibcast_tsp_tree.c \ src/mpi/coll/ibcast/ibcast_utils.c diff --git a/src/mpi/coll/ibcast/ibcast_tsp_scatterv_allgatherv.c b/src/mpi/coll/ibcast/ibcast_tsp_scatterv_allgatherv.c index edb72de0852..b7ea09db27e 100644 --- a/src/mpi/coll/ibcast/ibcast_tsp_scatterv_allgatherv.c +++ b/src/mpi/coll/ibcast/ibcast_tsp_scatterv_allgatherv.c @@ -9,8 +9,9 @@ /* Routine to schedule a scatter followed by recursive exchange based broadcast */ int MPIR_TSP_Ibcast_sched_intra_scatterv_allgatherv(void *buffer, MPI_Aint count, MPI_Datatype datatype, int root, - MPIR_Comm * comm, int scatterv_k, - int allgatherv_k, MPIR_TSP_sched_t sched) + MPIR_Comm * comm, int allgatherv_algo, + int scatterv_k, int allgatherv_k, + MPIR_TSP_sched_t sched) { int mpi_errno = MPI_SUCCESS; int mpi_errno_ret ATTRIBUTE((unused)) = MPI_SUCCESS; @@ -168,13 +169,19 @@ int MPIR_TSP_Ibcast_sched_intra_scatterv_allgatherv(void *buffer, MPI_Aint count mpi_errno = MPIR_TSP_sched_fence(sched); /* wait for scatter to complete */ MPIR_ERR_COLL_CHECKANDCONT(mpi_errno, errflag); - /* Schedule Allgatherv */ - mpi_errno = - MPIR_TSP_Iallgatherv_sched_intra_recexch(MPI_IN_PLACE, cnts[rank], MPI_BYTE, tmp_buf, cnts, - displs, MPI_BYTE, comm, 0, allgatherv_k, sched); + if (allgatherv_algo == MPIR_CVAR_IALLGATHERV_INTRA_ALGORITHM_tsp_ring) + /* Schedule Allgatherv ring */ + mpi_errno = + MPIR_TSP_Iallgatherv_sched_intra_ring(MPI_IN_PLACE, cnts[rank], MPI_BYTE, tmp_buf, + cnts, displs, MPI_BYTE, comm, sched); + else + /* Schedule Allgatherv recexch */ + mpi_errno = + MPIR_TSP_Iallgatherv_sched_intra_recexch(MPI_IN_PLACE, cnts[rank], MPI_BYTE, tmp_buf, + cnts, displs, MPI_BYTE, comm, 0, allgatherv_k, + sched); MPIR_ERR_CHECK(mpi_errno); - if (!is_contig) { if (rank != root) { mpi_errno = MPIR_TSP_sched_sink(sched, &sink_id); /* wait for allgather to complete */ diff --git a/src/mpi/coll/ibcast/ibcast_tsp_scatterv_ring_allgatherv.c b/src/mpi/coll/ibcast/ibcast_tsp_scatterv_ring_allgatherv.c new file mode 100644 index 00000000000..25016705afa --- /dev/null +++ b/src/mpi/coll/ibcast/ibcast_tsp_scatterv_ring_allgatherv.c @@ -0,0 +1,31 @@ +/* + * Copyright (C) by Argonne National Laboratory + * See COPYRIGHT in top-level directory + */ + +#include "mpiimpl.h" +#include "algo_common.h" + +/* Routine to schedule a scatter followed by ring based broadcast */ +int MPIR_TSP_Ibcast_sched_intra_scatterv_ring_allgatherv(void *buffer, MPI_Aint count, + MPI_Datatype datatype, int root, + MPIR_Comm * comm, int scatterv_k, + MPIR_TSP_sched_t sched) +{ + int mpi_errno = MPI_SUCCESS; + + MPIR_FUNC_ENTER; + + mpi_errno = MPIR_TSP_Ibcast_sched_intra_scatterv_allgatherv(buffer, count, datatype, root, + comm, + MPIR_CVAR_IALLGATHERV_INTRA_ALGORITHM_tsp_ring, + scatterv_k, 0, sched); + MPIR_ERR_CHECK(mpi_errno); + + fn_exit: + MPIR_FUNC_EXIT; + return mpi_errno; + fn_fail: + goto fn_exit; + +} diff --git a/src/mpi/coll/include/csel_container.h b/src/mpi/coll/include/csel_container.h index e6630a19175..5ae50ac8db3 100644 --- a/src/mpi/coll/include/csel_container.h +++ b/src/mpi/coll/include/csel_container.h @@ -115,6 +115,7 @@ typedef enum { MPII_CSEL_CONTAINER_TYPE__ALGORITHM__MPIR_Ibarrier_inter_sched_bcast, MPII_CSEL_CONTAINER_TYPE__ALGORITHM__MPIR_Ibcast_intra_tsp_tree, MPII_CSEL_CONTAINER_TYPE__ALGORITHM__MPIR_Ibcast_intra_tsp_scatterv_recexch_allgatherv, + MPII_CSEL_CONTAINER_TYPE__ALGORITHM__MPIR_Ibcast_intra_tsp_scatterv_ring_allgatherv, MPII_CSEL_CONTAINER_TYPE__ALGORITHM__MPIR_Ibcast_intra_tsp_ring, MPII_CSEL_CONTAINER_TYPE__ALGORITHM__MPIR_Ibcast_intra_sched_binomial, MPII_CSEL_CONTAINER_TYPE__ALGORITHM__MPIR_Ibcast_intra_sched_scatter_recursive_doubling_allgather, @@ -287,6 +288,9 @@ typedef struct { int scatterv_k; int allgatherv_k; } intra_tsp_scatterv_recexch_allgatherv; + struct { + int scatterv_k; + } intra_tsp_scatterv_ring_allgatherv; } ibcast; struct { struct { diff --git a/test/mpi/maint/coll_cvars.txt b/test/mpi/maint/coll_cvars.txt index e478b9dfe21..8f5e951cfea 100644 --- a/test/mpi/maint/coll_cvars.txt +++ b/test/mpi/maint/coll_cvars.txt @@ -350,6 +350,8 @@ algorithms: tsp_scatterv_recexch_allgatherv .MPIR_CVAR_IBCAST_SCATTERV_KVAL=3 .MPIR_CVAR_IBCAST_ALLGATHER_RECEXCH=3 + tsp_scatterv_ring_allgatherv + .MPIR_CVAR_IBCAST_SCATTERV_KVAL=3 tsp_ring .MPIR_CVAR_IBCAST_RING_CHUNK_SIZE=4096 exscan: