Provide size_2d argument to extract_compute #69
Closed
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.
For global style computes that return an array, this keyword allows you to pre-specify the size of the array and skip the extra
extract_compute
calls to getSIZE_ROWS
andSIZE_COLS
.The context for this is that I've been developing an interface to the POD potential in LAMMPS (see this PR ), which involves extracting from the
pod/global
compute. This is a very expensive compute, and the current version ofextract_compute
repeats it two additional times to get the row and column size, which makes things much slower on my end. I know the exact size of this array in advance, so having this keyword argument allows me to greatly increase performance.Obviously, this is a very unsafe option, and I've tried to indicate this in the documentation.