From 6f6d8180a3e84e64e4dd0ea8770d4c202f2c6bc1 Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Fri, 28 Sep 2018 18:54:47 -0700 Subject: [PATCH] coll libnbc: Remove dead code Remove dead code that was causing warnings about unused static functions. Signed-off-by: Brian Barrett (cherry picked from commit 2e24e6ec082d29f76dcbc75c6f214d2d0d647701) Signed-off-by: Brian Barrett --- .../mca/coll/libnbc/nbc_ineighbor_allgather.c | 151 ------------------ 1 file changed, 151 deletions(-) diff --git a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c index e15ddf3326..ad0f6a128f 100644 --- a/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c +++ b/ompi/mca/coll/libnbc/nbc_ineighbor_allgather.c @@ -181,157 +181,6 @@ int ompi_coll_libnbc_ineighbor_allgather(const void *sbuf, int scount, MPI_Datat return OMPI_SUCCESS; } -/* better binomial bcast - * working principle: - * - each node gets a virtual rank vrank - * - the 'root' node get vrank 0 - * - node 0 gets the vrank of the 'root' - * - all other ranks stay identical (they do not matter) - * - * Algorithm: - * - each node with vrank > 2^r and vrank < 2^r+1 receives from node - * vrank - 2^r (vrank=1 receives from 0, vrank 0 receives never) - * - each node sends each round r to node vrank + 2^r - * - a node stops to send if 2^r > commsize - */ -#define RANK2VRANK(rank, vrank, root) \ -{ \ - vrank = rank; \ - if (rank == 0) vrank = root; \ - if (rank == root) vrank = 0; \ -} -#define VRANK2RANK(rank, vrank, root) \ -{ \ - rank = vrank; \ - if (vrank == 0) rank = root; \ - if (vrank == root) rank = 0; \ -} -static inline int bcast_sched_binomial(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype) { - int maxr, vrank, peer, res; - - maxr = (int)ceil((log((double)p)/LOG2)); - - RANK2VRANK(rank, vrank, root); - - /* receive from the right hosts */ - if (vrank != 0) { - for (int r = 0 ; r < maxr ; ++r) { - if ((vrank >= (1 << r)) && (vrank < (1 << (r + 1)))) { - VRANK2RANK(peer, vrank - (1 << r), root); - res = NBC_Sched_recv (buffer, false, count, datatype, peer, schedule, false); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - } - - res = NBC_Sched_barrier (schedule); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - - /* now send to the right hosts */ - for (int r = 0 ; r < maxr ; ++r) { - if (((vrank + (1 << r) < p) && (vrank < (1 << r))) || (vrank == 0)) { - VRANK2RANK(peer, vrank + (1 << r), root); - res = NBC_Sched_send (buffer, false, count, datatype, peer, schedule, false); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - } - - return OMPI_SUCCESS; -} - -/* simple linear MPI_Ibcast */ -static inline int bcast_sched_linear(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype) { - int res; - - /* send to all others */ - if(rank == root) { - for (int peer = 0 ; peer < p ; ++peer) { - if (peer != root) { - /* send msg to peer */ - res = NBC_Sched_send (buffer, false, count, datatype, peer, schedule, false); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - } - } else { - /* recv msg from root */ - res = NBC_Sched_recv (buffer, false, count, datatype, root, schedule, false); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - - return OMPI_SUCCESS; -} - -/* simple chained MPI_Ibcast */ -static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *schedule, void *buffer, int count, MPI_Datatype datatype, int fragsize, size_t size) { - int res, vrank, rpeer, speer, numfrag, fragcount, thiscount; - MPI_Aint ext; - char *buf; - - RANK2VRANK(rank, vrank, root); - VRANK2RANK(rpeer, vrank-1, root); - VRANK2RANK(speer, vrank+1, root); - res = ompi_datatype_type_extent(datatype, &ext); - if (MPI_SUCCESS != res) { - NBC_Error("MPI Error in ompi_datatype_type_extent() (%i)", res); - return res; - } - - if (count == 0) { - return OMPI_SUCCESS; - } - - numfrag = count * size/fragsize; - if ((count * size) % fragsize != 0) { - numfrag++; - } - - fragcount = count/numfrag; - - for (int fragnum = 0 ; fragnum < numfrag ; ++fragnum) { - buf = (char *) buffer + fragnum * fragcount * ext; - thiscount = fragcount; - if (fragnum == numfrag-1) { - /* last fragment may not be full */ - thiscount = count - fragcount * fragnum; - } - - /* root does not receive */ - if (vrank != 0) { - res = NBC_Sched_recv (buf, false, thiscount, datatype, rpeer, schedule, true); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - - /* last rank does not send */ - if (vrank != p-1) { - res = NBC_Sched_send (buf, false, thiscount, datatype, speer, schedule, false); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - - /* this barrier here seems awaward but isn't!!!! */ - if (vrank == 0) { - res = NBC_Sched_barrier (schedule); - if (OPAL_UNLIKELY(OMPI_SUCCESS != res)) { - return res; - } - } - } - } - - return OMPI_SUCCESS; -} int ompi_coll_libnbc_neighbor_allgather_init(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, struct ompi_communicator_t *comm,