dash icon indicating copy to clipboard operation
dash copied to clipboard

DART: Support alignment in allocation

Open fuchsto opened this issue 8 years ago • 1 comments

As previously discussed in issue #280, DART should support user-specified alignment for allocation (also see https://github.com/dash-project/dash/issues/280#issuecomment-279759290)

fuchsto avatar Feb 22 '17 00:02 fuchsto

Thanks for moving this here. Before I start getting my hands dirty, I would like to define the means of ensuring alignment that we want to support:

  1. Something like dart_memalign: Fairly easy to do as the offset would be stored in the gptr alone. Downside: you can still access the unaligned leading portion of the allocated memory. Also, the aligned portions will likely be smaller, thus holding less elements than initially requested.

  2. Pass minimum alignment as an option to dart_team_memalloc_symmetric (previously dart_team_memalloc_aligned), dart_team_memalloc (to be introduced), and dart_memalloc: the functions would allocate additional padding bytes and ensure alignment of the first element. This likely requires some additional book keeping of the raw pointer and the aligned pointer. A value of 0 will cause a fall-back to the alignment provided by the underlying allocator (MPI).

  3. Alternative to 2: introduce separate functions that allow the specification of alignment. This is similar to the POSIX model, where malloc and posix_memalign are two different functions.

Personally, I am in favor of 2) but open for discussions.

devreal avatar Feb 22 '17 09:02 devreal