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

Use previous slice as MG initial guess for explicit solver #450

Merged
merged 2 commits into from
Apr 8, 2021

Conversation

MaxThevenet
Copy link
Member

@MaxThevenet MaxThevenet commented Apr 8, 2021

This PR proposes to use Bx and By from the previous slice as an initial guess for the MG solver. We thought is was already the case, but apparently not. Here's a scan to see the improvement. As always, PC means predictor-corrector (old version), ii is now development and 00 indicates this PR. The improvement is marginal for this example.

output_0128PC000000.txt:TinyProfiler total time across processes [min...avg...max]: 1.639 ... 1.639 ... 1.639
output_0128WPmt0300.txt:TinyProfiler total time across processes [min...avg...max]: 1.496 ... 1.496 ... 1.496
output_0128WPmt03ii.txt:TinyProfiler total time across processes [min...avg...max]: 1.478 ... 1.478 ... 1.478
output_0128WPmt0400.txt:TinyProfiler total time across processes [min...avg...max]: 1.617 ... 1.617 ... 1.617
output_0128WPmt04ii.txt:TinyProfiler total time across processes [min...avg...max]: 1.84 ... 1.84 ... 1.84
output_0256PC000000.txt:TinyProfiler total time across processes [min...avg...max]: 4.398 ... 4.398 ... 4.398
output_0256WPmt0300.txt:TinyProfiler total time across processes [min...avg...max]: 3.105 ... 3.105 ... 3.105
output_0256WPmt03ii.txt:TinyProfiler total time across processes [min...avg...max]: 3.049 ... 3.049 ... 3.049
output_0256WPmt0400.txt:TinyProfiler total time across processes [min...avg...max]: 3.858 ... 3.858 ... 3.858
output_0256WPmt04ii.txt:TinyProfiler total time across processes [min...avg...max]: 4.008 ... 4.008 ... 4.008
output_0512PC000000.txt:TinyProfiler total time across processes [min...avg...max]: 19.2 ... 19.2 ... 19.2
output_0512WPmt0300.txt:TinyProfiler total time across processes [min...avg...max]: 7.91 ... 7.91 ... 7.91
output_0512WPmt03ii.txt:TinyProfiler total time across processes [min...avg...max]: 8.07 ... 8.07 ... 8.07
output_0512WPmt0400.txt:TinyProfiler total time across processes [min...avg...max]: 10.02 ... 10.02 ... 10.02
output_0512WPmt04ii.txt:TinyProfiler total time across processes [min...avg...max]: 10.26 ... 10.26 ... 10.26
output_1024PC000000.txt:TinyProfiler total time across processes [min...avg...max]: 143.8 ... 143.8 ... 143.8
output_1024WPmt0300.txt:TinyProfiler total time across processes [min...avg...max]: 32.39 ... 32.39 ... 32.39
output_1024WPmt03ii.txt:TinyProfiler total time across processes [min...avg...max]: 32.22 ... 32.22 ... 32.22
output_1024WPmt0400.txt:TinyProfiler total time across processes [min...avg...max]: 37.83 ... 37.83 ... 37.83
output_1024WPmt04ii.txt:TinyProfiler total time across processes [min...avg...max]: 37.89 ... 37.89 ... 37.89
output_2048PC000000.txt:TinyProfiler total time across processes [min...avg...max]: 2336 ... 2336 ... 2336
output_2048WPmt0300.txt:TinyProfiler total time across processes [min...avg...max]: 285.5 ... 285.5 ... 285.5
output_2048WPmt03ii.txt:TinyProfiler total time across processes [min...avg...max]: 287.1 ... 287.1 ... 287.1

Looking into output_0512WPmt04**.txt I get the following number of MG iterations

# iterations old new
1 0 0
2 10 41
3 501 470
4 0 0

So the new version is converging a bit more often with 2 iterations instead of 3, but it doesn't have a large impact on the runtime. Still, I think it is worth merging this, it could have a bigger impact in some cases (in particular when a lower tolerance is required).

@MaxThevenet MaxThevenet added the performance optimization, benchmark, profiling, etc. label Apr 8, 2021
Copy link
Member

@SeverinDiederichs SeverinDiederichs left a comment

Choose a reason for hiding this comment

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

Thanks for this PR!
Grabbing the last low hanging fruit of the MG solver

@MaxThevenet MaxThevenet merged commit 66479ed into development Apr 8, 2021
@MaxThevenet MaxThevenet deleted the reuseb branch April 8, 2021 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance optimization, benchmark, profiling, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants