ODINN-SciML / ODINN.jl

Global glacier model using Universal Differential Equations for climate-glacier interactions
MIT License
71 stars 11 forks source link

Properly optimize Julia code #68

Open JordiBolibar opened 1 year ago

JordiBolibar commented 1 year ago

After some discussions in the Julia Discourse regarding Float64 vs Float32, some adjustments should be made to the code in order to avoid some performance pitfalls. Those are:

JordiBolibar commented 1 year ago

Partially implemented in SIA!. There are still some operations remaining for which the pre-initialized size of the matrices needs to be adjusted. This is not urgent for the scientific applications, so to be updated later on.

This could be a good task for Lucille in her internship to optimize the SIA in a forward model.

JordiBolibar commented 1 year ago

More optimizations have been implemented. There are still quite a lot of memory allocations, though. Removing almost all of them would results in a relatively unreadable code, and it would imply passing even more initialized context matrices to SIA!().

To be discussed if it's worth it.

JordiBolibar commented 1 year ago

This still requires a bit more work. Once we have some time, we should perform a proper code optimization following this: https://viralinstruction.com/posts/optimise/.

Another really important optimization will come from making all parameters local, following #36