Difference between revisions of "GPU621/Fighting Mongooses"

From CDOT Wiki
Jump to: navigation, search
(Group Members)
(Tags: Mobile edit, Mobile web edit)
(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====
+
'''Serial'''
  
 +
[[File:SortSerial.png]]
  
====TBB====
+
'''TBB'''
  
 +
[[File:SortTBB.png]]
  
====STL====
+
'''STL'''
  
 +
[[File:SortSTL.png]]
  
===Results===
+
'''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 22:17, 30 November 2016

Fighting Mongooses

Group Members

  1. Mike Doherty, Everything.
  2. Kyle Klerks, Everything.

Entry on: October 31st 2016

Group page (Fighting Mongooses) has been created suggested project topic is being considered

  1. - 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

SortSerial.png

TBB

SortTBB.png

STL

SortSTL.png

Results

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.

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.