1414 * Copyright (c) 2013      Los Alamos National Security, LLC. All Rights 
1515 *                         reserved. 
1616 * Copyright (c) 2013      FUJITSU LIMITED.  All rights reserved. 
17-  * Copyright (c) 2014-2015  Research Organization for Information Science 
17+  * Copyright (c) 2014-2016  Research Organization for Information Science 
1818 *                         and Technology (RIST). All rights reserved. 
1919 * $COPYRIGHT$ 
2020 * 
@@ -45,7 +45,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
4545    mca_coll_base_module_t  * base_module  =  (mca_coll_base_module_t * ) module ;
4646    int  i , j , size , rank , err = MPI_SUCCESS ;
4747    ompi_request_t  * * preq , * * reqs ;
48-     char  * tmp_buffer ;
48+     char  * allocated_buffer ,  * tmp_buffer ;
4949    size_t  max_size , rdtype_size ;
5050    OPAL_PTRDIFF_TYPE  ext , gap  =  0 ;
5151
@@ -69,11 +69,11 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
6969    /* The gap will always be the same as we are working on the same datatype */ 
7070
7171    /* Allocate a temporary buffer */ 
72-     tmp_buffer  =  calloc  (max_size , 1 );
73-     if  (NULL  ==  tmp_buffer ) {
72+     allocated_buffer  =  calloc  (max_size , 1 );
73+     if  (NULL  ==  allocated_buffer ) {
7474        return  OMPI_ERR_OUT_OF_RESOURCE ;
7575    }
76-     tmp_buffer  +=  gap ;
76+     tmp_buffer  =   allocated_buffer   -  gap ;
7777
7878    /* Initiate all send/recv to/from others. */ 
7979    reqs  =  preq  =  coll_base_comm_get_reqs (base_module -> base_data , 2 );
@@ -126,7 +126,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts
126126
127127 error_hndl :
128128    /* Free the temporary buffer */ 
129-     free  (tmp_buffer );
129+     free  (allocated_buffer );
130130    if ( MPI_SUCCESS  !=  err  ) {
131131        ompi_coll_base_free_reqs (reqs , 2  );
132132    }
0 commit comments