You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Pascal Parraud (Created) (JIRA)" <ji...@apache.org> on 2011/10/25 18:52:32 UTC

[jira] [Created] (MATH-695) Incomplete reinitialization with some events handling

Incomplete reinitialization with some events handling
-----------------------------------------------------

                 Key: MATH-695
                 URL: https://issues.apache.org/jira/browse/MATH-695
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.0
            Reporter: Pascal Parraud


I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MATH-695) Incomplete reinitialization with some events handling

Posted by "Luc Maisonobe (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe resolved MATH-695.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0

Fixed in subversion repository as of r1189086.

The fix is different from the proposed patch, it directly updates the events when the step truncation occurs, thus preventing even transient inconsistency.

Thanks for the report and for the patch.
                
> Incomplete reinitialization with some events handling
> -----------------------------------------------------
>
>                 Key: MATH-695
>                 URL: https://issues.apache.org/jira/browse/MATH-695
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Pascal Parraud
>            Assignee: Luc Maisonobe
>             Fix For: 3.0
>
>         Attachments: events.patch, test-case-MATH-695.patch
>
>
> I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
> I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-695) Incomplete reinitialization with some events handling

Posted by "Sébastien Brisard (Updated JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sébastien Brisard updated MATH-695:
-----------------------------------

    Comment: was deleted

(was: Hi Pascal,
thanks for reporting this bug. In order to be able to help you, we need you to be a little bit more specific as to what algos/packages you're using. I guess you're talking about o.a.c.m.ode, is that correct? If yes, which solver is causing you troubles? In what circumstances? The best would be for you to provide us with a simplified application (since your real use-case is too complicated) reproducing the bug. Otherwise could you send along your patch (even if it breaks the Unit tests), since it would give us some indication on the location of the bug).
Best regards,
Sébastien)
    
> Incomplete reinitialization with some events handling
> -----------------------------------------------------
>
>                 Key: MATH-695
>                 URL: https://issues.apache.org/jira/browse/MATH-695
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Pascal Parraud
>         Attachments: events.patch
>
>
> I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
> I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (MATH-695) Incomplete reinitialization with some events handling

Posted by "Luc Maisonobe (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135351#comment-13135351 ] 

Luc Maisonobe commented on MATH-695:
------------------------------------

As I work with Pascal (we share the same office at work), I have seen how the bug occur and am trying to set up a simplified test case that reproduces it. It seems that there is a combination of conditions that is not handled properly. We have seen the bu occurring when both following conditions are true:

* there are several events occurring in the same integration step
* when one of the earliest events occurrence is triggered, it returns RESET_DERIVATIVES

In this case, the acceptStep method in AbstractIntegrator returns early from inside the while loop and the remaining events that where expected to occur later on are left in an inconsistent state with respect to the integrator. The t0 and g0 fields in the corresponding EventState still contains values from the beginning of the step, they do not reflect the fact the event has been triggered. This implies that when next step is started with the updated derivatives, since the t0 for the second event is still lagging behind current time, evaluateStep tries to catch up from t0 to current t and calls the g function at times that do not belong to the current step.

Up to now, I have not been able to set up a simplified test case that exhibits this, but I'm working on it.
                
> Incomplete reinitialization with some events handling
> -----------------------------------------------------
>
>                 Key: MATH-695
>                 URL: https://issues.apache.org/jira/browse/MATH-695
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Pascal Parraud
>         Attachments: events.patch
>
>
> I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
> I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-695) Incomplete reinitialization with some events handling

Posted by "Luc Maisonobe (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe updated MATH-695:
-------------------------------

    Attachment: test-case-MATH-695.patch

The attached test case reproduces the error.
                
> Incomplete reinitialization with some events handling
> -----------------------------------------------------
>
>                 Key: MATH-695
>                 URL: https://issues.apache.org/jira/browse/MATH-695
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Pascal Parraud
>         Attachments: events.patch, test-case-MATH-695.patch
>
>
> I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
> I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (MATH-695) Incomplete reinitialization with some events handling

