Skip to content

Commit

Permalink
update restart reproducer
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWibking committed Oct 29, 2024
1 parent 6790d00 commit 2aadeac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
12 changes: 1 addition & 11 deletions inputs/precipitator_restart_reproducer.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,10 @@ problem = Precipitator box
problem_id = precipitator # problem ID: basename of output filenames

<parthenon/output1>
file_type = hst # History data dump
dt = 1.0 # time increment between outputs

<parthenon/output2>
file_type = hdf5 # HDF5 data dump
variables = prim, drho_over_rho, dP_over_P, dK_over_K, dT_over_T, entropy, temperature, tcool_over_tff, plasma_beta, dv_x, dv_y, dv_z
dt = 1.0 # Time increment between outputs
id = prim # Name to append to output

<parthenon/output3>
file_type = rst # Binary data dump
dt = 1.0 # time increment between outputs
id = restart
ghost_zones = true

<parthenon/time>
cfl = 0.2 # The Courant, Friedrichs, & Lewy (CFL) Number
Expand All @@ -26,7 +17,6 @@ tlim = 3.0 # time limit
integrator = rk2 # time integration algorithm
perf_cycle_offset = 10 # interval for stdout summary info


<parthenon/mesh>
refinement = static
nghost = 4
Expand Down
10 changes: 5 additions & 5 deletions reproducer0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ mkdir first_run
mv parthenon.* first_run
rm *.csv

# restart run from time zero
mpirun -np 8 ./build/bin/athenaPK -r first_run/parthenon.restart.00000.rhdf
# restart run
mpirun -np 8 ./build/bin/athenaPK -r first_run/parthenon.restart.00002.rhdf

# clean up
rm *.csv

# compare SECOND restart outputs
h5diff first_run/parthenon.restart.00002.rhdf parthenon.restart.00002.rhdf
# compare t=0 restart outputs
h5diff first_run/parthenon.restart.00002.rhdf parthenon.restart.now.rhdf

# compare with phdf_diff
uv run external/parthenon/scripts/python/packages/parthenon_tools/parthenon_tools/phdf_diff.py -one parthenon.restart.00002.rhdf first_run/parthenon.restart.00002.rhdf
uv run external/parthenon/scripts/python/packages/parthenon_tools/parthenon_tools/phdf_diff.py --tol 0 first_run/parthenon.restart.00002.rhdf parthenon.restart.now.rhdf
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ int main(int argc, char *argv[]) {
{
Hydro::HydroDriver driver(pman.pinput.get(), pman.app_input.get(), pman.pmesh.get());

// output restart file at t=0
driver.pouts->MakeOutputs(pman.pmesh.get(), pman.pinput.get(), &driver.tm, parthenon::SignalHandler::OutputSignal::now);

// This line actually runs the simulation
driver.Execute();
}
Expand Down

0 comments on commit 2aadeac

Please sign in to comment.