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

reorganize is_fastest_rate function for NSE_NET #1274

Merged
merged 77 commits into from
Jul 12, 2023

Conversation

zhichen3
Copy link
Collaborator

Based on pr#1269. I reorganized is_fastest_rate function to make it more readable and renamed it to fill_merge_indices, since it is more descriptive and accurate of what the function does.

It also gives a slight improvement in the time it takes for this function.

Here's the new profile for running Detonation on perlmutter (no mpi or anything). For whatever reason get_partition_function doesn't take that much time anymore.

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 16.12     12.61    12.61 754714265     0.00     0.00  std::_Function_handler<amrex::GpuTuple<int, int> (), amrex::ReduceData<int, int>::ReduceData<amrex::ReduceOpMax, amrex::ReduceOpMax>(amrex::ReduceOps<amrex::ReduceOpMax, amrex::ReduceOpMax>&)::{lambda()#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)
 15.43     24.68    12.07 20251079     0.00     0.00  void fcn<burn_t>(amrex::Array1D<double, 1, 2>&, amrex::Array1D<double, 1, 2>&, burn_t const&, int&) [clone .constprop.0]
  9.55     32.15     7.47 375679202     0.00     0.00  std::_Function_handler<amrex::GpuTuple<amrex::ValLocPair<double, amrex::IntVect> > (), amrex::ReduceData<amrex::ValLocPair<double, amrex::IntVect> >::ReduceData<amrex::ReduceOpMin>(amrex::ReduceOps<amrex::ReduceOpMin>&)::{lambda()#1}>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)
  9.08     39.25     7.10      112     0.06     0.70  Castro::react_state(amrex::MultiFab&, amrex::MultiFab&, double, double, int)
  6.66     44.46     5.21 56871959     0.00     0.00  void apply_electrons<burn_t>(burn_t&)
  4.85     48.25     3.79  5949077     0.00     0.00  Castro::okToContinue()
  4.64     51.88     3.63  5832732     0.00     0.00  in_nse(burn_t&, bool)
  3.80     54.85     2.97  5751323     0.00     0.00  void nse_hybrid_solver<burn_t>(burn_t&, double)
  3.72     57.76     2.91 14532070     0.00     0.00  void actual_eos<eos_input_t, burn_t>(eos_input_t, burn_t&)
  3.59     60.57     2.81 952020582     0.00     0.00  get_partition_function(int, tf_t const&, double&, double&)
  2.94     62.87     2.30  5762508     0.00     0.00  void hybrj<2, burn_t>(hybrj_t<2>&, burn_t const&)
  2.68     64.97     2.10  9074378     0.00     0.00  sneut5(double, double, double, double, double&, double&, double&, double&, double&)
  2.31     66.78     1.81  8736723     0.00     0.00  void evaluate_rates<0, rate_t>(burn_t const&, rate_t&)
  1.89     68.26     1.48  8736723     0.00     0.00  void fill_reaclib_rates<0, rate_t>(tf_t const&, rate_t&)
  1.12     69.13     0.88 10467305     0.00     0.00  void chabrier1998<1>(plasma_state_t const&, scrn::screen_factors_t const&, double&, double&)
  0.97     69.89     0.76  9074378     0.00     0.00  rhs_nuc(burn_t const&, amrex::Array1D<double, 1, 23>&, amrex::Array1D<double, 1, 22> const&, amrex::Array1D<double, 1, 93> const&)
  0.87     70.57     0.68 47787585     0.00     0.00  fill_merge_indices(amrex::Array1D<int, 1, 2>&, double&, int, amrex::Array1D<double, 1, 22> const&, burn_t const&, amrex::Array1D<double, 1, 93> const&, amrex::Array1D<int, 1, 22> const&, double const&)
  0.65     71.08     0.51  8736723     0.00     0.00  void rate_s32_to_p_p31_derived<0>(tf_t const&, double&, double&)
  0.64     71.58     0.50  8736723     0.00     0.00  void rate_mg24_to_he4_ne20_derived<0>(tf_t const&, double&, double&)

@zingale zingale merged commit e5c0f75 into AMReX-Astro:development Jul 12, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants