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

Line opacity parallelization #179

Merged
merged 36 commits into from
Mar 6, 2024

Conversation

jvshields
Copy link
Contributor

This expands PR #178 to allow for parallelization of the slowest part of the code. It should not be merged before that pull request.

@jvshields jvshields added the benchmarks Trigger benchmarks to run on this pr label Feb 29, 2024
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 48.07692% with 27 lines in your changes are missing coverage. Please review.

Project coverage is 67.91%. Comparing base (ed2a670) to head (e3ab84a).

Files Patch % Lines
...adiation_field/opacities/opacities_solvers/base.py 41.37% 17 Missing ⚠️
stardis/base.py 57.89% 8 Missing ⚠️
...is/radiation_field/radiation_field_solvers/base.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #179      +/-   ##
==========================================
- Coverage   69.28%   67.91%   -1.37%     
==========================================
  Files          31       31              
  Lines        1172     1203      +31     
==========================================
+ Hits          812      817       +5     
- Misses        360      386      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tardis-bot
Copy link
Contributor

tardis-bot commented Feb 29, 2024

*beep* *bop*
Hi human,
I ran benchmarks as you asked comparing main (ed2a670) and the latest commit (e3ab84a).
Here are the logs produced by ASV.
Results can also be downloaded as artifacts here.
Significantly changed benchmarks:

       before           after         ratio
   [ed2a6705]       [e3ab84a5]
-      1.16±0.01s          973±4ms     0.84  run_stardis.Sim100AA.time_calc_alpha_line_at_nu
-         241±4ms          216±5ms     0.90  run_stardis.Sim10AA.time_calc_alpha_line_at_nu

All benchmarks:

All benchmarks:

     before           after         ratio
   [ed2a6705]       [e3ab84a5]
    1.12±0.01ms         1.10±0ms     0.99  run_stardis.Sim100AA.time_calc_alpha_file
-      1.16±0.01s          973±4ms     0.84  run_stardis.Sim100AA.time_calc_alpha_line_at_nu
        825±4ms         828±10ms     1.00  run_stardis.Sim100AA.time_raytrace
        4.59±0s       4.46±0.05s     0.97  run_stardis.Sim100AA.time_run_stardis
       989±10μs      1.03±0.03ms     1.04  run_stardis.Sim10AA.time_calc_alpha_file
-         241±4ms          216±5ms     0.90  run_stardis.Sim10AA.time_calc_alpha_line_at_nu
        683±2ms          675±4ms     0.99  run_stardis.Sim10AA.time_create_plasma
       56.3±3ms         55.0±2ms     0.98  run_stardis.Sim10AA.time_raytrace
        1.88±0s       1.89±0.01s     1.01  run_stardis.Sim10AA.time_run_stardis

DeerWhale
DeerWhale previously approved these changes Mar 4, 2024
benchmarks/run_stardis.py Outdated Show resolved Hide resolved
@@ -136,3 +136,111 @@ def calc_alpha_electron(self):

def time_create_plasma(self):
create_stellar_plasma(self.stellar_model, self.adata, self.config)


class BenchmarkStardis100Angstroms:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to make the tracing_lambas a parameter initializing the class so you don't need to repeat the rest of code in a seperate class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered it, but I think having a specific class be a different simulation is easier to understand and make changes to for somebody that knows less about the code in the future. Like you could just build a different RadiationField class with different tracing_lambdas arrays, without resolving the plasma or the model, but exactly where and how to do that and what parts feed in to what requires a little bit of care.

In this way, if somebody wants to change the benchmarks in the future, there's a pretty clear template, and it's more straightforward to follow the logic of the code.

Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jvshields jvshields merged commit 3731ee3 into tardis-sn:main Mar 6, 2024
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks Trigger benchmarks to run on this pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants