Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DART: Support alignment in allocation #297

Open
fuchsto opened this issue Feb 22, 2017 · 1 comment
Open

DART: Support alignment in allocation #297

fuchsto opened this issue Feb 22, 2017 · 1 comment

Comments

@fuchsto
Copy link
Member

fuchsto commented Feb 22, 2017

As previously discussed in issue #280, DART should support user-specified alignment for allocation (also see #280 (comment))

@devreal
Copy link
Member

devreal commented Feb 22, 2017

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 devreal modified the milestones: dash-0.4.0, dash-0.5.0 May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants