cmuparlay / parlaylib

A Toolkit for Programming Parallel Algorithms on Shared-Memory Multicore Machines
MIT License
321 stars 60 forks source link

Fix C++20 compatibility issues and faster integer hashing #55

Closed DanielLiamAnderson closed 1 year ago

DanielLiamAnderson commented 1 year ago

53 identifies some issues with the atomic_wait/atomic_notify interface. The signatures of the wait and notify methods from the sample implementation do not match those in the C++20 standard, and the fallback when the standard library already implements them uses aliases which do not permit type deduction. This fixes both of those issues.

Some other compile issues with C++20 enabled have also been fixed, including some cases of aggregate initialization in TestParallel which are no longer valid, and the packed struct extension used in sequence_base, which wasn't applied widely enough.

This patch also addresses #40 by changing the hashing function Parlay uses for integer types. This corrects the performance regression in the grouping and deduping algorithms observed post-PR #22.

codecov-commenter commented 1 year ago

Codecov Report

Merging #55 (c38e4f4) into master (5af0694) will increase coverage by 0.11%. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
+ Coverage   96.58%   96.69%   +0.11%     
==========================================
  Files          51       51              
  Lines        3454     3452       -2     
==========================================
+ Hits         3336     3338       +2     
+ Misses        118      114       -4     
Impacted Files Coverage Δ
include/parlay/internal/sequence_base.h 98.56% <ø> (ø)
include/parlay/internal/atomic_wait.h 100.00% <100.00%> (ø)
include/parlay/utilities.h 99.23% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

DanielLiamAnderson commented 1 year ago

Performance test results attached. The performance of grouping and deduplicating algorithms is improved by up to 23%.

pr55-april23.zip