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

pp00aa dynamic OpenMP scheduling improves load imbalance #207

Merged

Conversation

missing-user
Copy link
Contributor

Since poincare tracing is done using an adaptive integration routine, execution time isn't equal between points.
Especially chaotic regions take the longer to integrate and are typically not equally distributed along the nptrj range, so this results in a significant load imbalance between threads. The default static scheduling divides the workloads in large, equal blocks between threads. Dynamic scheduling creates a more fine grained work distribution (round robin, 1 loop iteration per thread) and uses whichever threads are available at the moment.

This might cause a minor performance overhead in the edge case of very small nppts, with low and large nptrj, but this should be outweighed by the improved load balance. It improved wall clock time and CPU utilization in all my tested examples.

E.g. for a simple rotating ellipse with

 odetol      =   1.000000000000000E-07
 nPpts       =      1000
 nPtrj       =      8    80

this resulted in a speedup of 34s (1m25s to 51s) on 4 threads, and a speedup was measurable even in the "worst case" of nppts = 1

@missing-user
Copy link
Contributor Author

missing-user commented Nov 14, 2024

Arguably related to #79 since it does speed up field line tracing and #55

Copy link
Collaborator

@jonathanschilling jonathanschilling left a comment

Choose a reason for hiding this comment

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

LGTM!

@smiet smiet merged commit 51478ce into PrincetonUniversity:master Nov 23, 2024
5 checks passed
@missing-user missing-user deleted the minor-openmp-improvements branch November 23, 2024 14:53
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.

3 participants