[arch-commits] Commit in paraview/trunk (3 files)
Bruno Pagani
archange at gemini.archlinux.org
Wed Mar 23 13:32:26 UTC 2022
Date: Wednesday, March 23, 2022 @ 13:32:25
Author: archange
Revision: 1171347
upgpkg: paraview 5.10.1-1
Added:
paraview/trunk/revert-smp-info.patch
Modified:
paraview/trunk/PKGBUILD
Deleted:
paraview/trunk/vtk-tbb-2021.patch
-----------------------+
PKGBUILD | 57 +++-----
revert-smp-info.patch | 172 +++++++++++++++++++++++++
vtk-tbb-2021.patch | 329 ------------------------------------------------
3 files changed, 197 insertions(+), 361 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-03-23 13:01:10 UTC (rev 1171346)
+++ PKGBUILD 2022-03-23 13:32:25 UTC (rev 1171347)
@@ -7,40 +7,37 @@
_mpi=openmpi
pkgname=${_pkg}
#-${_mpi}
-pkgver=5.9.1
-pkgrel=15
+pkgver=5.10.1
+pkgrel=1
pkgdesc="Parallel Visualization application using VTK (${_mpi} version)"
arch=(x86_64)
url="https://www.paraview.org"
license=(BSD custom)
-depends=(boost-libs qt5-tools qt5-x11extras qt5-svg intel-tbb openmpi ffmpeg
- adios2 liblas ospray pdal python-numpy cgns protobuf
- double-conversion expat freetype2 gdal gl2ps glew hdf5 libjpeg jsoncpp
- libjsoncpp.so libharu libxml2 lz4 xz python-mpi4py netcdf libogg
- libpng pugixml rapidjson libtheora libtiff zlib)
+depends=(boost-libs qt5-tools qt5-svg intel-tbb openmpi ffmpeg
+ adios2 liblas ospray pdal python-numpy protobuf
+ cgns double-conversion expat freetype2 gdal gl2ps glew hdf5 libjpeg
+ jsoncpp libjsoncpp.so libharu libxml2 lz4 xz python-mpi4py netcdf
+ libogg libpng pugixml libtheora libtiff zlib)
optdepends=(python-matplotlib python-pandas)
-makedepends=(cmake boost mesa gcc-fortran ninja qt5-tools qt5-xmlpatterns eigen utf8cpp)
-# pegtl https://gitlab.kitware.com/vtk/vtk/-/issues/18151
+makedepends=(cmake boost mesa gcc-fortran ninja qt5-xmlpatterns cli11 eigen utf8cpp)
+# pegtl: https://gitlab.kitware.com/vtk/vtk/-/issues/18151
+# rapidjson: https://gitlab.kitware.com/vtk/vtk/-/issues/18366
+# fmt: https://gitlab.kitware.com/paraview/paraview/-/issues/21315
+# catalyst, exprtk, ioss: not packaged
source=(${url}/files/v${pkgver%.*}/ParaView-v${pkgver/R/-R}.tar.xz
paraview-wrapper.sh
paraview.sh
pvpython.sh
- vtk-gcc11.patch::https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7554.patch
- vtk-fix-shader-initialization.patch::https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7978.patch
- vtk-tbb-2021.patch
- vtkm-tbb-2021-pre.patch::https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/2452.patch
vtkm-tbb-2021.patch::https://gitlab.kitware.com/vtk/vtk-m/-/merge_requests/2509.patch
- vtk-ffmpeg5.patch::https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8863.patch)
-sha256sums=('0d486cb6fbf55e428845c9650486f87466efcb3155e40489182a7ea85dfd4c8d'
+ vtk-ffmpeg5.patch::https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8863.patch
+ revert-smp-info.patch) # Derived from https://gitlab.kitware.com/paraview/paraview/-/merge_requests/5131
+sha256sums=('520e3cdfba4f8592be477314c2f6c37ec73fb1d5b25ac30bdbd1c5214758b9c2'
'05bd6268b3a6dddfcdbc106a3414d0aa9663ae48ce4775fdd9f5ed02c1bbae02'
'e81fa887b484d98fd0df3b13e9ba19f57e50131c173ea126265cec0b529dd3f5'
'0f3557fd21de013628826c2c971a48564dca63cbf943c76a6f7021a9a84e6223'
- 'c9959adcb59e2f2657f0144b0b68239d4174947fb2ab8051f2575241281e4d68'
- '10864f69e2d6577c56cc536438b5dd7a52b004f6bb253a17569899922d804fe8'
- '5e621ed053ae6e27fea32c09ff64a700684983703d2361c658e1701b0b413189'
- '39a84440097147338fcfcc937a2efed4ff887e83c2040d43abb97f5532bdb2fc'
'37cff664c4eaacf44ecb995e62e9e54e54880bae0857d598c74660a2159ccb2e'
- '066ad5eb3f7cd101c4bbbe4d91ba97419f18537f9dadf6654776b7151c7c6a8d')
+ '066ad5eb3f7cd101c4bbbe4d91ba97419f18537f9dadf6654776b7151c7c6a8d'
+ 'fb7496032d3e9fc8575b533127b5d93c7a2d0a1a2c2abad859f4f40ea06e55c7')
prepare() {
# Specify python version in wrapper
@@ -51,23 +48,13 @@
# We have a patched libharu
sed -i "s|2.4.0|2.3.0|" VTK/ThirdParty/libharu/CMakeLists.txt
# Fix licences install (upstreamed but not released)
- sed -i 's|CACHE PATH "License|CACHE STRING "License|g' CMakeLists.txt
sed -i 's|CACHE PATH "License|CACHE STRING "License|g' VTK/CMakeLists.txt
- # Missing includes with GCC11
- patch -p1 -d VTK < ../vtk-gcc11.patch
- # FS#71081
- patch -p1 -d VTK < ../vtk-fix-shader-initialization.patch
- # Fix build with HDF5 1.12.1, https://gitlab.kitware.com/vtk/vtk/-/issues/18265
- sed -i 's/typedef int hid_t;/typedef int64_t hid_t;/' VTK/ThirdParty/xdmf3/vtkxdmf3/core/XdmfHDF5Controller.hpp
# Fix build with TBB 2021
- # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7650
- # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7765
- # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8011
- patch -p1 -d VTK < ../vtk-tbb-2021.patch
- patch -p1 -d VTK/ThirdParty/vtkm/vtkvtkm/vtk-m < ../vtkm-tbb-2021-pre.patch
patch -p1 -d VTK/ThirdParty/vtkm/vtkvtkm/vtk-m < ../vtkm-tbb-2021.patch
# Fix build with FFmpeg 5
patch -p1 -d VTK < ../vtk-ffmpeg5.patch
+ # https://gitlab.kitware.com/paraview/paraview/-/issues/21323
+ patch -p1 -R < ../revert-smp-info.patch
}
build() {
@@ -94,6 +81,12 @@
-DPARAVIEW_BUILD_WITH_EXTERNAL=ON \
-DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
-DVTKm_ENABLE_MPI=ON \
+ -DCATALYST_USE_MPI=ON \
+ -DFIDES_USE_EXTERNAL_RAPIDJSON=OFF \
+ -DVTK_MODULE_USE_EXTERNAL_ParaView_vtkcatalyst=OFF \
+ -DVTK_MODULE_USE_EXTERNAL_VTK_exprtk=OFF \
+ -DVTK_MODULE_USE_EXTERNAL_VTK_fmt=OFF \
+ -DVTK_MODULE_USE_EXTERNAL_VTK_ioss=OFF \
-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=OFF \
-Wno-dev
ninja -C build ${MAKEFLAGS}
Added: revert-smp-info.patch
===================================================================
--- revert-smp-info.patch (rev 0)
+++ revert-smp-info.patch 2022-03-23 13:32:25 UTC (rev 1171347)
@@ -0,0 +1,172 @@
+From 2f378aea29c406a41d9cb4f8cda5c165efd969ad Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timoth=C3=A9e=20Couble?= <timothee.couble at kitware.com>
+Date: Mon, 23 Aug 2021 10:41:48 +0200
+Subject: [PATCH] Add SMP backend information in about dialog
+
+Add in about dialog:
+- SMP Tools backend in use
+- SMP max number of thread
+
+Fix #20894
+---
+ .../release/dev/AddSMPInfoAboutDialog.md | 5 ++++
+ Qt/Components/pqAboutDialog.cxx | 7 ++++++
+ Remoting/Core/vtkPVServerInformation.cxx | 23 +++++++++++++++++++
+ Remoting/Core/vtkPVServerInformation.h | 18 +++++++++++++++
+ 4 files changed, 53 insertions(+)
+ create mode 100644 Documentation/release/dev/AddSMPInfoAboutDialog.md
+
+diff --git a/Qt/Components/pqAboutDialog.cxx b/Qt/Components/pqAboutDialog.cxx
+index 623d1ceee8..2d0003da15 100644
+--- a/Qt/Components/pqAboutDialog.cxx
++++ b/Qt/Components/pqAboutDialog.cxx
+@@ -49,6 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #include "vtkPVServerInformation.h"
+ #include "vtkProcessModule.h"
+ #include "vtkRemotingCoreConfiguration.h"
++#include "vtkSMPTools.h"
+ #include "vtkSMProxyManager.h"
+ #include "vtkSMSession.h"
+ #include "vtkSMViewProxy.h"
+@@ -164,6 +165,9 @@ void pqAboutDialog::AddClientInformation()
+ ::addItem(tree, "Test Directory", QString::fromStdString(pqConfig->testDirectory()));
+ ::addItem(tree, "Data Directory", QString::fromStdString(pqConfig->dataDirectory()));
+
++ ::addItem(tree, "SMP Backend", vtkSMPTools::GetBackend());
++ ::addItem(tree, "SMP Max Number of Threads", vtkSMPTools::GetEstimatedNumberOfThreads());
++
+ // For local OpenGL info, we ask Qt, as that's more truthful anyways.
+ QOpenGLContext* ctx = QOpenGLContext::currentContext();
+ if (QOpenGLFunctions* f = ctx ? ctx->functions() : nullptr)
+@@ -226,6 +230,9 @@ void pqAboutDialog::AddServerInformation(pqServer* server, QTreeWidget* tree)
+
+ ::addItem(tree, "vtkIdType size", QString("%1bits").arg(serverInfo->GetIdTypeSize()));
+
++ ::addItem(tree, "SMP Backend", serverInfo->GetSMPBackendName().c_str());
++ ::addItem(tree, "SMP Max Number of Threads", serverInfo->GetSMPMaxNumberOfThreads());
++
+ vtkSMSession* session = server->session();
+ vtkNew<vtkPVPythonInformation> pythonInfo;
+ session->GatherInformation(vtkPVSession::SERVERS, pythonInfo.GetPointer(), 0);
+diff --git a/Remoting/Core/vtkPVServerInformation.cxx b/Remoting/Core/vtkPVServerInformation.cxx
+index e7f4071a16..aa6c14d488 100644
+--- a/Remoting/Core/vtkPVServerInformation.cxx
++++ b/Remoting/Core/vtkPVServerInformation.cxx
+@@ -24,6 +24,7 @@
+ #include "vtkPVSession.h"
+ #include "vtkProcessModule.h"
+ #include "vtkRemotingCoreConfiguration.h"
++#include "vtkSMPTools.h"
+ #if VTK_MODULE_ENABLE_ParaView_nvpipe
+ #include <nvpipe.h>
+ #endif
+@@ -97,6 +98,9 @@ vtkPVServerInformation::vtkPVServerInformation()
+ this->IsInTileDisplay = false;
+ this->IsInCave = false;
+ this->TileDimensions[0] = this->TileDimensions[1] = 0;
++
++ this->SMPBackendName = vtkSMPTools::GetBackend() ? vtkSMPTools::GetBackend() : "";
++ this->SMPMaxNumberOfThreads = vtkSMPTools::GetEstimatedNumberOfThreads();
+ }
+
+ //----------------------------------------------------------------------------
+@@ -121,6 +125,8 @@ void vtkPVServerInformation::PrintSelf(ostream& os, vtkIndent indent)
+ os << indent << "IsInCave: " << this->IsInCave << endl;
+ os << indent << "TileDimensions: " << this->TileDimensions[0] << ", " << this->TileDimensions[1]
+ << endl;
++ os << indent << "SMPBackendName: " << this->SMPBackendName << endl;
++ os << indent << "SMPMaxNumberOfThreads: " << this->SMPMaxNumberOfThreads << endl;
+ }
+
+ //----------------------------------------------------------------------------
+@@ -138,6 +144,8 @@ void vtkPVServerInformation::DeepCopy(vtkPVServerInformation* info)
+ this->IsInTileDisplay = info->GetIsInTileDisplay();
+ this->IsInCave = info->GetIsInCave();
+ info->GetTileDimensions(this->TileDimensions);
++ this->SMPBackendName = info->GetSMPBackendName();
++ this->SMPMaxNumberOfThreads = info->GetSMPMaxNumberOfThreads();
+ }
+
+ //----------------------------------------------------------------------------
+@@ -219,6 +227,8 @@ void vtkPVServerInformation::AddInformation(vtkPVInformation* info)
+ {
+ this->ClientId = serverInfo->ClientId;
+ }
++ this->SMPBackendName = serverInfo->GetSMPBackendName();
++ this->SMPMaxNumberOfThreads = serverInfo->GetSMPMaxNumberOfThreads();
+ this->SetIdTypeSize(serverInfo->GetIdTypeSize());
+ }
+ }
+@@ -242,6 +252,8 @@ void vtkPVServerInformation::CopyToStream(vtkClientServerStream* css)
+ *css << this->IsInTileDisplay;
+ *css << this->IsInCave;
+ *css << this->TileDimensions[0] << this->TileDimensions[1];
++ *css << this->SMPBackendName;
++ *css << this->SMPMaxNumberOfThreads;
+ *css << vtkClientServerStream::End;
+ }
+
+@@ -329,6 +341,17 @@ void vtkPVServerInformation::CopyFromStream(const vtkClientServerStream* css)
+ vtkErrorMacro("Error parsing TileDimensions from message.");
+ return;
+ }
++
++ if (!css->GetArgument(0, idx++, &this->SMPBackendName))
++ {
++ vtkErrorMacro("Error parsing SMPBackendName from message.");
++ return;
++ }
++ if (!css->GetArgument(0, idx++, &this->SMPMaxNumberOfThreads))
++ {
++ vtkErrorMacro("Error parsing SMPMaxNumberOfThreads from message.");
++ return;
++ }
+ }
+
+ //----------------------------------------------------------------------------
+diff --git a/Remoting/Core/vtkPVServerInformation.h b/Remoting/Core/vtkPVServerInformation.h
+index fd12529cfe..7f2f1fe085 100644
+--- a/Remoting/Core/vtkPVServerInformation.h
++++ b/Remoting/Core/vtkPVServerInformation.h
+@@ -24,6 +24,8 @@
+ #ifndef vtkPVServerInformation_h
+ #define vtkPVServerInformation_h
+
++#include <string>
++
+ #include "vtkPVInformation.h"
+ #include "vtkRemotingCoreModule.h" //needed for exports
+
+@@ -140,6 +142,20 @@ public:
+ vtkGetMacro(IdTypeSize, int);
+ //@}
+
++ //@{
++ /**
++ * Get the SMP Tools backend name of the server.
++ */
++ vtkGetMacro(SMPBackendName, std::string);
++ //@}
++
++ //@{
++ /**
++ * Get the max number of threads of the server.
++ */
++ vtkGetMacro(SMPMaxNumberOfThreads, int);
++ //@}
++
+ protected:
+ vtkPVServerInformation();
+ ~vtkPVServerInformation() override;
+@@ -158,6 +174,8 @@ protected:
+ bool IsInTileDisplay;
+ bool IsInCave;
+ int TileDimensions[2];
++ std::string SMPBackendName;
++ int SMPMaxNumberOfThreads;
+
+ private:
+ vtkPVServerInformation(const vtkPVServerInformation&) = delete;
+--
+GitLab
+
Deleted: vtk-tbb-2021.patch
===================================================================
--- vtk-tbb-2021.patch 2022-03-23 13:01:10 UTC (rev 1171346)
+++ vtk-tbb-2021.patch 2022-03-23 13:32:25 UTC (rev 1171347)
@@ -1,329 +0,0 @@
-From 172e85feaf7cd36533012d66fb12a8942888d61d Mon Sep 17 00:00:00 2001
-From: Ben Boeckel <ben.boeckel at kitware.com>
-Date: Fri, 19 Feb 2021 12:41:29 -0500
-Subject: [PATCH] FindTBB: chain off to TBBConfig if available
-
-Fixes: #18112
----
- CMake/FindTBB.cmake | 26 ++++++++++++++++++++++++++
- 1 file changed, 26 insertions(+)
-
-diff --git a/CMake/FindTBB.cmake b/CMake/FindTBB.cmake
-index 27576a5cc8b..5ba89d52fb9 100644
---- a/CMake/FindTBB.cmake
-+++ b/CMake/FindTBB.cmake
-@@ -68,6 +68,32 @@
- # FindTBB helper functions and macros
- #
-
-+# Use TBBConfig.cmake if possible.
-+
-+set(_tbb_find_quiet)
-+if (TBB_FIND_QUIETLY)
-+ set(_tbb_find_quiet QUIET)
-+endif ()
-+set(_tbb_find_components)
-+set(_tbb_find_optional_components)
-+foreach (_tbb_find_component IN LISTS TBB_FIND_COMPONENTS)
-+ if (TBB_FIND_REQUIRED_${_tbb_find_component})
-+ list(APPEND _tbb_find_components "${_tbb_find_component}")
-+ else ()
-+ list(APPEND _tbb_find_optional_components "${_tbb_find_component}")
-+ endif ()
-+endforeach ()
-+unset(_tbb_find_component)
-+find_package(TBB CONFIG ${_tbb_find_quiet}
-+ COMPONENTS ${_tbb_find_components}
-+ OPTIONAL_COMPONENTS ${_tbb_find_optional_components})
-+unset(_tbb_find_quiet)
-+unset(_tbb_find_components)
-+unset(_tbb_find_optional_components)
-+if (TBB_FOUND)
-+ return ()
-+endif ()
-+
- #====================================================
- # Fix the library path in case it is a linker script
- #====================================================
---
-GitLab
-
-From 56cf03534c58a21f3cea608e4f53b7e7e00670fc Mon Sep 17 00:00:00 2001
-From: Mickael PHILIT <mickey.phy at gmail.com>
-Date: Thu, 27 May 2021 04:32:51 +0000
-Subject: [PATCH 1/2] Update TBB version file location
-
-From ded89c1e3a025874bfd69feb6c67fa21d6af36d4 Mon Sep 17 00:00:00 2001
-From: Mickael PHILIT <mickey.phy at gmail.com>
-Date: Thu, 27 May 2021 04:44:42 +0000
-Subject: [PATCH 2/2] add missing {
-
----
- CMake/FindTBB.cmake | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/CMake/FindTBB.cmake b/CMake/FindTBB.cmake
-index 5ba89d52fb9..bd756313176 100644
---- a/CMake/FindTBB.cmake
-+++ b/CMake/FindTBB.cmake
-@@ -424,12 +424,18 @@ findpkg_finish(TBB_MALLOC_PROXY tbbmalloc_proxy)
- #=============================================================================
- #parse all the version numbers from tbb
- if(NOT TBB_VERSION)
--
-- #only read the start of the file
-- file(STRINGS
-+ if (EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h")
-+ file(STRINGS
-+ "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h"
-+ TBB_VERSION_CONTENTS
-+ REGEX "VERSION")
-+ else()
-+ #only read the start of the file
-+ file(STRINGS
- "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h"
- TBB_VERSION_CONTENTS
- REGEX "VERSION")
-+ endif()
-
- string(REGEX REPLACE
- ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
---
-GitLab
-
-From 3e5313e71c35aaeabfd4e65e090031716460d35e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Timoth=C3=A9e=20Couble?= <timothee.couble at kitware.com>
-Date: Thu, 18 Mar 2021 16:43:47 +0100
-Subject: [PATCH] Replace task_scheduler_init with task_arena
-
-And update Initialize documentation
----
- Common/Core/SMP/TBB/vtkSMPTools.cxx | 47 ++++++++-------
- Common/Core/SMP/TBB/vtkSMPToolsInternal.h.in | 62 ++++++++++++--------
- Common/Core/vtkSMPTools.h | 7 +--
- 3 files changed, 65 insertions(+), 51 deletions(-)
-
-diff --git a/Common/Core/SMP/TBB/vtkSMPTools.cxx b/Common/Core/SMP/TBB/vtkSMPTools.cxx
-index c3f45fa4888..596aedbb963 100644
---- a/Common/Core/SMP/TBB/vtkSMPTools.cxx
-+++ b/Common/Core/SMP/TBB/vtkSMPTools.cxx
-@@ -24,24 +24,13 @@
- #define __TBB_NO_IMPLICIT_LINKAGE 1
- #endif
-
--#include <tbb/task_scheduler_init.h>
-+#include <tbb/task_arena.h>
-
- #ifdef _MSC_VER
- #pragma pop_macro("__TBB_NO_IMPLICIT_LINKAGE")
- #endif
-
--struct vtkSMPToolsInit
--{
-- tbb::task_scheduler_init Init;
--
-- vtkSMPToolsInit(int numThreads)
-- : Init(numThreads)
-- {
-- }
--};
--
--static bool vtkSMPToolsInitialized = 0;
--static int vtkTBBNumSpecifiedThreads = 0;
-+static tbb::task_arena taskArena;
- static vtkSimpleCriticalSection vtkSMPToolsCS;
-
- //------------------------------------------------------------------------------
-@@ -54,23 +43,37 @@ const char* vtkSMPTools::GetBackend()
- void vtkSMPTools::Initialize(int numThreads)
- {
- vtkSMPToolsCS.Lock();
-- if (!vtkSMPToolsInitialized)
-+
-+ // If numThreads <= 0, don't create a task_arena
-+ // and let TBB do the default thing.
-+ if (numThreads > 0 && numThreads != taskArena.max_concurrency())
- {
-- // If numThreads <= 0, don't create a task_scheduler_init
-- // and let TBB do the default thing.
-- if (numThreads > 0)
-+ if (taskArena.is_active())
- {
-- static vtkSMPToolsInit aInit(numThreads);
-- vtkTBBNumSpecifiedThreads = numThreads;
-+ taskArena.terminate();
- }
-- vtkSMPToolsInitialized = true;
-+ taskArena.initialize(numThreads);
- }
-+
- vtkSMPToolsCS.Unlock();
- }
-
- //------------------------------------------------------------------------------
- int vtkSMPTools::GetEstimatedNumberOfThreads()
- {
-- return vtkTBBNumSpecifiedThreads ? vtkTBBNumSpecifiedThreads
-- : tbb::task_scheduler_init::default_num_threads();
-+ return taskArena.max_concurrency();
-+}
-+
-+//------------------------------------------------------------------------------
-+void vtk::detail::smp::vtkSMPTools_Impl_For_TBB(vtkIdType first, vtkIdType last, vtkIdType grain,
-+ ExecuteFunctorPtrType functorExecuter, void* functor)
-+{
-+ if (taskArena.is_active())
-+ {
-+ taskArena.execute([&] { functorExecuter(functor, first, last, grain); });
-+ }
-+ else
-+ {
-+ functorExecuter(functor, first, last, grain);
-+ }
- }
-diff --git a/Common/Core/SMP/TBB/vtkSMPToolsInternal.h.in b/Common/Core/SMP/TBB/vtkSMPToolsInternal.h.in
-index c6614e42a4a..1c7253deeec 100644
---- a/Common/Core/SMP/TBB/vtkSMPToolsInternal.h.in
-+++ b/Common/Core/SMP/TBB/vtkSMPToolsInternal.h.in
-@@ -12,7 +12,8 @@
- PURPOSE. See the above copyright notice for more information.
-
- =========================================================================*/
--#include "vtkNew.h"
-+
-+#include "vtkCommonCoreModule.h" // For export macro
-
- #ifdef _MSC_VER
- # pragma push_macro("__TBB_NO_IMPLICIT_LINKAGE")
-@@ -34,6 +35,10 @@ namespace detail
- namespace smp
- {
-
-+typedef void (*ExecuteFunctorPtrType)(void*, vtkIdType, vtkIdType, vtkIdType);
-+void VTKCOMMONCORE_EXPORT vtkSMPTools_Impl_For_TBB(vtkIdType first, vtkIdType last, vtkIdType grain,
-+ ExecuteFunctorPtrType functorExecuter, void* functor);
-+
- //--------------------------------------------------------------------------------
- template <typename T>
- class FuncCall
-@@ -43,22 +48,22 @@ class FuncCall
- void operator=(const FuncCall&) = delete;
-
- public:
-- void operator() (const tbb::blocked_range<vtkIdType>& r) const
-- {
-- o.Execute(r.begin(), r.end());
-+ void operator()(const tbb::blocked_range<vtkIdType>& r) const {
-+ o.Execute(r.begin(), r.end());
- }
-
-- FuncCall (T& _o) : o(_o)
-+ FuncCall(T& _o)
-+ : o(_o)
- {
- }
- };
-
- //--------------------------------------------------------------------------------
- template <typename FunctorInternal>
--void vtkSMPTools_Impl_For(
-- vtkIdType first, vtkIdType last, vtkIdType grain,
-- FunctorInternal& fi)
-+void ExecuteFunctor(void* functor, vtkIdType first, vtkIdType last, vtkIdType grain)
- {
-+ FunctorInternal& fi = *reinterpret_cast<FunctorInternal*>(functor);
-+
- vtkIdType range = last - first;
- if (range <= 0)
- {
-@@ -66,20 +71,26 @@ void vtkSMPTools_Impl_For(
- }
- if (grain > 0)
- {
-- tbb::parallel_for(tbb::blocked_range<vtkIdType>(first, last, grain), FuncCall<FunctorInternal>(fi));
-+ tbb::parallel_for(
-+ tbb::blocked_range<vtkIdType>(first, last, grain), FuncCall<FunctorInternal>(fi));
- }
- else
- {
- // When the grain is not specified, automatically calculate an appropriate grain size so
- // most of the time will still be spent running the calculation and not task overhead.
-- const vtkIdType numberThreadsEstimate = 40; // Estimate of how many threads we might be able to run
-- const vtkIdType batchesPerThread = 5; // Plan for a few batches per thread so one busy core doesn't stall the whole system
-+
-+ // Estimate of how many threads we might be able to run
-+ const vtkIdType numberThreadsEstimate = 40;
-+ // Plan for a few batches per thread so one busy core doesn't stall the whole system
-+ const vtkIdType batchesPerThread = 5;
- const vtkIdType batches = numberThreadsEstimate * batchesPerThread;
-
- if (range >= batches)
- {
-- vtkIdType calculatedGrain = ((range - 1) / batches) + 1; // std::ceil round up for systems without cmath
-- tbb::parallel_for(tbb::blocked_range<vtkIdType>(first, last, calculatedGrain), FuncCall<FunctorInternal>(fi));
-+ // std::ceil round up for systems without cmath
-+ vtkIdType calculatedGrain = ((range - 1) / batches) + 1;
-+ tbb::parallel_for(
-+ tbb::blocked_range<vtkIdType>(first, last, calculatedGrain), FuncCall<FunctorInternal>(fi));
- }
- else
- {
-@@ -91,23 +102,26 @@ void vtkSMPTools_Impl_For(
- }
-
- //--------------------------------------------------------------------------------
--template<typename RandomAccessIterator>
--void vtkSMPTools_Impl_Sort(RandomAccessIterator begin,
-- RandomAccessIterator end)
-+template <typename FunctorInternal>
-+void vtkSMPTools_Impl_For(vtkIdType first, vtkIdType last, vtkIdType grain, FunctorInternal& fi)
-+{
-+ vtkSMPTools_Impl_For_TBB(first, last, grain, ExecuteFunctor<FunctorInternal>, &fi);
-+}
-+
-+//--------------------------------------------------------------------------------
-+template <typename RandomAccessIterator>
-+void vtkSMPTools_Impl_Sort(RandomAccessIterator begin, RandomAccessIterator end)
- {
- tbb::parallel_sort(begin, end);
- }
-
- //--------------------------------------------------------------------------------
--template<typename RandomAccessIterator, typename Compare>
--void vtkSMPTools_Impl_Sort(RandomAccessIterator begin,
-- RandomAccessIterator end,
-- Compare comp)
-+template <typename RandomAccessIterator, typename Compare>
-+void vtkSMPTools_Impl_Sort(RandomAccessIterator begin, RandomAccessIterator end, Compare comp)
- {
- tbb::parallel_sort(begin, end, comp);
- }
-
--
--}//namespace smp
--}//namespace detail
--}//namespace vtk
-+} // namespace smp
-+} // namespace detail
-+} // namespace vtk
-diff --git a/Common/Core/vtkSMPTools.h b/Common/Core/vtkSMPTools.h
-index cee63ad6ec6..4fa28abd72a 100644
---- a/Common/Core/vtkSMPTools.h
-+++ b/Common/Core/vtkSMPTools.h
-@@ -228,11 +228,8 @@ public:
- * Initialize the underlying libraries for execution. This is
- * not required as it is automatically called before the first
- * execution of any parallel code. However, it can be used to
-- * control the maximum number of threads used when the back-end
-- * supports it (currently Simple and TBB only). Make sure to call
-- * it before any other parallel operation.
-- * When using Kaapi, use the KAAPI_CPUCOUNT env. variable to control
-- * the number of threads used in the thread pool.
-+ * control the maximum number of threads used. Make sure to call
-+ * it before the parallel operation.
- */
- static void Initialize(int numThreads = 0);
-
---
-GitLab
-
More information about the arch-commits
mailing list