[pooma-dev] [PATCH] parallel particle bctest3 crash

Richard Guenther rguenth at tat.physik.uni-tuebingen.de
Sun Oct 10 14:18:59 UTC 2004


Arno Candel wrote:
> okay, this patch fixes the UniformLayout particle swapping, and 
> particularly the bctest3 particle test.
> 
> There was a floating point exception triggered as soon as less particles 
> were created than patches existed -> sizePerPatch=0.
> A there was an assertion error when the particle was being sent to a 
> patch that didn't even exist (npid >= patchesGlobal()).

Yes, that looks ok.  SpatialLayout doesn't seem to need a similar fix. 
Jeffrey, may I approve (and apply) such patches from Arno?

Thanks for tracking this down and fixing it,
Richard.

> 
> Arno.
> 
> 
> 
> Index: UniformLayout.h
> ===================================================================
> RCS file: /home/pooma/Repository/r2/src/Particles/UniformLayout.h,v
> retrieving revision 1.23
> diff -u -r1.23 UniformLayout.h
> --- UniformLayout.h     14 Jul 2004 15:44:59 -0000      1.23
> +++ UniformLayout.h     10 Oct 2004 13:51:36 -0000
> @@ -311,11 +311,11 @@
> 
>     for (int i = 0; i < size; ++i)
>     {
> -      int npid = (i+offset) / sizePerPatch;
> +      int npid = (i+offset) / (sizePerPatch>0?sizePerPatch:1);
> 
>       // check for a leftover particle
> 
> -      if (npid == patchesGlobal())
> +      if (npid >= patchesGlobal())
>        npid = (i+offset) - (sizePerPatch*patchesGlobal());
> 
>       // Make sure this is kosher




More information about the pooma-dev mailing list