bugGNU Octave - Bugs: bug #55905, ode15{i,s} allocate enough memory...


bug #55905: ode15{i,s} allocate enough memory for a full jacobian when the provided jacobian is sparse

Submitter:  Carlo de Falco <cdf>
Submitted:  Wed 13 Mar 2019 08:32:38 AM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Performance
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Tue 15 Sep 2020 02:52:32 PM UTC, comment #4: 

Seems to work for me (on Windows) and the buildbots.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Mon 14 Sep 2020 04:33:19 PM UTC, comment #3: 

Response per mail by Bill Greene:

> Looks OK to me. You can associate my name with this change as appropriate.

Thanks for your quick response.

I pushed the patch here:

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Sun 13 Sep 2020 06:10:57 PM UTC, comment #2: 

Sorry it took so long before you got any feedback.

I added a commit message and a configure check for the function SUNSparseMatrix_Reallocate and made its usage conditional on the check result. Please, see the attached patch.

Would it be ok to check this in with your name and email address to make it easier to reach out in case some doubts arise in the future?

Would you like to be added to the list of contributors in the manual?

(file #49795)

Markus Mützel <mmuetzel>
Group administrator
Fri 20 Sep 2019 06:48:45 PM UTC, comment #1: 

I fixed this bug following the suggestion in the
"FIXME comment". An hg patch file is attached.
Note, one implication of this fix is that SUNDIALS 4 (or greater)
is now required because the function, SUNSparseMatrix_Reallocate,
used in the fix is not available in older versions of SUNDIALS.

(file #47555)

Bill Greene <billgreene>
Wed 13 Mar 2019 08:32:38 AM UTC, original submission:  

The memory allocation for the sparse jacobian
is done in an overly safe way here

The memory is allocated as if the jacobian was full.

It would be more memory efficient to check the actual size of the needed memory before doing the allocation.

I have already added a FIXME comment in the code, I am posting this here as well in order not to forget.

Carlo de Falco <cdf>
Group Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #49795:  bug55905_ode15_v2.patch added by mmuetzel (3KiB - application/octet-stream)
file #47555:  ode15.diff added by billgreene (2KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by billgreene (Updated the item)
  • -email is unavailable- added by cdf (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.


    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-15 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2020-09-14 mmuetzel StatusPatch Reviewed Ready For Test
    2020-09-13 mmuetzel Attached File- Added bug55905_ode15_v2.patch, #49795
        StatusIn Progress Patch Reviewed
    2019-09-20 billgreene Attached File- Added ode15.diff, #47555

    Back to the top

    Powered by Savane 3.12