[pooma-dev] [PATCH] parallel particle bctest3 crash
Jeffrey D. Oldham
oldham at codesourcery.com
Mon Oct 11 16:34:54 UTC 2004
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 at codesourcery.com
More information about the pooma-dev
mailing list