(Discussion) Initial refactor resampleCloudSpatially for multi-threading#67
Open
nigels-com wants to merge 1 commit intoCloudCompare:masterfrom
Open
(Discussion) Initial refactor resampleCloudSpatially for multi-threading#67nigels-com wants to merge 1 commit intoCloudCompare:masterfrom
nigels-com wants to merge 1 commit intoCloudCompare:masterfrom
Conversation
Contributor
Author
|
On a related note, I'm also interested in the potential for multi-threaded octree building. |
Member
|
Hi, From what I see in this PR (at this point) the changes to the existing code base seem reasonable. And if you wish to contribute your parallel version upstream, no problem ;) |
5c610ab to
e9c3774
Compare
Member
|
Hi @nigels-com, are you going to push this effort forward in the future? |
Contributor
Author
|
It has been a fair while, indeed. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: This branch is untested. It does compile.
I have a heavily refactored version of
resampleCloudSpatiallythat supports multi-threading.In terms of licensing, ideally I could contribute that upstream rather than LGPL the surrounding code.
So the purpose of this PR is to open a discussion of what might be agreeable all around.
The reasoning for this change:
marker/filtered countback-end version ofresampleCloudSpatiallythat does not allocate the markers or the output point cloud.resampleCloudSpatiallycontinues behaving in a compatible manner.And to be clear this PR does not multi-thread but is more aligned with my more severe refactor.
Further thoughts:
To broadly describe the multi-threading approach, have concurrent neighbour searching, but lock access to the markers with a mutex and check if the current point is still filtered-in before proceeding to filter-out the neighbourhood. We do see some occasional non-determinism due to the non-deterministic order of points being processed, but the speedup is worthwhile. With 12 threads we don't seem quite bottle-necked on updating markers, but that likely depends on the minimum distance and the typical neighbour count.