Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: Richard Guenther <rguenth@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
  • Subject: Re: [pooma-dev] [PATCH] parallel particle bctest3 crash
  • From: "Jeffrey D. Oldham" <oldham@xxxxxxxxxxxxxxxx>
  • Date: Mon, 11 Oct 2004 09:34:54 -0700

Richard Guenther wrote:

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?

Yes, please do so.

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




--
Jeffrey D. Oldham
oldham@xxxxxxxxxxxxxxxx