[Carpet] nPoints assertion
Erik Schnetter
schnetter at cct.lsu.edu
Wed Mar 19 19:57:48 CET 2008
On Mar 19, 2008, at 13:05:16, Ian Hinder wrote:
> Erik Schnetter wrote:
>> On Mar 17, 2008, at 16:45:42, Ian Hinder wrote:
>>
>>> Hi,
>>>
>>> There is an assertion in Recompose.cc (line 1137)
>>>
>>> assert (mynpoints.at(n) > 0);
>>>
>>> which aborts my run when I run at low resolution on 16 processors.
>>> Erik, you suggested this check might not be necessary, and indeed
>>> things
>>> work fine with the assertion removed. OK to commit a patch or
>>> should I
>>> do more specific testing?
>>
>>
>> OK to commit. More specific testing would be difficult, since this
>> assertion failure will only catches illegal cases which are not
>> supposed
>> to reach this point in code anyway.
>
> Now I'm confused. If the cases are illegal how am I triggering the
> assertion?
I meant to say: I place assert statements into code to say "this is
what the algorithm should be doing at this point". If the assert is
triggered, then either some previous piece of code was wrong, or my
idea about the algorithm was wrong. If everything works as planned,
no assertion would be triggered.
In this case, my idea of the current state was wrong. I assumed that
each grid is so large that each processor can own at least one grid
point. This is clearly not always possible, therefore this assert
statement should be relaxed (>=) or removed, since mynpoints is
nonnegative anyway.
Testing it would require to find a case where this assert statement is
triggered. Since this should never be the case, it is very difficult
to come up with a test case -- it would require writing custom code
and calling this routine with known-to-be invalid arguments.
-erik
--
Erik Schnetter <schnetter at cct.lsu.edu> http://www.cct.lsu.edu/~eschnett/
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : /archives/developers/attachments/20080319/afb2f3d6/attachment.pgp
More information about the developers
mailing list