AMReX-Astro / Nyx

An adaptive mesh, N-body hydro cosmological simulation code
https://amrex-astro.github.io/Nyx/
Other
90 stars 36 forks source link

Segmentation fault when trying to run with gravity only #39

Closed franlane94 closed 5 years ago

franlane94 commented 5 years ago

Hi,

I'm trying to run a gravity only simulation with no hydro using the input file shown below and every time I try to run it I get a segmentation fault.

I've messed around with the parameters I thought could be causing it but the simulation only works if I switch hydro on.

Is there anything I'm doing wrong in the input file or is it a different problem?

Thanks.

------------------ INPUTS TO MAIN PROGRAM -------------------

max_step = 1000000

max_step = 1

nyx.ppm_type = 0 nyx.use_colglaz = 1 nyx.add_ext_src = 0 nyx.show_timings = 1 gravity.show_timings = 1

This is 1e-8 times the lowest density in plt00000

nyx.small_dens = 50.0

This is 1e-5 times the constant temparature in plt00000

nyx.small_temp = 1.e-2

This is 1e-8 times the lowest pressure in plt00000

nyx.small_pres = 400.0

gravity.sl_tol = 1.e-12

nyx.initial_z = 63.0 nyx.final_a = 1.0

nyx.final_a = 0.05

File written during the run: nstep | time | dt | redshift | a

amr.data_log = runlog amr.grid_log = grdlog

This is how we restart from a checkpoint and write an ascii particle file

Leave this commented out in cvs version

amr.restart = chk02396

max_step = 4

particles.particle_output_file = particle_output

gravity.gravity_type = PoissonGrav gravity.no_sync = 1 gravity.no_composite = 1 gravity.solve_with_hpgmg = 0

mg.bottom_solver = 4

PROBLEM SIZE & GEOMETRY

geometry.is_periodic = 1 1 1 geometry.coord_sys = 0

geometry.prob_lo = 0 0 0

Domain size in Mpc

geometry.prob_hi = 128.0 128.0 128.0

amr.n_cell = 128 128 128 amr.max_grid_size = 128

>>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<

0 = Interior 3 = Symmetry

1 = Inflow 4 = SlipWall

2 = Outflow

>>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<

nyx.lo_bc = 0 0 0 nyx.hi_bc = 0 0 0

WHICH PHYSICS

nyx.do_hydro = 1 nyx.do_grav = 1

PARTICLES

nyx.do_dm_particles = 1

>>>>>>>>>>>>> PARTICLE INIT OPTIONS <<<<<<<<<<<<<<<<

"AsciiFile" "Random" "Cosmological"

>>>>>>>>>>>>> PARTICLE INIT OPTIONS <<<<<<<<<<<<<<<<

nyx.particle_init_type = BinaryFile nyx.binary_particle_file = InitialParticles.bin

>>>>>>>>>>>>> PARTICLE MOVE OPTIONS <<<<<<<<<<<<<<<<

"Gravitational" "Random"

>>>>>>>>>>>>> PARTICLE MOVE OPTIONS <<<<<<<<<<<<<<<<

nyx.particle_move_type = Gravitational

Gas grid ICs

nyx.do_readin_ics = 1 nyx.readin_ics_fname = InitialGasGrid

TIME STEP CONTROL

particles.cfl = 0.5 # 'cfl' for particles nyx.cfl = 0.7 # cfl number for hyperbolic system

particles.cfl = 0.00005 # 'cfl' for particles

nyx.cfl = 0.00007 # cfl number for hyperbolic system

nyx.init_shrink = 1.0 # scale back initial timestep nyx.change_max = 1.1 # factor by which timestep can change nyx.dt_cutoff = 5.e-20 # level 0 timestep below which we halt

DIAGNOSTICS & VERBOSITY

nyx.sum_interval = -1 # timesteps between computing mass nyx.v = 1 # verbosity in Castro.cpp gravity.v = 1 # verbosity in Gravity.cpp amr.v = 1 # verbosity in Amr.cpp mg.v = 1 # verbosity in Amr.cpp particles.v = 2 # verbosity in Particle class

amr.grid_log = grdlog # name of grid logging file

REFINEMENT / REGRIDDING

amr.max_level = 0 # maximum level number allowed amr.n_error_buf = 0 0 0 8 amr.refine_grid_layout = 1 amr.regrid_on_restart = 1 amr.blocking_factor = 128

amr.subcycling_mode = None

CHECKPOINT FILES (check_int==0 disables)

amr.check_file = chk amr.check_int = 0

PLOTFILES

amr.plot_file = plt

amr.plot_int = 100

amr.plot_per = 0.001

amr.plot_per = 0.00001

nyx.plot_z_values = 60 58 56 54 52 50 0