Posted by "Pascal Parraud (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pascal Parraud updated MATH-695:
--------------------------------

    Attachment: events.patch

this patch resolves my problem but breaks some unit tests.
                
> Incomplete reinitialization with some events handling
> -----------------------------------------------------
>
>                 Key: MATH-695
>                 URL: https://issues.apache.org/jira/browse/MATH-695
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Pascal Parraud
>         Attachments: events.patch
>
>
> I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
> I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-695) Incomplete reinitialization with some events handling

Posted by "Sébastien Brisard (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135234#comment-13135234 ] 

Sébastien Brisard commented on MATH-695:
----------------------------------------

Hi Pascal,
thanks for reporting this bug. In order to be able to help you, we need you to be a little bit more specific as to what algos/packages you're using. I guess you're talking about o.a.c.m.ode, is that correct? If yes, which solver is causing you troubles? In what circumstances? The best would be for you to provide us with a simplified application (since your real use-case is too complicated) reproducing the bug. Otherwise could you send along your patch (even if it breaks the Unit tests), since it would give us some indication on the location of the bug).
Best regards,
Sébastien
                
> Incomplete reinitialization with some events handling
> -----------------------------------------------------
>
>                 Key: MATH-695
>                 URL: https://issues.apache.org/jira/browse/MATH-695
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Pascal Parraud
>         Attachments: events.patch
>
>
> I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
> I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Issue Comment Edited] (MATH-695) Incomplete reinitialization with some events handling

Posted by "Luc Maisonobe (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13135351#comment-13135351 ] 

Luc Maisonobe edited comment on MATH-695 at 10/25/11 7:28 PM:
--------------------------------------------------------------

As I work with Pascal (we share the same office at work), I have seen how the bug occurs and am trying to set up a simplified test case that reproduces it. It seems that there is a combination of conditions that is not handled properly. We have seen the bug occurring when both following conditions are true:

* there are several events occurring in the same integration step
* when one of the earliest events occurrence is triggered, it returns RESET_DERIVATIVES

In this case, the acceptStep method in AbstractIntegrator returns early from inside the while loop and the remaining events that where expected to occur later on are left in an inconsistent state with respect to the integrator. The t0 and g0 fields in the corresponding EventState instance still contain values from the beginning of the step, they do not reflect the fact the event has been triggered. This implies that when next step is started with the updated derivatives, evaluateStep tries to catch up from t0 to current t and calls the g function at times that do not belong to the current step.

Up to now, I have not been able to set up a simplified test case that exhibits this, but I'm working on it.
                
      was (Author: luc):
    As I work with Pascal (we share the same office at work), I have seen how the bug occur and am trying to set up a simplified test case that reproduces it. It seems that there is a combination of conditions that is not handled properly. We have seen the bu occurring when both following conditions are true:

* there are several events occurring in the same integration step
* when one of the earliest events occurrence is triggered, it returns RESET_DERIVATIVES

In this case, the acceptStep method in AbstractIntegrator returns early from inside the while loop and the remaining events that where expected to occur later on are left in an inconsistent state with respect to the integrator. The t0 and g0 fields in the corresponding EventState still contains values from the beginning of the step, they do not reflect the fact the event has been triggered. This implies that when next step is started with the updated derivatives, since the t0 for the second event is still lagging behind current time, evaluateStep tries to catch up from t0 to current t and calls the g function at times that do not belong to the current step.

Up to now, I have not been able to set up a simplified test case that exhibits this, but I'm working on it.
                  
> Incomplete reinitialization with some events handling
> -----------------------------------------------------
>
>                 Key: MATH-695
>                 URL: https://issues.apache.org/jira/browse/MATH-695
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Pascal Parraud
>         Attachments: events.patch
>
>
> I get a bug with event handling: I track 2 events that occur in the same step, when the first one is accepted, it resets the state but the reinitialization is not complete and the second one becomes unable to find its way.
> I can't give my context, which is rather large, but I tried a patch that works for me, unfortunately it breaks the unit tests.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira