Skip to content

Cleanup the temporary memory allocation in collectives #1047

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

Merged
merged 1 commit into from
Nov 2, 2015

Conversation

bosilca
Copy link
Member

@bosilca bosilca commented Oct 21, 2015

Cleanup the memory handling for temporary buffers in some of the collective modules. Added a new function opal_datatype_span, to compute the memory span of count number of datatype, excluding the gaps in the beginning and at the end. If a memory allocation is made using the returned value, the gap (also returned) should be removed from the allocated pointer.

@ggouaillardet
Copy link
Contributor

what about using a new function ?

int opal_datatype_alloc(opal_datatype_t * type, int count, void ** buf, void ** buf_free);

the rationale is code factorization, plus most of the time, we only need true_extent for

buf = buf_free - true_extent

@bosilca
Copy link
Member Author

bosilca commented Oct 21, 2015

The difference with what is already inside is marginal (yours allocate and returns memory, mine if returning everything you need to do it right yourself). I prefer not to have a memory allocator down in OPAL datatype, but instead let people handle this the way they want/need.

@jsquyres
Copy link
Member

bot:retest

@bosilca bosilca added this to the Open MPI v2.0.0 milestone Oct 24, 2015
@bosilca bosilca force-pushed the topic/datatype_span branch from d93cb58 to 0a57cca Compare October 27, 2015 03:49
bosilca added a commit that referenced this pull request Nov 2, 2015
Cleanup the temporary memory allocation in collectives
@bosilca bosilca merged commit eca7347 into open-mpi:master Nov 2, 2015
@bosilca bosilca deleted the topic/datatype_span branch November 2, 2015 02:20
@bosilca bosilca restored the topic/datatype_span branch November 2, 2015 02:36
jsquyres pushed a commit to jsquyres/ompi that referenced this pull request Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants