Skip to content
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

Segmented inclusive_scan and exclusive_scan implementation #2287

Merged
merged 31 commits into from Sep 25, 2016

Conversation

@Sanac
Copy link
Contributor

@Sanac Sanac commented Aug 11, 2016

  • Added segmented inclusive_scan. (see #1338)
  • Added some simple tests
@biddisco
Copy link
Contributor

@biddisco biddisco commented Aug 11, 2016

We had a long discussion about this today and my concern is that the first scan phase is done by each partition, but then the whold scan result is returned to the root partition where the merge/updte steps are performed and the final result vector is held on the root partition.

The reason for this was to do with iterators.

It seem that if the algorithm is called with a partitioned_vector as input, and a partitioned_vector as output (or in place), then those iterators are already present on the relevant partitions and the solution presented here is only useful if the output/dest iterator is actually a normal vector - and not a partitioned one.

@hkaiser - can you add a few lines to explain how to ensure that the merge/update phases will happen on the locality/partition that owns it, rather than back on the root.

@hkaiser
Copy link
Member

@hkaiser hkaiser commented Aug 11, 2016

can you add a few lines to explain how to ensure that the merge/update phases will happen on the locality/partition that owns it, rather than back on the root.

There is an example demonstrating how to work with the local parts of a partitioned vector only: https://github.com/STEllAR-GROUP/hpx/blob/master/examples/quickstart/partitioned_vector_spmd_foreach.cpp

@Sanac
Copy link
Contributor Author

@Sanac Sanac commented Aug 19, 2016

  • Added optimization to use locality of data if available
  • In-place usage of the scan possible
  • Changed tests so that changes are tested
  • Also optimized tests so that less time is wasted doing setup and verification

@Sanac
Copy link
Contributor Author

@Sanac Sanac commented Aug 22, 2016

  • Refactoring of code in preparation for exclusive scan
  • Code can be reviewed

@Sanac Sanac closed this Aug 22, 2016
@Sanac Sanac reopened this Aug 22, 2016
@Sanac Sanac changed the title Segmented inclusive_scan implementation Segmented inclusive_scan and exclusive implementation Aug 23, 2016
@Sanac Sanac changed the title Segmented inclusive_scan and exclusive implementation Segmented inclusive_scan and exclusive_scan implementation Aug 23, 2016
@Sanac
Copy link
Contributor Author

@Sanac Sanac commented Aug 23, 2016

  • Added some comments in code
  • Added exclusive scan with tests to PR


if(beg_in != end_in) {
std::uint64_t in_id = traits_in::get_id(sit_in).get_msb();
std::uint64_t out_id = traits_in::get_id(sit_in).get_msb();
Copy link
Member

@hkaiser hkaiser Sep 3, 2016

Shouldn't this compare the whole id and not only the msb?

@Sanac
Copy link
Contributor Author

@Sanac Sanac commented Sep 5, 2016

  • Fixed comparison of msb to locality id
  • Invocation of std::distance only if ids are the same
  • Passed down init by const&
  • Capturing of op done by value

@Sanac
Copy link
Contributor Author

@Sanac Sanac commented Sep 12, 2016

  • Pass localities via parameter in the tests

Copy link
Member

@hkaiser hkaiser left a comment

LGTM, thanks a lot!

@hkaiser hkaiser merged commit aef13f1 into STEllAR-GROUP:master Sep 25, 2016
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Standard Algorithms
  
Merged to master
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants