1
1
openmpi/ompi/mca/coll/base
Howard Pritchard ff669e7b15 code cleanup: clang is now a happier panda
Clang 5.1 on my mac was a sad panda compiling a couple
of files,  complaining about uninitialized stack variables.

This commit makes clang a happier panda (or at least not so sad).

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
2016-08-04 19:34:44 -06:00
..
base.h Consistently use the request array for all modules (single array stored 2015-10-08 12:00:41 -04:00
coll_base_allgather.c coll/base: return MPI_ERR_UNSUPPORTED_OPERATION when coll_base_*_two_procs algo is used on a communicator that has no two tasks 2016-05-09 14:18:40 +09:00
coll_base_allgatherv.c coll/base: fix ompi_coll_base_allgatherv_intra_basic_default() with MPI_IN_PLACE 2016-07-28 13:57:18 +09:00
coll_base_allreduce.c coll/base: fix memory free in ompi_coll_base_allreduce_intra_recursivedoubling err handler 2016-06-09 13:12:25 +09:00
coll_base_alltoall.c code cleanup: clang is now a happier panda 2016-08-04 19:34:44 -06:00
coll_base_alltoallv.c coll/base: fix non zero lower bound datatype handling in mca_coll_base_alltoallv_intra_basic_inplace() 2016-07-08 16:55:26 +09:00
coll_base_barrier.c Fix the coll_base_sendrecv function. 2016-06-18 18:23:51 +02:00
coll_base_bcast.c Fix multiple issues with the collective requests. 2016-03-23 18:35:41 -04:00
coll_base_comm_select.c coll/base: neg. priority cleanup, verbose output improvements 2016-07-01 13:41:27 -05:00
coll_base_comm_unselect.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
coll_base_find_available.c Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
coll_base_frame.c Fix multiple issues with the collective requests. 2016-03-23 18:35:41 -04:00
coll_base_functions.h coll/base: fix coverity issues 2016-03-18 09:31:43 -06:00
coll_base_gather.c Cleanup the warnings from the ompi layer when compiling optimized under Mac OSX 2015-12-17 17:39:15 -08:00
coll_base_reduce_scatter.c Cleanup the warnings from the ompi layer when compiling optimized under Mac OSX 2015-12-17 17:39:15 -08:00
coll_base_reduce.c coll/base: fix non zero lower bound ddt handling in ompi_coll_base_reduce_intra_basic_linear() 2016-07-07 15:49:48 +09:00
coll_base_scatter.c Cleanup the warnings from the ompi layer when compiling optimized under Mac OSX 2015-12-17 17:39:15 -08:00
coll_base_topo.c Fix few COVERITY reported issues. 2015-02-26 15:53:42 -05:00
coll_base_topo.h Update copyright. 2015-02-26 15:54:58 -05:00
coll_base_util.c coll/base: give a boost to ompi_coll_base_sendrecv_nonzero_actual() 2016-08-04 13:31:07 +09:00
coll_base_util.h MCA: Add the project/project version to the MCA base component 2015-03-27 10:59:04 -06:00
coll_tags.h Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
help-mca-coll-base.txt help: remove stale help messages and files 2015-10-13 16:50:20 -04:00
Makefile.am Purge whitespace from the repo 2015-06-23 20:59:57 -07:00
owner.txt add owner files to opa/ompi/orte mca directories 2015-02-22 15:10:23 -07:00
README.memory_management Cleanup the memory handling for temporary buffers in 2015-12-02 20:42:18 -05:00

    /* This comment applies to all collectives (including the basic
     * module) where we allocate a temporary buffer.  For the next few
     * lines of code, it's tremendously complicated how we decided that
     * this was the Right Thing to do.  Sit back and enjoy.  And prepare
     * to have your mind warped. :-)
     *
     * Recall some definitions (I always get these backwards, so I'm
     * going to put them here):
     *
     * extent: the length from the lower bound to the upper bound -- may
     * be considerably larger than the buffer required to hold the data
     * (or smaller!  But it's easiest to think about when it's larger).
     *
     * true extent: the exact number of bytes required to hold the data
     * in the layout pattern in the datatype.
     *
     * For example, consider the following buffer (just talking about
     * true_lb, extent, and true extent -- extrapolate for true_ub:
     *
     * A              B                                       C
     * --------------------------------------------------------
     * |              |                                       |
     * --------------------------------------------------------
     *
     * There are multiple cases:
     *
     * 1. A is what we give to MPI_Send (and friends), and A is where
     * the data starts, and C is where the data ends.  In this case:
     *
     * - extent: C-A
     * - true extent: C-A
     * - true_lb: 0
     *
     * A                                                      C
     * --------------------------------------------------------
     * |                                                      |
     * --------------------------------------------------------
     * <=======================extent=========================>
     * <======================true extent=====================>
     *
     * 2. A is what we give to MPI_Send (and friends), B is where the
     * data starts, and C is where the data ends.  In this case:
     *
     * - extent: C-A
     * - true extent: C-B
     * - true_lb: positive
     *
     * A              B                                       C
     * --------------------------------------------------------
     * |              |           User buffer                 |
     * --------------------------------------------------------
     * <=======================extent=========================>
     * <===============true extent=============>
     *
     * 3. B is what we give to MPI_Send (and friends), A is where the
     * data starts, and C is where the data ends.  In this case:
     *
     * - extent: C-A
     * - true extent: C-A
     * - true_lb: negative
     *
     * A              B                                       C
     * --------------------------------------------------------
     * |              |           User buffer                 |
     * --------------------------------------------------------
     * <=======================extent=========================>
     * <======================true extent=====================>
     *
     * 4. MPI_BOTTOM is what we give to MPI_Send (and friends), B is
     * where the data starts, and C is where the data ends.  In this
     * case:
     *
     * - extent: C-MPI_BOTTOM
     * - true extent: C-B
     * - true_lb: [potentially very large] positive
     *
     * MPI_BOTTOM     B                                       C
     * --------------------------------------------------------
     * |              |           User buffer                 |
     * --------------------------------------------------------
     * <=======================extent=========================>
     * <===============true extent=============>
     *
     * So in all cases, for a temporary buffer, all we need to malloc()
     * is a buffer of size true_extent.  We therefore need to know two
     * pointer values: what value to give to MPI_Send (and friends) and
     * what value to give to free(), because they might not be the same.
     *
     * Clearly, what we give to free() is exactly what was returned from
     * malloc().  That part is easy.  :-)
     *
     * What we give to MPI_Send (and friends) is a bit more complicated.
     * Let's take the 4 cases from above:
     *
     * 1. If A is what we give to MPI_Send and A is where the data
     * starts, then clearly we give to MPI_Send what we got back from
     * malloc().
     *
     * 2. If B is what we get back from malloc, but we give A to
     * MPI_Send, then the buffer range [A,B) represents "dead space"
     * -- no data will be put there.  So it's safe to give B-true_lb to
     * MPI_Send.  More specifically, the true_lb is positive, so B-true_lb is
     * actually A.
     *
     * 3. If A is what we get back from malloc, and B is what we give to
     * MPI_Send, then the true_lb is negative, so A-true_lb will actually equal
     * B.
     *
     * 4. Although this seems like the weirdest case, it's actually
     * quite similar to case #2 -- the pointer we give to MPI_Send is
     * smaller than the pointer we got back from malloc().
     *
     * Hence, in all cases, we give (return_from_malloc - true_lb) to MPI_Send.
     *
     * This works fine and dandy if we only have (count==1), which we
     * rarely do.  ;-) So we really need to allocate (true_extent +
     * ((count - 1) * extent)) to get enough space for the rest.  This may
     * be more than is necessary, but it's ok.
     *
     * Simple, no?  :-)
     *
     */