-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Line opacity parallelization #179
Conversation
Codecov ReportAttention: Patch coverage is
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. |
*beep* *bop* 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
|
benchmarks/run_stardis.py
Outdated
@@ -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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This expands PR #178 to allow for parallelization of the slowest part of the code. It should not be merged before that pull request.