Skip to content

Commit

Permalink
Merge branch 'ppm_source_tracing' of github.com:zingale/Castro into p…
Browse files Browse the repository at this point in the history
…pm_source_tracing
  • Loading branch information
zingale committed Aug 21, 2024
2 parents 2c57bc8 + ec64d4f commit 83e735b
Show file tree
Hide file tree
Showing 38 changed files with 554 additions and 267 deletions.
32 changes: 32 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# 24.08

* lazy QueueReduction has been enabled for the timing diagnostics
(#2926)

* The `job_info` file output now correctly labels the compute time
as GPU-hours instead of CPU-hours when running on GPUs (#2930)

* We can now output warnings when running on GPUs if you build
with `USE_GPU_PRINTF=TRUE`(#2923, #2928)

* Code clean-ups / sync with Microphysics (#2900, #2901, #2905,
#2906, #2909, #2912, #2919, #2922, #2932, #2933, #2936, #2938,
#2940)

* The area weighting in the diagnostics in `subch_planar` was fixed
(#2885)

* A script to produce a resolution study for the `circular_det`
problem was added (#2857)

* science problem updates: `xrb_layered` (#2917), `nova` (#2913),
`wdmerger` (#2907, #2918, #2931), `Detonation` (#2902)

* updated scaling results on Frontier (#2904, #2914, #2915)

* more exact Riemann solver clean-up (#2896, #2897, #2898)
and clean-ups to the two shock solvers (#2895)

* fix issues with eigenvectors and clang-tidy in the MHD solver
(#2880)

# 24.07

* Reorganizing of the existing 2-shock and HLL Riemann solvers
Expand Down
49 changes: 32 additions & 17 deletions Docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,46 @@ Compiling
There are 2 things you can do to check what’s happening. First, inspect
the directories in ``VPATH_LOCATIONS``. This can be done via:

::
.. prompt:: bash

make print-VPATH_LOCATIONS
make print-VPATH_LOCATIONS

Next, ask make to tell you where it is finding each of the source
files. This is done through a script ``find_files_vpath.py``
that is hooked into Castro’s build system. You can run this as:

::
.. prompt:: bash

make file_locations
make file_locations

At the end of the report, it will list any files it cannot find in
the vpath. Some of these are to be expected (like ``extern.f90``
and ``buildInfo.cpp``—these are written at compile-time. But any
other missing files need to be investigated.
the vpath. Some of these are to be expected (like
``buildInfo.cpp``—these are written at compile-time). But any other
missing files need to be investigated.

#. *I put a copy of one of the header files (e.g. ``problem_tagging.H``)
in my problem setup but it does not seem to recognized / used by
the build system. Why doesn't my executable use my custom version
of the header?*

This is likely due to compiler caching / ccache. You need to
clear the cache and the build:

.. prompt:: bash

ccache -C
make clean

Then rebuild and it should be recognized.

#. *I’m still having trouble compiling. How can I find out what
all of the make variables are set to?*

Use:

::
.. prompt:: bash

make help
make help

This will tell you the value of all the compilers and their options.

Expand Down Expand Up @@ -104,7 +119,7 @@ Debugging

Given a MultiFab ``mf``, you can dump out the state as:

::
.. code:: c++

print_state(mf, IntVect(AMREX_D_DECL(10, 20, 30)));

Expand All @@ -119,7 +134,7 @@ Debugging
You can simply output a FAB to ``std::cout``. Imagine that you
are in an MFIter loop, with a MultiFab ``mf``:

::
.. code:: c++

S = FArrayBox& mf[mfi];
std::cout << S << std::endl;
Expand All @@ -143,9 +158,9 @@ Profiling
When you run, a file named ``gmon.out`` will be produced. This can
be processed with gprof by running:

::
.. prompt:: bash

gprof exec-name
gprof exec-name

where *exec-name* is the name of the executable. More detailed
line-by-line information can be obtained by passing the -l
Expand All @@ -159,9 +174,9 @@ Managing Runs

Create a file called ``dump_and_continue``, e.g., as:

::
.. prompt:: bash

touch dump_and_continue
touch dump_and_continue

This will force the code to output a checkpoint file that can be used
to restart. Other options are ``plot_and_continue`` to output
Expand Down Expand Up @@ -193,9 +208,9 @@ Managing Runs

The build information (including git hashes, modules, EoS, network, etc.) can be displayed by running the executable as

::
.. prompt:: bash

./Castro.exe --describe
./Castro.exe --describe

.. _ch:faq:vis:

Expand Down
3 changes: 3 additions & 0 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ endif
# Require C++17
CXXSTD := c++17

# Use Lazy QueueReduction for the timing outputs
LAZY := TRUE

# default integrator
INTEGRATOR_DIR ?= VODE

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/Noh/problem_bc_fill.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void problem_bc_fill(int i, int j, int k,

eos_t zone_state;
zone_state.rho = rho_init * std::pow(1.0_rt + time / r, AMREX_SPACEDIM - 1);
zone_state.p = pres_init * std::pow(zone_state.rho / rho_init, 1.0_rt + eos_gamma);
zone_state.p = pres_init * std::pow(zone_state.rho / rho_init, 1.0_rt + eos_rp::eos_gamma);
for (int n = 0; n < NumSpec; ++n) {
zone_state.xn[n] = 1.0_rt / static_cast<Real>(NumSpec);
}
Expand Down
8 changes: 4 additions & 4 deletions Exec/hydro_tests/RT/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ void problem_initialize_state_data (int i, int j, int k,

if (r[AMREX_SPACEDIM-1] < problem::split[AMREX_SPACEDIM-1]) {
Real pres = problem::p0_base - problem::rho_1 * r[AMREX_SPACEDIM-1];
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
} else {
Real pres = presmid - problem::rho_2 *
(r[AMREX_SPACEDIM-1] - problem::split[AMREX_SPACEDIM-1]);
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
}

Real pertheight;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/Vortices_LWAcoustics/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ void problem_initialize ()

// Define rho_0

problem::rho_0 = std::pow(problem::p_ref, 1.0_rt/eos_gamma);
problem::rho_0 = std::pow(problem::p_ref, 1.0_rt/eos_rp::eos_gamma);

// Define c_0

problem::c_0 = std::sqrt(eos_gamma * problem::p_ref / problem::rho_0);
problem::c_0 = std::sqrt(eos_rp::eos_gamma * problem::p_ref / problem::rho_0);

// Define r_c, radius of each vortex

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void problem_initialize_state_data (int i, int j, int k,

// internal energy

state(i,j,k,UEINT) = problem::p_ref / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = problem::p_ref / (eos_rp::eos_gamma - 1.0_rt);

// Total energy

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ void problem_initialize_state_data (int i, int j, int k,
state(i,j,k,UMZ) = 0.0_rt;

// we are isentropic, so p = (dens/rho0)**Gamma_1
Real p = std::pow(state(i,j,k,URHO) / problem::rho0, eos_gamma);
Real eint = p / (eos_gamma - 1.0_rt);
Real p = std::pow(state(i,j,k,URHO) / problem::rho0, eos_rp::eos_gamma);
Real eint = p / (eos_rp::eos_gamma - 1.0_rt);

state(i,j,k,UEDEN) = eint;
state(i,j,k,UEINT) = eint;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/gamma_law_bubble/Problem_Derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ void ca_derrhopert(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
if (problem::do_isentropic) {
Real z = static_cast<Real>(j) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base *
std::pow((gravity::const_grav * problem::dens_base * (eos_gamma - 1.0_rt) * z/
(eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_gamma - 1.0_rt));
std::pow((gravity::const_grav * problem::dens_base * (eos_rp::eos_gamma - 1.0_rt) * z/
(eos_rp::eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_rp::eos_gamma - 1.0_rt));
} else {
Real z = (static_cast<Real>(j) + 0.5_rt) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base * std::exp(-z/H);
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/gamma_law_bubble/initial_model.H
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ generate_initial_model(const int npts_model, const Real xmin, const Real xmax,

density = model_params.dens_base *
std::pow(gravity::const_grav * model_params.dens_base *
(eos_gamma - 1.0) * z /
(eos_gamma * model_params.p_base) + 1.0_rt, 1.0_rt/(eos_gamma - 1.0_rt));
(eos_rp::eos_gamma - 1.0) * z /
(eos_rp::eos_gamma * model_params.p_base) + 1.0_rt, 1.0_rt/(eos_rp::eos_gamma - 1.0_rt));

} else {
Real z = xmin + (static_cast<Real>(i) + 0.5_rt) * dx;
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/gamma_law_bubble/prob_util.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ gamma_law_initial_model(Real* const pressure, Real* const density, Real* const t
if (problem::do_isentropic) {
Real z = static_cast<Real>(j) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base *
std::pow((gravity::const_grav * problem::dens_base * (eos_gamma - 1.0_rt) * z/
(eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_gamma - 1.0_rt));
std::pow((gravity::const_grav * problem::dens_base * (eos_rp::eos_gamma - 1.0_rt) * z/
(eos_rp::eos_gamma * problem::pres_base) + 1.0_rt), 1.0_rt/(eos_rp::eos_gamma - 1.0_rt));
} else {
Real z = (static_cast<Real>(j) + 0.5_rt) * dx[AMREX_SPACEDIM-1];
density[j] = problem::dens_base * std::exp(-z/H);
Expand Down
16 changes: 8 additions & 8 deletions Exec/hydro_tests/riemann_2d/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_3;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_3;
state(i, j, k, UEINT) = problem::p_3 / (eos_gamma - 1.0_rt);
state(i, j, k, UEDEN) = problem::p_3 / (eos_gamma - 1.0_rt)
state(i, j, k, UEINT) = problem::p_3 / (eos_rp::eos_gamma - 1.0_rt);
state(i, j, k, UEDEN) = problem::p_3 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_3 * problem::ux_3 * problem::ux_3
+ 0.5 * problem::rho_3 * problem::uy_3 * problem::uy_3;

Expand All @@ -66,9 +66,9 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_4;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_4;
state(i, j, k, UEINT) = problem::p_4 / (eos_gamma - 1.0_rt);
state(i, j, k, UEINT) = problem::p_4 / (eos_rp::eos_gamma - 1.0_rt);

state(i, j, k, UEDEN) = problem::p_4 / (eos_gamma - 1.0_rt)
state(i, j, k, UEDEN) = problem::p_4 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_4 * problem::ux_4 * problem::ux_4
+ 0.5 * problem::rho_4 * problem::uy_4 * problem::uy_4;

Expand All @@ -79,9 +79,9 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_2;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_2;
state(i, j, k, UEINT) = problem::p_2 / (eos_gamma - 1.0_rt);
state(i, j, k, UEINT) = problem::p_2 / (eos_rp::eos_gamma - 1.0_rt);

state(i, j, k, UEDEN) = problem::p_2 / (eos_gamma - 1.0_rt)
state(i, j, k, UEDEN) = problem::p_2 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_2 * problem::ux_2 * problem::ux_2
+ 0.5 * problem::rho_2 * problem::uy_2 * problem::uy_2;
} else if (xx > problem::center[0] & yy > problem::center[1])
Expand All @@ -91,9 +91,9 @@ void problem_initialize_state_data(int i, int j, int k,

state(i, j, k, UMX) = state(i, j, k, URHO) * problem::ux_1;
state(i, j, k, UMY) = state(i, j, k, URHO) * problem::uy_1;
state(i, j, k, UEINT) = problem::p_1 / (eos_gamma - 1.0_rt);
state(i, j, k, UEINT) = problem::p_1 / (eos_rp::eos_gamma - 1.0_rt);

state(i, j, k, UEDEN) = problem::p_1 / (eos_gamma - 1.0_rt)
state(i, j, k, UEDEN) = problem::p_1 / (eos_rp::eos_gamma - 1.0_rt)
+ 0.5 * problem::rho_1 * problem::ux_1 * problem::ux_1
+ 0.5 * problem::rho_1 * problem::uy_1 * problem::uy_1;
}
Expand Down
9 changes: 4 additions & 5 deletions Exec/mhd_tests/RT/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ void problem_initialize_state_data (int i, int j, int k,
Real pres;
if (r[AMREX_SPACEDIM-1] < problem::split[AMREX_SPACEDIM-1]) {
pres = problem::p0_base - problem::rho_1 * r[AMREX_SPACEDIM-1];
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
} else {
pres = presmid - problem::rho_2 * (r[AMREX_SPACEDIM-1] - problem::split[AMREX_SPACEDIM-1]);
state(i,j,k,UEDEN) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_gamma - 1.0_rt);
state(i,j,k,UEDEN) = pres / (eos_rp::eos_gamma - 1.0_rt);
state(i,j,k,UEINT) = pres / (eos_rp::eos_gamma - 1.0_rt);
}

// doing it similar to 2d, will be something in x-z though
Expand All @@ -61,4 +61,3 @@ void problem_initialize_state_data (int i, int j, int k,

}
#endif

Loading

0 comments on commit 83e735b

Please sign in to comment.