Skip to content
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

Spurious memory allocation reproduced with poisson_dev_fe.jl #82

Open
amartinhuertas opened this issue Apr 27, 2021 · 2 comments
Open

Comments

@amartinhuertas
Copy link
Member

amartinhuertas commented Apr 27, 2021

This issue is to document a strange behaviour which is reproduced in poisson_dev_fe.jl when the following code is executed:

@time begin
        for i in 1:100_000
          smart_sum(manual_uₕ_array_at_qₖ)
        end
      end

A comment was attached to this code, that I move from there and put here to not forget

WHY THE SECOND PIECE OF CODE REQUIRES A NUMBER OF ALLOCATIONS THAT GROWS
WITH THE NUMBER OF CELLS? I CAN UNDERSTAND THAT THE CACHE ARRAY of
`manual_uₕ_array_at_qₖ` REQUIRES MORE MEMORY IN ABSOLUTE TERMS, BUT I AM NOT
ABLE TO SEE WHY IT GROWS WITH THE NUMBER OF CELLS!!!! ANY HINT?
@amartinhuertas amartinhuertas changed the title purious memory allocation Spurious memory allocation reproduced with poisson_dev_fe.jl Apr 27, 2021
@fverdugo
Copy link
Member

I have reduced this problem to a MWE, see this post: https://discourse.julialang.org/t/performance-depends-dramatically-on-compilation-order/58425

I have fixed this here https://github.com/gridap/Gridap.jl/blob/dc2ae5ffbea2a36741796b81b409098c6c4b82c9/src/Arrays/LazyArrays.jl#L284

but this is not in Gridap#master yet since, after introducing these lines, the DG examples take forever to compile (specially the Stokes DG test).

The good news is that the refactoring in the block machinery I am working now cuts down these unbearable compilation times. So the fix of the memory allocations will me merged together with the work in branch https://github.com/gridap/Gridap.jl/tree/block_refactoring

@amartinhuertas
Copy link
Member Author

Ok, thanks for your extensive report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants