George -- Unfortunately, this didn't automatically create CMRs (I'm not sure why). :-(
Begin forwarded message: > From: bosi...@osl.iu.edu > Date: April 14, 2011 5:50:07 PM EDT > To: svn-f...@open-mpi.org > Subject: [OMPI svn-full] svn:open-mpi r24617 > Reply-To: de...@open-mpi.org > > Author: bosilca > Date: 2011-04-14 17:50:06 EDT (Thu, 14 Apr 2011) > New Revision: 24617 > URL: https://svn.open-mpi.org/trac/ompi/changeset/24617 > > Log: > Based on the patch submitted by Pascal Deveze, here is the memory leak fix > for the type indexed creation. > > CMR v1.4 and v1.5. > > Text files modified: > trunk/ompi/datatype/ompi_datatype_create_indexed.c | 62 > ++++++++++++++++----------------------- > 1 files changed, 26 insertions(+), 36 deletions(-) > > Modified: trunk/ompi/datatype/ompi_datatype_create_indexed.c > ============================================================================== > --- trunk/ompi/datatype/ompi_datatype_create_indexed.c (original) > +++ trunk/ompi/datatype/ompi_datatype_create_indexed.c 2011-04-14 > 17:50:06 EDT (Thu, 14 Apr 2011) > @@ -3,7 +3,7 @@ > * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana > * University Research and Technology > * Corporation. All rights reserved. > - * Copyright (c) 2004-2009 The University of Tennessee and The University > + * Copyright (c) 2004-2010 The University of Tennessee and The University > * of Tennessee Research Foundation. All rights > * reserved. > * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, > @@ -46,26 +46,21 @@ > dLength = pBlockLength[0]; > endat = disp + dLength; > ompi_datatype_type_extent( oldType, &extent ); > - if( 1 >= count ) { > - pdt = ompi_datatype_create( oldType->super.desc.used + 2 ); > - /* multiply by count to make it zero if count is zero */ > - ompi_datatype_add( pdt, oldType, count * dLength, disp * extent, > extent ); > - } else { > - pdt = ompi_datatype_create( count * (2 + oldType->super.desc.used) ); > - for( i = 1; i < count; i++ ) { > - if( endat == pDisp[i] ) { > - /* contiguous with the previsious */ > - dLength += pBlockLength[i]; > - endat += pBlockLength[i]; > - } else { > - ompi_datatype_add( pdt, oldType, dLength, disp * extent, > extent ); > - disp = pDisp[i]; > - dLength = pBlockLength[i]; > - endat = disp + pBlockLength[i]; > - } > + > + pdt = ompi_datatype_create( count * (2 + oldType->super.desc.used) ); > + for( i = 1; i < count; i++ ) { > + if( endat == pDisp[i] ) { > + /* contiguous with the previsious */ > + dLength += pBlockLength[i]; > + endat += pBlockLength[i]; > + } else { > + ompi_datatype_add( pdt, oldType, dLength, disp * extent, extent > ); > + disp = pDisp[i]; > + dLength = pBlockLength[i]; > + endat = disp + pBlockLength[i]; > } > - ompi_datatype_add( pdt, oldType, dLength, disp * extent, extent ); > } > + ompi_datatype_add( pdt, oldType, dLength, disp * extent, extent ); > > *newType = pdt; > return OMPI_SUCCESS; > @@ -91,25 +86,20 @@ > dLength = pBlockLength[0]; > endat = disp + dLength * extent; > > - if( 1 >= count ) { > - pdt = ompi_datatype_create( oldType->super.desc.used + 2 ); > - /* multiply by count to make it zero if count is zero */ > - ompi_datatype_add( pdt, oldType, count * dLength, disp, extent ); > - } else { > - for( i = 1; i < count; i++ ) { > - if( endat == pDisp[i] ) { > - /* contiguous with the previsious */ > - dLength += pBlockLength[i]; > - endat += pBlockLength[i] * extent; > - } else { > - ompi_datatype_add( pdt, oldType, dLength, disp, extent ); > - disp = pDisp[i]; > - dLength = pBlockLength[i]; > - endat = disp + pBlockLength[i] * extent; > - } > + for( i = 1; i < count; i++ ) { > + if( endat == pDisp[i] ) { > + /* contiguous with the previsious */ > + dLength += pBlockLength[i]; > + endat += pBlockLength[i] * extent; > + } else { > + ompi_datatype_add( pdt, oldType, dLength, disp, extent ); > + disp = pDisp[i]; > + dLength = pBlockLength[i]; > + endat = disp + pBlockLength[i] * extent; > } > - ompi_datatype_add( pdt, oldType, dLength, disp, extent ); > } > + ompi_datatype_add( pdt, oldType, dLength, disp, extent ); > + > *newType = pdt; > return OMPI_SUCCESS; > } > _______________________________________________ > svn-full mailing list > svn-f...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/svn-full -- Jeff Squyres jsquy...@cisco.com For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/