-
Notifications
You must be signed in to change notification settings - Fork 84
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
[Refactor] Particle variables and functions handling #654
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #654 +/- ##
=========================================
Coverage 96.66% 96.66%
=========================================
Files 123 124 +1
Lines 25375 25641 +266
=========================================
+ Hits 24527 24785 +258
- Misses 848 856 +8
Continue to review full report at Codecov.
|
After considering the speed-ups and different approaches, the use of scalar and vector properties still is 30% slower than using private variables. The advantage of scalar/vector properties is we'll have fewer functions and less repetition of code. On the other hand, defining private variables and deriving particle classes has more function definitions and repeating code, but is faster. I'd like to propose a vote, use emojis to vote between different options, please use comments below if you like to elaborate on your thoughts. @bodhinandach @tianchiTJ @thiagordonho @cw646 @ezrayst @jgiven100 @WeijianLiang
|
Thanks Krishna, I would prefer the use of scalar and vector properties which has a more clear structure. |
@WeijianLiang is that option 2 or 3? Could you please vote with a reaction emoji 😄 for option 2 and ❤️ for option 3. Thanks! |
For 2, are we just dealing with the scalar and vector properties to the derived particle types? If we have other types of quantities, do we still use the private variables? |
@yliang-sn everything will be held within scalar/vector/tensor/boolean |
Can I vote, too? If the private variables have the best efficiency, I prefer to 1. The structure is also clear enough to be read and extended. However, 2 is also fine for me. |
@yliang-sn yes, I couldn't find your handle, please vote. |
…-geo/mpm into refactor/particles
@thiagordonho @tianchiTJ @cw646 @WeijianLiang could you please use emoji reactions to vote on this comment please: #654 (comment) |
Both @kks32 and @bodhinandach have been working hard on this issue so appreciate your work. I think it has been about 2 months now. However, I feel that we need a unanimous decision on this refactor, or at least a 2/3 decision. The reason being is I don't want us to be in this position within 6 months where we are thinking to refactor again. I think the timeline on this issue has shown that this is a lot of work and everyone's progress is halted. Personally, if we are not even sure on (2) or (3), or anyone still has reservation on them, wouldn't it better to keep it as is (1)? Yes, |
@kks32 Thanks, I also vote for (2) |
After considering @ezrayst comment, I changed my vote to option (3). I know that the code will be slower, but the code is structurally way better and tidier. Also, if currently by moving to (3) causing us to be 30% slower than develop, I think we should rethink any other way to improve the speed. For instance, PR #677 has already improved the speed by 4% (thanks to @kks32). I think we can regain the current performance in short time by improving efficiency in other parts. |
After talking with Ezra and Nanda, I think i will change to vote for 3 if we can improve the efficiency in other aspects. |
Other containers like Abseil, folly, vector of vectors, static_vector, and small_vector implementations all gave slower or almost identical performance as the flat_map. Due to the 30% reduction in performance we are closing this issue. https://trello.com/c/fGF3MrKg/110-plan-for-next-week-notes |
Describe the PR
This is an alternative implementation of particle refactor.
After some more consideration, I am wondering about the possibility to derive particle types, but only keep the common particle functions within the class, and merge all independent/specialized functions to be outside the class. This will help to initialize the classes with the right types, and also in MPI transfer, as the type is known. We derived data of individual Particle types but keep specialized particle functions separately. Maybe the particle functions may have to stay in the same namespace.
Related Issues/PRs
#637 and #650
Additional context
Specialized functions will be still separate.
Following are the run-times for 3D hydrostatic column 10k steps on Stampede2