amr.plot_vars = ALL amr.derive_plot_vars = particle_count particle_mass_density pressure magvel

PROBIN FILENAME

amr.probin_file = Cosmology.in

Surpress Fortran warnings.

nyx.print_fortran_warnings = 0

asalmgren commented 5 years ago

Fran,

Did you build with USE_GRAV = TRUE or FALSE in the GNUmakefile?

Ann

On Thu, Dec 6, 2018 at 9:36 AM Fran Lane notifications@github.com wrote:

Hi,

I'm trying to run a gravity only simulation with no hydro using the input file shown below and every time I try to run it I get a segmentation fault.

I've messed around with the parameters I thought could be causing it but the simulation only works if I switch hydro on.

Is there anything I'm doing wrong in the input file or is it a different problem?

Thanks. ------------------ INPUTS TO MAIN PROGRAM -------------------

max_step = 1000000

max_step = 1

nyx.ppm_type = 0 nyx.use_colglaz = 1 nyx.add_ext_src = 0 nyx.show_timings = 1 gravity.show_timings = 1

This is 1e-8 times the lowest density in plt00000

nyx.small_dens = 50.0

This is 1e-5 times the constant temparature in plt00000

nyx.small_temp = 1.e-2

This is 1e-8 times the lowest pressure in plt00000

nyx.small_pres = 400.0

gravity.sl_tol = 1.e-12

nyx.initial_z = 63.0 nyx.final_a = 1.0

nyx.final_a = 0.05

File written during the run: nstep | time | dt | redshift | a

amr.data_log = runlog amr.grid_log = grdlog

This is how we restart from a checkpoint and write an ascii particle file

Leave this commented out in cvs version

amr.restart = chk02396

max_step = 4

particles.particle_output_file = particle_output

gravity.gravity_type = PoissonGrav gravity.no_sync = 1 gravity.no_composite = 1 gravity.solve_with_hpgmg = 0

mg.bottom_solver = 4 PROBLEM SIZE & GEOMETRY

geometry.is_periodic = 1 1 1 geometry.coord_sys = 0

geometry.prob_lo = 0 0 0

Domain size in Mpc

geometry.prob_hi = 128.0 128.0 128.0

amr.n_cell = 128 128 128 amr.max_grid_size = 128

BC FLAGS <<<<<<<<<<<<<<<< 0 = Interior 3 = Symmetry 1 = Inflow 4 = SlipWall 2 = Outflow >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<

nyx.lo_bc = 0 0 0 nyx.hi_bc = 0 0 0 WHICH PHYSICS

nyx.do_hydro = 1 nyx.do_grav = 1 PARTICLES

nyx.do_dm_particles = 1

PARTICLE INIT OPTIONS <<<<<<<<<<<<<<<< "AsciiFile" "Random" "Cosmological" >>>>>>>>>>>>> PARTICLE INIT OPTIONS <<<<<<<<<<<<<<<<

nyx.particle_init_type = BinaryFile nyx.binary_particle_file = InitialParticles.bin

PARTICLE MOVE OPTIONS <<<<<<<<<<<<<<<< "Gravitational" "Random" >>>>>>>>>>>>> PARTICLE MOVE OPTIONS <<<<<<<<<<<<<<<<

nyx.particle_move_type = Gravitational Gas grid ICs

nyx.do_readin_ics = 1 nyx.readin_ics_fname = InitialGasGrid TIME STEP CONTROL

particles.cfl = 0.5 # 'cfl' for particles nyx.cfl = 0.7 # cfl number for hyperbolic system

particles.cfl = 0.00005 # 'cfl' for particles

nyx.cfl = 0.00007 # cfl number for hyperbolic system

nyx.init_shrink = 1.0 # scale back initial timestep nyx.change_max = 1.1 # factor by which timestep can change nyx.dt_cutoff = 5.e-20 # level 0 timestep below which we halt DIAGNOSTICS & VERBOSITY

nyx.sum_interval = -1 # timesteps between computing mass nyx.v = 1 # verbosity in Castro.cpp gravity.v = 1 # verbosity in Gravity.cpp amr.v = 1 # verbosity in Amr.cpp mg.v = 1 # verbosity in Amr.cpp particles.v = 2 # verbosity in Particle class

amr.grid_log = grdlog # name of grid logging file

REFINEMENT / REGRIDDING

amr.max_level = 0 # maximum level number allowed amr.n_error_buf = 0 0 0 8 amr.refine_grid_layout = 1 amr.regrid_on_restart = 1 amr.blocking_factor = 128

amr.subcycling_mode = None

CHECKPOINT FILES (check_int==0 disables)

amr.check_file = chk amr.check_int = 0 PLOTFILES

