-
Notifications
You must be signed in to change notification settings - Fork 149
Why jacobian! allocates despite using pre-allocated memory ? #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Haven't looked into the allocations yet but if you have small data, wouldn't just calling |
Essentially, because their size is not known a priori. I have a multiphysics system "class" with various callbacks for fluxes, reactions etc, and they can have different numbers of arguments depending on the physical location in the PDE domain.
|
It could be something similar to what was fixed in #315. |
No, it isn't ... When inspecting the source in jacobian.jl I figured out that by default a JacobianConfig is created. This was the problem. Providing my own solved it.
Problem solved (modulo documentation...) Jürgen |
PS: The issue you mentioned however occurs in my code when I call callback functions directly, Jürgen |
Hi,
I am greatly enjoying the functionality of ForwardDiff. I use the module in a finite volume
solver VoronoiFVM.jl for user callback functions describing fluxes between control volumes etc. This means that I have lots of calls on small amounts of data.
However, each call to jacobian! has 4 allocations.
Here is a test example:
The output is:
Is this unavoidable ?
Jürgen
The text was updated successfully, but these errors were encountered: