This repository was archived by the owner on Feb 26, 2025. It is now read-only.
Improve mem. ops. + NodeID-ElementID mapping bindings#179
Merged
Conversation
7f7f68a to
342b33b
Compare
alkino
previously approved these changes
Feb 18, 2022
342b33b to
91460f5
Compare
matz-e
approved these changes
Feb 20, 2022
mgeplf
reviewed
Feb 21, 2022
|
|
||
| // Fill ids | ||
| data_frame.ids = node_id_element_layout.ids; | ||
| data_frame.ids.swap(node_id_element_layout.ids); |
Contributor
There was a problem hiding this comment.
it's funny, I had this, but the asm turned out the same in both cases; now I'm doubting that.
mgeplf
approved these changes
Feb 21, 2022
Contributor
Author
Contributor
|
Thanks for the change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR improves the copy of the returned
idswhen fetching the data from the reports, as well as the Python bindings related to the NodeID-ElementID mapping (#168):std::vectoris swapped in a constant-time operation instead of a full copy. This is particularly useful when a large number of GIDs is requested.numpy.arrayinstead of a list of tuples. Hence, providing directly the result generated from the C++ code without any additional copies.Using the same ~60TB report from #174 that contains 4.2M GIDs (1.5B compartments), the following table illustrates the performance obtained by fetching a single timestep and varying the number of GIDs requested:
On the other hand, when using in Python the function
get_node_id_element_id_mapping()from #168, the following table shows the performance obtained varying the number of GIDs requested:Note that there has been other attempts to improve the copies of the voltages and even the tuples for the NodeID-ElementID mapping container, but the benefits turned out to be negligible compared to the source code complexity that was required.