Pass NULL to the collective components for unused buffers.
We want the underlying algorithms to know when they can use a buffer as a temporary, such as when one module delegate a collective to another. Instead of allocating temporaries everywhere, we allow the upper level module to handle the temporary buffers, and pass them into all the others. Thus, we need to make sure that the user provided buffers are screened such that they don't make it as temporaries.
This could help #11418 to streamline the call to the xhc reduction.
Passing cleaned parameters seems sensible. But what about allreduce and alltoall?
Neither Allreduce or Alltoall provide the opportunity for the user to provide a buffer that shall not be used. That would be possible for the other flavors of MPI_Alltoall{v,w,x} but there the count will be NULL for all unused buffers, so we already have a way to see if the buffer is usable. Also, in these operations we are not allowed to change the user-provided arrays, which means we will always be forced to operate on temporary memory with all the associated overheads.
Neither Allreduce or Alltoall provide the opportunity for the user to provide a buffer that shall not be used. That would be possible for the other flavors of MPI_Alltoall{v,w,x} but there the count will be NULL for all unused buffers, so we already have a way to see if the buffer is usable. Also, in these operations we are not allowed to change the user-provided arrays, which means we will always be forced to operate on temporary memory with all the associated overheads.
Right, I was thinking in terms of MPI_IN_PLACE but that is a known value already so no need to use NULL.
Hi, were there any concerns or issues left to resolve with this? Is it good to be merged?