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

Restart does not work with p4est + AMR #1914

Open
benegee opened this issue Apr 23, 2024 · 1 comment · May be fixed by #1915
Open

Restart does not work with p4est + AMR #1914

benegee opened this issue Apr 23, 2024 · 1 comment · May be fixed by #1915
Labels
bug Something isn't working

Comments

@benegee
Copy link
Contributor

benegee commented Apr 23, 2024

Extend examples/p4est_2d_dgsem/elixir_advection_extended.jl by an AMR callback like

amr_controller = ControllerThreeLevel(semi, IndicatorMax(semi, variable = first),
                                      base_level = 0,
                                      med_level = 1, med_threshold = 0.8,
                                      max_level = 2, max_threshold = 1.2)
amr_callback = AMRCallback(semi, amr_controller,
                           interval = 5,
                           adapt_initial_condition = false,
                           adapt_initial_condition_only_refine = true)

(possibly also tspan and intervals have to be changed to make sure the expected restart file is indeed written)

Then execute examples/p4est_2d_dgsem/elixir_advection_restart.jl, e.g. via

julia --project=. -e 'using Trixi;  trixi_include("../examples/p4est_2d_dgsem/elixir_advection_restart.jl")'

The following error occurs:

[23540] signal (11.1): Segmentation fault
in expression starting at /home/bene/trixi/Trixi.jl/examples/p4est_2d_dgsem/elixir_advection_restart.jl:42
unsafe_store! at ./pointer.jl:146 [inlined]
unsafe_store! at /home/bene/trixi/Trixi.jl/run/dev/P4est/src/pointerwrappers.jl:108 [inlined]
setindex! at /home/bene/trixi/Trixi.jl/run/dev/P4est/src/pointerwrappers.jl:88 [inlined]
copy_to_quad_iter_volume at /home/bene/trixi/Trixi.jl/src/callbacks_step/amr.jl:533

At this point p4est's user_data array is accessed:

quad_data_pw = PointerWrapper(Int, info_pw.quad.p.user_data[])
quad_data_pw[2] = controller_value

But it is not created when calling load_p4est, in contrast to new_p4est which is used in initial constructors.

@benegee benegee linked a pull request Apr 23, 2024 that will close this issue
@sloede
Copy link
Member

sloede commented Apr 24, 2024

Can you reproduce this error with C code? If yes, maybe it's a bug, not a feature?

@DanielDoehring DanielDoehring added the bug Something isn't working label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants