Comparing the Performance of C++ Parallel Algorithms With...
Transcript of Comparing the Performance of C++ Parallel Algorithms With...
![Page 1: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/1.jpg)
COMPARING THE PERFORMANCE
OF C++ PARALLEL ALGORITHMS
WITH THEIR IMPLEMENTATIONS IN
HPX
REU CCT 2018
Reu student: Jean Beldunord
Mentor: Dr. Hartmut Kaiser
![Page 2: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/2.jpg)
Overview
o The C++ parallel algorithms are part of its standard library. The C++ 17 library contains execution policy. An execution policy dictate whether a program should run in sequential parallel, or parallel unsequential.
o HPX is a general purpose C++ runtime system for parallel and distributed applications of any scale
o It’s overall purpose is to optimize on overall efficiency.
o Both the C++ 17 library and HPX contains similar algorithms, in which a performance test will be conducted to evaluate their efficiency.
![Page 3: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/3.jpg)
Execution parameter
1. Sequence_policy – An execution policy that a parallel algorithms' execution may not be parallelized.
2. Parallel_policy – Showcase that a parallel algorithm may be parallelized
3. Parallel_unsequenced_policy - An execution policy showcasing that a parallel algorithm may be parallelized or vectored.
![Page 4: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/4.jpg)
Algorithms’ used
1.Reduce _Parallel: The reduce algorithm returns the result of the generalized sum over the elements given by the input range [first, last
2.. Find_Parallel: The find algorithm is used to locate different instances.
![Page 5: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/5.jpg)
Procedure
o Utilize a benchmark test with a large vector
containing different parallel algorithms.
o Ran across both HPX and C++ application on Visual
studio. Using a Pc with twelve cores.
o Used appropriate sample size, where difference are
significant with a 95% confidence interval
o Graph the results of selected algorithms’
![Page 6: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/6.jpg)
Data
0
1
2
3
4
5
6
7
8
9
1 2 3 4 5 6 7 8 9 10Ru
nn
ing
tim
e in
M
ilis
eco
nd
s
Core(s)
Reduce Par Performance Test
HPX duration C++ 17 duration
0
2
4
6
8
10
12
1 2 3 4 5 6 7 8 9 10 11 12Ru
nn
ing
Tim
e in
m
illi
seco
nd
s
Core(s)
Find Par Perfomance Test
HPX duration C++ 17 duration
![Page 7: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/7.jpg)
HPX hyperthreading
![Page 8: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/8.jpg)
PC Model
Machine version: Processor Intel(R) Core(TM) Xeon (R))3-6100U CPU @ 2.93GHz, 2301 MHz, 2 Processors,RAM:24.0 GB
![Page 9: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/9.jpg)
Conclusion
From the collected results, it is clear to see there is some sort of consistency from the C++ 17 portion when running on number of cores. HPX gives the user the ability to change the number of cores used. On both instances, HPX almost performed at perfect scaling. In general, both applications performed significantly at the same level.
![Page 10: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/10.jpg)
References
o Filipek, Bartlomiej. “Examples of Parallel Algorithms From C++17.” Bartek's Coding Blog, 25 June 2018
o Stellar Group. “HPX Documentations.” HPX 1.2.0, 2011, stellar-group.github.io/hpx/docs/html/hpx.html.
![Page 11: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/11.jpg)
Acknowledgement
o Work supported by the National Science Foundation (NSF) award #ACI-1560410.
o A special thanks To Adrian Serio & the rest of the Stellar Group team.
![Page 12: Comparing the Performance of C++ Parallel Algorithms With ...reu.cct.lsu.edu/documents/2018-presentations/Beldunord.pdf · o HPX is a general purpose C++ runtime system for parallel](https://reader034.fdocuments.us/reader034/viewer/2022042221/5ec7f0ec818b43225b3ee808/html5/thumbnails/12.jpg)
Questions?