Fixes #4647: Move r31806, r31841 to v1.8 branch (pml ob1: use the pre-computed)

---svn-pre-commit-ignore-below---

r31806 [[BR]]
pml_ob1: ensure to have enough space for send/recvreq on stack

r30343 introduced the optimization of putting the OB1 sendreq and
recvreq on the stack for blocking sends and receives.  However, the
requests did not contain enough storage for the data that is normally
immediately ''after'' the request (e.g., BTL data).

This commit changes these requests to be pointers and to use alloca()
to get enough total space for the OB1 request and all the associated
data.

The change is smaller than it looks; most of it is just changing from
"foo.bar" to "foo->bar" notation (etc.).

Submitted by Jeff, reviewed by Nathan.  But we want George to look at
this (and get a little soak time on the trunk) before moving to v1.8.

cmr=v1.8.2:reviewer=bosilca

r31841 [[BR]]
pml ob1: use the pre-computed size from the free lists

Based on a suggestion from George on #31806, use the pre-computed
sizes rather than duplicating the computation math (which may change
someday in the future).

cmr=v1.8.2:ticket=#4647
Fixes #4530: Move r31419 to v1.8 branch (bcol/basesmuma: fix broken allgather algorithm)

---svn-pre-commit-ignore-below---

r31419 [[BR]]
bcol/basesmuma: fix broken allgather algorithm

The algorithm was failing ibm/collective/allgather and iallgather. I
cleaned up the code to eliminate duplicate code paths and tracked the
issue down to an error in the way extra nodes in the knomial exchange
are handled. The new code is more compact and has been tested with up
to 64 ranks with the ibm test suite.

cmr=v1.8.1:reviewer=manjugv
Fixes #4625: Move r31754 to v1.8 branch (Correct a misplaced bracket -)

---svn-pre-commit-ignore-below---

r31754 [[BR]]
Correct a misplaced bracket - daemons shouldn't be doing app-related operations

This may need a patch for 1.8.2, but we can try to directly apply it

cmr=v1.8.2:reviewer=hjelmn
Fixes #4628: Move r31764, r31769 to v1.8 branch (Fix bug in r31764)

---svn-pre-commit-ignore-below---

r31764 [[BR]]
opal_free_list: destruct free lists items when destructing the free
list

This commit updates the behavior of opal_free_list_t to match the
behavior of ompi_free_list_t. opal_free_list_t constructed items
placed on the free list but never destructed them.

cmr=v1.8.2:reviewer=jsquyres

r31769 [[BR]]
Fix bug in r31764

Need to remove the items of the list to avoid an assert in debug builds.

cmr=v1.8.2:ticket=#4628
Fixes #4643: Move r31782 to v1.8 branch (Fix bugs that were causing)

---svn-pre-commit-ignore-below---

r31782 [[BR]]
Fix bugs that were causing leaks in finalize.

This commit fixes leaks of bml endpoints in finalize. A summary of the
bugs/fixes is below.

 1) ompi_mpi_finalize used ompi_proc_all to get the list of procs but
    never released the reference to them (ompi_proc_all called
    OBJ_RETAIN on all the procs returned). When calling del_procs at
    finalize it should suffice to call ompi_proc_world which does not
    increment the reference count.

 2) del_procs is called BEFORE ompi_comm_finalize. This leaves the
    references to the procs from calling the pml_add_comm
    function. The fix is to reorder the calls to do omp_comm_finalize,
    del_procs, pml_finalize instead of del_procs, pml_finalize,
    ompi_comm_finalize.

 3) The check in del_procs in r2 checked for a reference count of
    1. This is incorrect. At this point there should be 2 references:
    1 from ompi_proc, and another from the add_procs. The fix is to
    change this check to look for a reference count of 22. This check
    makes me extremely uncomforable as nothing will call del_procs if
    the reference count of a procs is not 2 when del_procs is
    called. Maybe there should be an assert since this is a developer
    error IMHO.

cmr=v1.8.2:reviewer=bosilca
Fixes #4645: Move r31786, 31829, r31830, r31833, r31834, r31835, r31846 to v1.8 branch (bml/r2 : fix mca_bml_r2_del_procs())

---svn-pre-commit-ignore-below---

r31786 [[BR]]
Fix a typo in mca_bml_r2_del_procs()

Use bml_endpoint->btl_eager instead of bml_endpoint->btl_send.

cmr=v1.8.2:reviewer=rhc

r31829 [[BR]]
bml/r2: fix a problem identified by Gilles

This commit fixes two issues:

 - This intent of the code @ bml_r2.c:486 is to prevent calling the
   btl_del_procs more than once for a given proc. Gilles correctly
   identified there was a problem in this code but r31786 we not the
   correct fix.

 - Fix a segmentation fault in r2 finalize revealed by the fact we
   actually call del_procs now.

cmr=v1.8.2:reviewer=ggouaillardet:ticket=#4645

r31830 [[BR]]
bml/r2 : fix mca_bml_r2_del_procs()

cmr=v1.8.2:reviewer=hjelmn:ticket=#4645

r31833 [[BR]]
Show the unreacheable message for the first unreacheable proc
and then stop.

r31834 [[BR]]
Handle the del_procs correctly. The btl_send is the complete list
of existing BTL fo an endpoint, all the others are just partial list.
Thus, all the cleaning should first be done in the btl_send array,
and them in the other arrays (btl_eager and btl_rdma).

r31835 [[BR]]
In fact btl_eager and btl_dma will just vanish upon destruction of the
bml_endpoint. No need to clean them bfore.

r31846 [[BR]]
Remove unused variables.
Fixes #4651: Move r31815, 31831, r31836 to v1.8 branch (Fix mca_coll_basic_alltoallw_inter())

---svn-pre-commit-ignore-below---

r31815 [[BR]]
Fixes *alltoall* collectives at top level

This commit :
 - Correctly retrieve the communicator size when
   checking memory and parameters
 - Ensure (sendtype,sendcount) and (recvtype,recvcount)
   matches and return with MPI_ERR_TRUNCATE otherwise
 - Return with MPI_SUCCESS without invoking the low level
   if no data is going to be transferred
 - Fixes #4506

cmr=v1.8.2:reviewer=bosilca

r31831 [[BR]]
Fixes *alltoall* collectives at top

 - fix bugs
 - silent warnings

cmr=v1.8.2:ticket=4651:reviewer=bosilca

r31836 [[BR]]
Fix mca_coll_basic_alltoallw_inter()

Avoid sending/receiving zero size messages in order to be compliant
with the top-level modification

cmr=v1.8.2:ticket=4651:reviewer=bosilca
Fixes #4654: Move r31817 to v1.8 branch (Fix a typo in MCA_PML_OB1_RECV_REQUEST_UNPACK)

---svn-pre-commit-ignore-below---

r31817 [[BR]]
Fix a typo in MCA_PML_OB1_RECV_REQUEST_UNPACK

cmr=v1.8.2:reviewer=rhc