<div dir="ltr">Does anyone have a deeper understanding of vtkSortDataArray?<div><br></div><div>Not only does it use std::sort, but qsort, and even bubble sort make a guest appearance in the Cxx file. I'd like to replace everything with a vtkSMPTools::Sort(). (Utkarsh says this is worth parallelizing for ParaView). It may that the comparison operation when using the tuple components as a key is the difficulty if used with std::sort but I'm not sure.</div><div><br>W</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 5, 2015 at 11:29 AM, Will Schroeder <span dir="ltr"><<a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">FYI- As some of you know we have been inserting shared memory parallel constructs via <a href="http://www.kitware.com/blog/home/post/915" target="_blank">vtkSMPTools into VTK</a>. Recently we added a new capability, vtkSMPTools::Sort(), that is a drop in replacement for std::sort. For large data with multi-core machines this can have a significant performance impact, and I am thinking about broadening the reach of vtkSMPTools::Sort() by replacing std::sort wherever it makes sense in VTK. There is a modest length list of classes that currently use std::sort (see the list below). I plan on doing this slowly over the next several months.<div><br></div><div>Does anyone have a problem with this? I know some of the sorts are performed on relatively short containers and I'm sure it's not really worth the effort (so I will probably skip them). Any other comments or concerns?</div><div><br>W</div><div><br></div><div>PS- Note: parallel sorting really only works with VTK_SMP_IMPLEMENTATION_TYPE=TBB. We plan on adding an OpenMP version soon. Otherwise the fallback for Sequential, etc. is simply std::sort.<br clear="all"><div><br></div>-- <br><div><div>./Charts/Core/vtkChartXY.cxx</div><div>./Charts/Core/vtkPlotArea.cxx</div><div>./Charts/Core/vtkPlotBag.cxx</div><div>./Charts/Core/vtkPlotBar.cxx</div><div>./Charts/Core/vtkPlotBox.cxx</div><div>./Charts/Core/vtkPlotPoints.cxx</div><div>./Charts/Core/vtkPlotStacked.cxx</div><div>./Common/Core/Testing/Cxx/TestArrayLookup.cxx</div><div>./Common/Core/Testing/Cxx/TestAtomic.cxx</div><div>./Common/Core/vtkSortDataArray.cxx</div><div>./Common/Core/vtkStringArray.cxx</div><div>./Common/DataModel/Testing/Cxx/TestDataArrayDispatcher.cxx</div><div>./Common/DataModel/Testing/Cxx/TestDispatchers.cxx</div><div>./Common/DataModel/vtkGraph.cxx</div><div>./Common/DataModel/vtkKdTree.cxx</div><div>./Common/DataModel/vtkPiecewiseFunction.cxx</div><div>./Common/DataModel/vtkReebGraph.cxx</div><div>./Common/DataModel/vtkSelectionNode.cxx</div><div>./Common/ExecutionModel/vtkSpanSpace.cxx</div><div>./Filters/AMR/vtkAMRCutPlane.cxx</div><div>./Filters/AMR/vtkAMRResampleFilter.cxx</div><div>./Filters/Extraction/vtkConvertSelection.cxx</div><div>./Filters/FlowPaths/vtkModifiedBSPTree.cxx</div><div>./Filters/FlowPaths/vtkStreaklineFilter.cxx</div><div>./Filters/General/vtkContourTriangulator.cxx</div><div>./Filters/General/vtkYoungsMaterialInterface.cxx</div><div>./Filters/Matlab/vtkMatlabMexAdapter.cxx</div><div>./Filters/Parallel/vtkExtractCTHPart.cxx</div><div>./Filters/ParallelGeometry/vtkPUnstructuredGridConnectivity.cxx</div><div>./Filters/ReebGraph/vtkReebGraphToJoinSplitTreeFilter.cxx</div><div>./Filters/Statistics/vtkExtractFunctionalBagPlot.cxx</div><div>./Imaging/Core/vtkImageStencilData.cxx</div><div>./Imaging/General/vtkImageHybridMedian2D.cxx</div><div>./Infovis/BoostGraphAlgorithms/vtkBoostExtractLargestComponent.cxx</div><div>./Infovis/Core/vtkNetworkHierarchy.cxx</div><div>./Infovis/Core/vtkReduceTable.cxx</div><div>./Infovis/Layout/vtkCosmicTreeLayoutStrategy.cxx</div><div>./Infovis/Parallel/Testing/Cxx/PBGLRandomGraph.cxx</div><div>./Interaction/Widgets/vtkClosedSurfacePointPlacer.cxx</div><div>./IO/Core/vtkGlobFileNames.cxx</div><div>./IO/Core/vtkSortFileNames.cxx</div><div>./IO/EnSight/vtkEnSightReader.cxx</div><div>./IO/Xdmf2/vtkXdmfWriter.cxx</div><div>./Parallel/Core/vtkSubGroup.cxx</div><div>./Rendering/Core/vtkColorTransferFunction.cxx</div><div>./Web/WebGLExporter/vtkWebGLExporter.cxx</div></div>
</div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">William J. Schroeder, PhD<br>Kitware, Inc.<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>(518) 881-4902</div>
</div>