Skip to content

[Small Feature] Parallel Outlier Removal#4659

Merged
lrineau merged 7 commits intoCGAL:masterfrom
sgiraudot:PSP-Enhance_remove_outliers-GF
May 22, 2020
Merged

[Small Feature] Parallel Outlier Removal#4659
lrineau merged 7 commits intoCGAL:masterfrom
sgiraudot:PSP-Enhance_remove_outliers-GF

Conversation

@sgiraudot
Copy link
Copy Markdown
Contributor

@sgiraudot sgiraudot commented Apr 16, 2020

Rationale

Many algorithms in Point Set Processing are parallelized, but CGAL::remove_outliers() is not: the main reason is that it originally filled a std::multimap structure which is hard to parallelize.

This small feature adds a ConcurrencyTag template parameter to CGAL::remove_outliers() similarly to what already exists in other PSP functions. The algorithm has also changed slightly in the sense that it does not sort points anymore: apart from that, the output partition (which point is outlier, which point is inlier) is unchanged.

A parallel variant of the algorithm is added, and the sequential version is also made faster (around 1.7x faster in my experiments).

In practice:

  • replacing the std::multimap by a std::vector filled first and sorted afterwards makes the algorithm 1.3x faster than master version
  • replacing the sorting by a std::partition (for threshold-based version) and std::nth_element (for the percentage-based version) makes the algorithm 1.7x faster than master version
  • parallelization of the vector filling on a quad-core processor makes the algorithm 5.4x faster than master version

Summary of API changes

A new template parameter ConcurrencyTag is added to CGAL::remove_outliers(). Documentation is changed to make it clear that points are not sorted but only partitioned.

License and copyright ownership

(no change)

CHANGES.md

### Point Set Processing
 - **Breaking change:** `CGAL::remove_outliers()` has been
   parallelized and thus has a new template parameter
   `ConcurrencyTag`. To update your code simply add as first template
   parameter `CGAL::Sequential_tag` or `CGAL::Parallel_tag` when
   calling this function.

Submission

Status

  • Developed and locally tested (GNU/Linux)
  • Small Feature, pre-approved Andreas Fabri 16:21, 16 April 2020 (CEST)

@afabri
Copy link
Copy Markdown
Member

afabri commented Apr 16, 2020

Typo: a threshold on the of average

@MaelRL MaelRL added this to the 5.2-beta milestone Apr 16, 2020
@MaelRL MaelRL modified the milestones: 5.2-beta, 5.1-beta Apr 29, 2020
@MaelRL MaelRL added Accepted small feature CHANGES.md not updated Ready to be tested TODO and removed Not yet approved The feature or pull-request has not yet been approved. labels Apr 29, 2020
@maxGimeno
Copy link
Copy Markdown
Contributor

@lrineau
Copy link
Copy Markdown
Member

lrineau commented May 18, 2020

Still TODO: modify the CHANGES.md

@lrineau lrineau self-assigned this May 18, 2020
@sgiraudot sgiraudot force-pushed the PSP-Enhance_remove_outliers-GF branch from b85e444 to 700631d Compare May 18, 2020 11:56
@sgiraudot
Copy link
Copy Markdown
Contributor Author

(Please don't merge yet, I erased something by mistake, I still have to fix it.)

@sgiraudot
Copy link
Copy Markdown
Contributor Author

Ok we're good now, Sebastien fixed my mistake (@maxGimeno I see you put the Under Testing flag, if you already merged it in integration, you should do it again, otherwise there'll be a warning in the testsuite).

maxGimeno added a commit to maxGimeno/cgal that referenced this pull request May 19, 2020
…rs-GF

[Small Feature] Parallel Outlier Removal
@maxGimeno
Copy link
Copy Markdown
Contributor

@lrineau
Copy link
Copy Markdown
Member

lrineau commented May 22, 2020

@MaelRL Do you remember why you added "TODO" to this PR?

@MaelRL
Copy link
Copy Markdown
Member

MaelRL commented May 22, 2020

It was for the remark from @afabri at #4659 (comment), which was addressed.

@MaelRL MaelRL removed the TODO label May 22, 2020
@lrineau lrineau added the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label May 22, 2020
@lrineau lrineau merged commit 0e3db8c into CGAL:master May 22, 2020
@lrineau lrineau deleted the PSP-Enhance_remove_outliers-GF branch May 22, 2020 14:48
@lrineau lrineau removed the rm only: ready for master For the release team only: that indicates that a PR is about to be merged in 'master' label May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants