Skip to content

Commit

Permalink
fix more this captures
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Jul 24, 2024
1 parent 15ced80 commit 0eb0cc8
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 48 deletions.
17 changes: 10 additions & 7 deletions Source/diffusion/Castro_diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ Castro::construct_old_diff_source(MultiFab& source, MultiFab& state_in, Real tim

if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;

const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;
#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_old_diff_source() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_old_diff_source() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down Expand Up @@ -59,15 +60,17 @@ Castro::construct_new_diff_source(MultiFab& source, MultiFab& state_old, MultiFa

if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_new_diff_source() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_new_diff_source() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down
30 changes: 19 additions & 11 deletions Source/gravity/Castro_gravity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,17 @@ Castro::construct_old_gravity (Real time)

if (verbose > 0)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_old_gravity() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_old_gravity() time = " << run_time << " on level "
<< llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down Expand Up @@ -278,15 +280,17 @@ Castro::construct_new_gravity (Real time)

if (verbose > 0)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_new_gravity() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_new_gravity() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down Expand Up @@ -431,14 +435,16 @@ void Castro::construct_old_gravity_source(MultiFab& source, MultiFab& state_in,
if (castro::verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_old_gravity_source() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_old_gravity_source() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down Expand Up @@ -667,15 +673,17 @@ void Castro::construct_new_gravity_source(MultiFab& source, MultiFab& state_old,

if (castro::verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_new_gravity_source() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_new_gravity_source() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down
6 changes: 4 additions & 2 deletions Source/gravity/Gravity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,13 +457,15 @@ Gravity::solve_for_phi (int level,
if (gravity::verbose)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real end = ParallelDescriptor::second() - strt;
amrex::Real end = ParallelDescriptor::second() - strt;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(end,IOProc);
amrex::Print() << "Gravity::solve_for_phi() time = " << end << " on level " << level << std::endl << std::endl;
amrex::Print() << "Gravity::solve_for_phi() time = " << end << " on level "
<< llevel << std::endl << std::endl;
#ifdef BL_LAZY
});
#endif
Expand Down
11 changes: 7 additions & 4 deletions Source/hydro/Castro_ctu_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,12 +1419,13 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co

#ifdef RADIATION
if (radiation->verbose>=1) {
amrex::Real llevel = level;
#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceIntMax(nstep_fsp, ParallelDescriptor::IOProcessorNumber());
if (ParallelDescriptor::IOProcessor() && nstep_fsp > 0) {
std::cout << "Radiation f-space advection on level " << level
std::cout << "Radiation f-space advection on level " << llevel
<< " takes as many as " << nstep_fsp;
if (nstep_fsp == 1) {
std::cout<< " substep.\n";
Expand Down Expand Up @@ -1482,15 +1483,17 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) // NOLINT(readability-co

if (verbose > 0)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_ctu_hydro_source() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_ctu_hydro_source() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down
8 changes: 4 additions & 4 deletions Source/hydro/Castro_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Castro::construct_old_hybrid_source(MultiFab& source, MultiFab& state_old, Real

if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
Expand Down Expand Up @@ -65,8 +65,8 @@ Castro::construct_new_hybrid_source(MultiFab& source, MultiFab& state_old, Multi

if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
Expand Down
4 changes: 2 additions & 2 deletions Source/hydro/Castro_mol_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,8 @@ Castro::construct_mol_hydro_source(Real time, Real dt, MultiFab& A_update)

if (verbose > 0)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
Expand Down
8 changes: 4 additions & 4 deletions Source/problems/Castro_problem_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Castro::construct_old_ext_source(MultiFab& source, MultiFab& state_in, Real time

if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
Expand Down Expand Up @@ -95,8 +95,8 @@ Castro::construct_new_ext_source(MultiFab& source, MultiFab& state_old, MultiFab

if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
Expand Down
14 changes: 9 additions & 5 deletions Source/reactions/Castro_react.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,14 +444,16 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra
if (verbose > 0)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::react_state() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::react_state() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down Expand Up @@ -842,15 +844,17 @@ Castro::react_state(Real time, Real dt)

amrex::Print() << "... Leaving burner on level " << level << " after completing full timestep of burning." << std::endl << std::endl;

const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time, IOProc);

amrex::Print() << "Castro::react_state() time = " << run_time << " on level " << level << std::endl << std::endl;
amrex::Print() << "Castro::react_state() time = " << run_time
<< " on level " << llevel << std::endl << std::endl;
#ifdef BL_LAZY
});
#endif
Expand Down
6 changes: 4 additions & 2 deletions Source/rotation/Castro_rotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ Castro::construct_old_rotation_source(MultiFab& source, MultiFab& state_in, Real
if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::construct_old_rotation_source() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::construct_old_rotation_source() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down
4 changes: 2 additions & 2 deletions Source/sources/Castro_geom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Castro::construct_old_geom_source(MultiFab& source, MultiFab& state_in, Real tim

if (verbose > 1)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
Expand Down
13 changes: 8 additions & 5 deletions Source/sources/Castro_sources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,16 @@ Castro::do_old_sources(
if (verbose > 0)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::do_old_sources() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::do_old_sources() time = " << run_time
<< " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down Expand Up @@ -242,15 +244,16 @@ Castro::do_new_sources(

if (verbose > 0)
{
const int IOProc = ParallelDescriptor::IOProcessorNumber();
Real run_time = ParallelDescriptor::second() - strt_time;
const int IOProc = ParallelDescriptor::IOProcessorNumber();
amrex::Real run_time = ParallelDescriptor::second() - strt_time;
amrex::Real llevel = level;

#ifdef BL_LAZY
Lazy::QueueReduction( [=] () mutable {
#endif
ParallelDescriptor::ReduceRealMax(run_time,IOProc);

amrex::Print() << "Castro::do_new_sources() time = " << run_time << " on level " << level << "\n" << "\n";
amrex::Print() << "Castro::do_new_sources() time = " << run_time << " on level " << llevel << "\n" << "\n";
#ifdef BL_LAZY
});
#endif
Expand Down

0 comments on commit 0eb0cc8

Please sign in to comment.