amr.plot_file = plt

amr.plot_int = 100

amr.plot_per = 0.001

amr.plot_per = 0.00001

nyx.plot_z_values = 60 58 56 54 52 50 0

amr.plot_vars = ALL amr.derive_plot_vars = particle_count particle_mass_density pressure magvel

PROBIN FILENAME

amr.probin_file = Cosmology.in Surpress Fortran warnings.

nyx.print_fortran_warnings = 0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AMReX-Astro/Nyx/issues/39, or mute the thread https://github.com/notifications/unsubscribe-auth/AKJPYtFxNCnz6i3X9jgsPSTy7VhA-kXlks5u2VWCgaJpZM4ZG-vJ .

asalmgren commented 5 years ago

Oops -- meant to ask about the NO_HYDRO flag, not the USE_GRAV flag, but realized that that doesn't show up in any of the GNUmakefiles.

Ignore that question.

It does look like you're trying to read in gas initial conditions -- can you try commenting those lines out, ie comment out these two:

nyx.do_readin_ics = 1 nyx.readin_ics_fname = InitialGasGrid

On Thu, Dec 6, 2018 at 10:13 AM asalmgren notifications@github.com wrote:

Fran,

Did you build with USE_GRAV = TRUE or FALSE in the GNUmakefile?

Ann

On Thu, Dec 6, 2018 at 9:36 AM Fran Lane notifications@github.com wrote:

Hi,

I'm trying to run a gravity only simulation with no hydro using the input file shown below and every time I try to run it I get a segmentation fault.

I've messed around with the parameters I thought could be causing it but the simulation only works if I switch hydro on.

Is there anything I'm doing wrong in the input file or is it a different problem?

Thanks. ------------------ INPUTS TO MAIN PROGRAM -------------------

max_step = 1000000

max_step = 1

nyx.ppm_type = 0 nyx.use_colglaz = 1 nyx.add_ext_src = 0 nyx.show_timings = 1 gravity.show_timings = 1

This is 1e-8 times the lowest density in plt00000

nyx.small_dens = 50.0

This is 1e-5 times the constant temparature in plt00000

nyx.small_temp = 1.e-2

This is 1e-8 times the lowest pressure in plt00000

nyx.small_pres = 400.0

gravity.sl_tol = 1.e-12

nyx.initial_z = 63.0 nyx.final_a = 1.0

nyx.final_a = 0.05

File written during the run: nstep | time | dt | redshift | a

amr.data_log = runlog amr.grid_log = grdlog

This is how we restart from a checkpoint and write an ascii particle

file

Leave this commented out in cvs version

amr.restart = chk02396

max_step = 4

particles.particle_output_file = particle_output

gravity.gravity_type = PoissonGrav gravity.no_sync = 1 gravity.no_composite = 1 gravity.solve_with_hpgmg = 0

mg.bottom_solver = 4 PROBLEM SIZE & GEOMETRY

geometry.is_periodic = 1 1 1 geometry.coord_sys = 0

geometry.prob_lo = 0 0 0

Domain size in Mpc

geometry.prob_hi = 128.0 128.0 128.0

amr.n_cell = 128 128 128 amr.max_grid_size = 128

BC FLAGS <<<<<<<<<<<<<<<< 0 = Interior 3 = Symmetry 1 = Inflow 4 = SlipWall 2 = Outflow >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<

nyx.lo_bc = 0 0 0 nyx.hi_bc = 0 0 0 WHICH PHYSICS

nyx.do_hydro = 1 nyx.do_grav = 1 PARTICLES

nyx.do_dm_particles = 1

PARTICLE INIT OPTIONS <<<<<<<<<<<<<<<< "AsciiFile" "Random" "Cosmological" >>>>>>>>>>>>> PARTICLE INIT OPTIONS <<<<<<<<<<<<<<<<

nyx.particle_init_type = BinaryFile nyx.binary_particle_file = InitialParticles.bin

PARTICLE MOVE OPTIONS <<<<<<<<<<<<<<<< "Gravitational" "Random" >>>>>>>>>>>>> PARTICLE MOVE OPTIONS <<<<<<<<<<<<<<<<

nyx.particle_move_type = Gravitational Gas grid ICs

nyx.do_readin_ics = 1 nyx.readin_ics_fname = InitialGasGrid TIME STEP CONTROL

particles.cfl = 0.5 # 'cfl' for particles nyx.cfl = 0.7 # cfl number for hyperbolic system

particles.cfl = 0.00005 # 'cfl' for particles

nyx.cfl = 0.00007 # cfl number for hyperbolic system

nyx.init_shrink = 1.0 # scale back initial timestep nyx.change_max = 1.1 # factor by which timestep can change nyx.dt_cutoff = 5.e-20 # level 0 timestep below which we halt DIAGNOSTICS & VERBOSITY

