1
1
openmpi/ompi/mca/coll/base
2016-03-29 15:50:32 -04: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 Cleanup the warnings from the ompi layer when compiling optimized under Mac OSX 2015-12-17 17:39:15 -08:00
coll_base_allgatherv.c Cleanup the warnings from the ompi layer when compiling optimized under Mac OSX 2015-12-17 17:39:15 -08:00
coll_base_allreduce.c Cleanup the warnings from the ompi layer when compiling optimized under Mac OSX 2015-12-17 17:39:15 -08:00
coll_base_alltoall.c Fix for Coverity CID 1357152. 2016-03-24 00:53:30 -04:00
coll_base_alltoallv.c Fix issues identified by @derbeyn. 2016-03-29 15:50:32 -04:00
coll_base_barrier.c Fix multiple issues with the collective requests. 2016-03-23 18:35:41 -04: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 Purge whitespace from the repo 2015-06-23 20:59:57 -07: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 Cleanup the warnings from the ompi layer when compiling optimized under Mac OSX 2015-12-17 17:39:15 -08: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: fix a typo 2016-03-11 14:18:03 +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?  :-)
     *
     */