ompi icon indicating copy to clipboard operation
ompi copied to clipboard

Pass NULL to the collective components for unused buffers.

Open bosilca opened this issue 2 years ago • 2 comments

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.

bosilca avatar Apr 01 '23 00:04 bosilca

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.

bosilca avatar Apr 02 '23 15:04 bosilca

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.

devreal avatar Apr 03 '23 15:04 devreal

Hi, were there any concerns or issues left to resolve with this? Is it good to be merged?

gkatev avatar Apr 01 '24 08:04 gkatev