Comments (2)
For the Svärd-Kalisch equations, it's a bit more delicate because the elliptic operators changes over time, which currently leads to massive allocations:
DispersiveShallowWater.jl/src/equations/svaerd_kalisch_1d.jl
Lines 259 to 262 in 3adee66
The SummaryCallback
for examples/svaerd_kalisch_1d/svaerd_kalisch_1d_dingemans.jl
currently gives
──────────────────────────────────────────────────────────────────────────────
DispersiveSWE Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 1.91s / 99.3% 3.61GiB / 99.7%
Section ncalls time %tot avg alloc %tot avg
──────────────────────────────────────────────────────────────────────────────
rhs! 5.16k 1.88s 99.2% 364μs 3.59GiB 99.7% 730KiB
dv elliptic 5.16k 1.10s 58.2% 213μs 2.77GiB 76.9% 563KiB
dv hyperbolic 5.16k 719ms 38.0% 139μs 590MiB 16.0% 117KiB
deta hyperbolic 5.16k 53.3ms 2.8% 10.3μs 250MiB 6.8% 49.5KiB
~rhs!~ 5.16k 4.87ms 0.3% 944ns 810KiB 0.0% 161B
source terms 5.16k 265μs 0.0% 51.3ns 0.00B 0.0% 0.00B
analyze solution 86 14.3ms 0.8% 167μs 10.0MiB 0.3% 119KiB
──────────────────────────────────────────────────────────────────────────────
Do you see a possibility to reduce the allocations @ranocha?
from dispersiveshallowwater.jl.
I'm using the following approach in another project:
system_matrix = Symmetric(...)
if issparse(system_matrix)
(; factorization) = parameters
cholesky!(factorization, system_matrix)
dv .= factorization \ tmp
else
factorization = cholesky!(system_matrix)
ldiv!(dv, factorization, tmp)
end
You could do something similar here:
- use in-place factorizations like
lu!
for dense matrices - pre-allocate the factorization for sparse matrices and re-use it (assuming that the sparsity pattern does not change over time)
from dispersiveshallowwater.jl.
Related Issues (14)
- Do not set tolerances when `adaptive = false` HOT 1
- Why `RK4()` HOT 2
- `show`ing an `AnalysisCallback` does not work HOT 1
- Minor bikeshedding HOT 1
- Allocations in `RelaxationCallback` HOT 1
- Comment removes docstring from method HOT 1
- Increase coverage
- Add `SummaryCallback`
- Relaxation for dissipative semidiscretizations HOT 1
- Semidiscretization for BBM-BBM equations with SBP variable coefficient operator
- TagBot trigger issue HOT 11
- Support other models
- Use `ArrayPartition` from RecursiveArrayTools.jl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dispersiveshallowwater.jl.