nyx.sum_interval = -1 # timesteps between computing mass nyx.v = 1 # verbosity in Castro.cpp gravity.v = 1 # verbosity in Gravity.cpp amr.v = 1 # verbosity in Amr.cpp mg.v = 1 # verbosity in Amr.cpp particles.v = 2 # verbosity in Particle class

amr.grid_log = grdlog # name of grid logging file

REFINEMENT / REGRIDDING

amr.max_level = 0 # maximum level number allowed amr.n_error_buf = 0 0 0 8 amr.refine_grid_layout = 1 amr.regrid_on_restart = 1 amr.blocking_factor = 128

amr.subcycling_mode = None

CHECKPOINT FILES (check_int==0 disables)

amr.check_file = chk amr.check_int = 0 PLOTFILES

amr.plot_file = plt

amr.plot_int = 100

amr.plot_per = 0.001

amr.plot_per = 0.00001

nyx.plot_z_values = 60 58 56 54 52 50 0

amr.plot_vars = ALL amr.derive_plot_vars = particle_count particle_mass_density pressure magvel

PROBIN FILENAME

amr.probin_file = Cosmology.in Surpress Fortran warnings.

nyx.print_fortran_warnings = 0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AMReX-Astro/Nyx/issues/39, or mute the thread < https://github.com/notifications/unsubscribe-auth/AKJPYtFxNCnz6i3X9jgsPSTy7VhA-kXlks5u2VWCgaJpZM4ZG-vJ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AMReX-Astro/Nyx/issues/39#issuecomment-444973249, or mute the thread https://github.com/notifications/unsubscribe-auth/AKJPYscGYBKRXQ2nWKbs-uG9uT0Jwld-ks5u2V5LgaJpZM4ZG-vJ .

franlane94 commented 5 years ago

Hi,

with nyx.do_hydro =0 and the two gas initial condition lines commented out it still results in a segmentation fault

Thanks

asalmgren commented 5 years ago

which directory are you running in?

On Thu, Dec 6, 2018 at 11:09 AM Fran Lane notifications@github.com wrote:

Hi,

with nyx.do_hydro =0 and the two gas initial condition lines commented out it still results in a segmentation fault

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AMReX-Astro/Nyx/issues/39#issuecomment-444991997, or mute the thread https://github.com/notifications/unsubscribe-auth/AKJPYpYaRwlWu3N-a9pILwPiNrMZ2Gfrks5u2Wt2gaJpZM4ZG-vJ .

franlane94 commented 5 years ago

I'm running in the Nyx/Exec/Cosmological directory

asalmgren commented 5 years ago

That's not one of the directories in our current development release.

On Thu, Dec 6, 2018 at 11:54 AM Fran Lane notifications@github.com wrote:

I'm running in the Nyx/Exec/Cosmological directory

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AMReX-Astro/Nyx/issues/39#issuecomment-445007848, or mute the thread https://github.com/notifications/unsubscribe-auth/AKJPYsiCUMN_7hcQoluis5rmN9YVHhkiks5u2XYCgaJpZM4ZG-vJ .

franlane94 commented 5 years ago

I'm using a modified version from the summer of 2017. Is it possible to know why the Cosmological directory was removed? I have had other issues with this version and it would be interesting to know the cause.

Thanks

asalmgren commented 5 years ago

Fran -- that wasn't a directory that we actively maintained. Obviously you're welcome to use it but it probably got out of date which is why we would have removed it.

On Fri, Dec 7, 2018 at 1:20 AM Fran Lane notifications@github.com wrote:

I'm using a modified version from the summer of 2017. Is it possible to know why the Cosmological directory was removed? I have had other issues with this version and it would be interesting to know the cause.

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AMReX-Astro/Nyx/issues/39#issuecomment-445171533, or mute the thread https://github.com/notifications/unsubscribe-auth/AKJPYkJakXQFwcxI-18bk0NdxBw8bX8sks5u2jLNgaJpZM4ZG-vJ .

zarija commented 5 years ago

Fran, I don't think we ever had Exec/Cosmological/ in our repo... Perhaps it's a local code modification?

zarija commented 5 years ago

In any case, to also provide something hopefully constructive... If you want to run gravity-only Nyx:

  1. (Optional, but probably helpful) Go to the latest version in this repo
  2. Make an executable in Exec/LyA which is for all practical purposes a generic cosmological problem
  3. Set in the inputs to turn off hydro: nyx.do_hydro = 0 Perhaps these too, to be on the safe side, these are relevant for hydro runs only: nyx.do_santa_barbara = 0 nyx.init_sb_vels = 0