[PATCH] Alloc only required # of updates

Jeffrey D. Oldham oldham at codesourcery.com
Tue Dec 30 18:08:50 UTC 2003


Richard Guenther wrote:
> Hi!
> 
> This patch changes the calcGCFillList routines to reserve only the
> required amount of entries in the list.  Tested with Layout tests and an
> assert checking the resulting size is not larger than the reserved one.
> 
> Ok?

Yes.

> Richard.
> 
> 
> 2003Dec30  Richard Guenther <richard.guenther at uni-tuebingen.de>
> 
> 	* src/Layout/GridLayout.cpp: allocate 2*Dim*local_m.size()
> 	fill list nodes only.
> 	src/Layout/UniformGridLayout.cpp: likewise.
> 
> Index: GridLayout.cpp
> ===================================================================
> RCS file: /home/pooma/Repository/r2/src/Layout/GridLayout.cpp,v
> retrieving revision 1.89
> diff -u -u -r1.89 GridLayout.cpp
> --- GridLayout.cpp	11 Mar 2003 21:30:44 -0000	1.89
> +++ GridLayout.cpp	30 Dec 2003 17:42:22 -0000
> @@ -366,7 +366,7 @@
>    // the upward copies first, then the downward copies.
> 
>    int numPatches = this->all_m.size();
> -  this->gcFillList_m.reserve(2*Dim*numPatches);
> +  this->gcFillList_m.reserve(2*Dim*this->local_m.size());
> 
>    // Make sure we have the same number of patches as blocks in the grid
>    // (this is just a sanity check).
> Index: UniformGridLayout.cpp
> ===================================================================
> RCS file: /home/pooma/Repository/r2/src/Layout/UniformGridLayout.cpp,v
> retrieving revision 1.40
> diff -u -u -r1.40 UniformGridLayout.cpp
> --- UniformGridLayout.cpp	11 Mar 2003 21:30:44 -0000	1.40
> +++ UniformGridLayout.cpp	30 Dec 2003 17:42:25 -0000
> @@ -299,7 +299,7 @@
> 
>      int numPatches = this->all_m.size();
> 
> -    this->gcFillList_m.reserve(2*Dim*numPatches); // a bit extra
> +    this->gcFillList_m.reserve(2*Dim*this->local_m.size());
> 
>      for (d = 0; d < Dim; ++d)
>        {


-- 
Jeffrey D. Oldham
oldham at codesourcery.com




More information about the pooma-dev mailing list