Skip to content

Cleanup the temporary memory allocation in collectives #1091

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 2 commits into from
Dec 4, 2015

Conversation

bosilca
Copy link
Member

@bosilca bosilca commented Nov 3, 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.

This is a second attempt of fixing this issue (follow-up on #1047)

@ggouaillardet
Copy link
Contributor

@bosilca
one malloc is missing, patch is inline

index 17ac951..2ee07d0 100644
--- a/ompi/mca/coll/basic/coll_basic_scan.c
+++ b/ompi/mca/coll/basic/coll_basic_scan.c
@@ -75,6 +75,7 @@ mca_coll_basic_scan_intra(const void *sbuf, void *rbuf, int count,
          * receive into, later. */

         dsize = opal_datatype_span(&dtype->super, count, &gap);
+        free_buffer = malloc(dsize);
         if (NULL == free_buffer) {
             return OMPI_ERR_OUT_OF_RESOURCE;
         }

bosilca added a commit to bosilca/ompi that referenced this pull request Nov 22, 2015
@bosilca bosilca force-pushed the topic/datatype_span branch from 61235b3 to fcdd20b Compare November 22, 2015 22:30
bosilca added a commit to bosilca/ompi that referenced this pull request Nov 22, 2015
@jsquyres
Copy link
Member

@bosilca Looks like a merge went wrong on this PR. Can you fix?

@bosilca bosilca force-pushed the topic/datatype_span branch from 08b382e to f137b88 Compare December 3, 2015 01:38
bosilca added a commit to bosilca/ompi that referenced this pull request Dec 3, 2015
some of the collective modules. Added a new function
opan_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.
@bosilca bosilca force-pushed the topic/datatype_span branch from f137b88 to 688108c Compare December 3, 2015 01:42
bosilca added a commit that referenced this pull request Dec 4, 2015
Cleanup the temporary memory allocation in collectives
@bosilca bosilca merged commit 8fee96c into open-mpi:master Dec 4, 2015
@bosilca bosilca deleted the topic/datatype_span branch December 4, 2015 00:25
jsquyres pushed a commit to jsquyres/ompi that referenced this pull request Aug 23, 2016
jsquyres pushed a commit to jsquyres/ompi that referenced this pull request Sep 19, 2016
…o-weak-symbol-fix

v1.10: fortran: Fix `ompi_alloc_mem_cptr_f` linkage error
jsquyres pushed a commit to jsquyres/ompi that referenced this pull request Sep 19, 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