Difference between revisions of "GPU621/Fighting Mongooses"
Kyle Klerks (talk | contribs) (→Group Members) (Tags: Mobile edit, Mobile web edit) |
Kyle Klerks (talk | contribs) (→Comparing STL/PPL to TBB: Sorting Algorithm) (Tags: Mobile edit, Mobile web edit) |
||
Line 19: | Line 19: | ||
Let’s compare a simple sorting algorithm between TBB and STL/PPL. | Let’s compare a simple sorting algorithm between TBB and STL/PPL. | ||
− | + | '''Serial''' | |
+ | [[File:SortSerial.png]] | ||
− | + | '''TBB''' | |
+ | [[File:SortTBB.png]] | ||
− | + | '''STL''' | |
+ | [[File:SortSTL.png]] | ||
− | + | '''Results''' | |
+ | [[File:ResultsTable.png]] | ||
The clear differentiation in the code is that TBB does not have to operate using random access iterators, while STL’s parallel solution to sorting (and serial solution) does. If TBB sort is run using a vector instead of a simple array, you will see more even times. | The clear differentiation in the code is that TBB does not have to operate using random access iterators, while STL’s parallel solution to sorting (and serial solution) does. If TBB sort is run using a vector instead of a simple array, you will see more even times. |
Revision as of 21:17, 30 November 2016
Fighting Mongooses
Group Members
- Mike Doherty, Everything.
- Kyle Klerks, Everything.
Entry on: October 31st 2016
Group page (Fighting Mongooses) has been created suggested project topic is being considered
- - C++11 STL Comparison to TBB
Once project topic is confirmed by Professor Chris Szalwinski), I will be able to proceed with topic research.
Entry on: November 30th 2016
Comparing STL/PPL to TBB: Sorting Algorithm
Let’s compare a simple sorting algorithm between TBB and STL/PPL.
Serial
TBB
STL
Results
The clear differentiation in the code is that TBB does not have to operate using random access iterators, while STL’s parallel solution to sorting (and serial solution) does. If TBB sort is run using a vector instead of a simple array, you will see more even times.
Conclusion; STL does not currently handle parallelization of simple tasks well, as evidenced by this sort function. Even with this code snippet to lower the workload;
if (i % 3 == 0) { backwardsList.push_back(N - i); } else { backwardsList.push_back(i); }
The times are largely the same for STL sorting.