Repository navigation
ENH: Add support for ITK SingleMultiThreader - #2590
Merged
blowekamp merged 1 commit intoMay 19, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SimpleITK-level support and verification for the new ITK itk::SingleMultiThreader (“SINGLE”) global default threader option, while also correcting an existing guard bug around the “TBB” threader selection.
Changes:
- Document
"SINGLE"as a validProcessObject::SetGlobalDefaultThreaderoption. - Fix
SetGlobalDefaultThreadervalidation to correctly rejectTBBwhenITK_USE_TBBis not enabled. - Add C++ and Python tests intended to validate
"SINGLE"behavior when available.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Wrapping/Python/tests/sitkFlatStaticMethod.py |
Adds a runtime check for setting "SINGLE" via flat static methods. |
Testing/Unit/sitkCommonTests.cxx |
Adds conditional unit test coverage for "SINGLE" (supported vs unsupported builds). |
Testing/Unit/CMakeLists.txt |
Adds configure-time detection for itkSingleMultiThreader.h and conditionally defines a compile macro for the unit test. |
Code/Common/src/sitkProcessObject.cxx |
Fixes the non-TBB build guard to check ThreaderEnum::TBB (instead of redundantly checking Unknown). |
Code/Common/include/sitkProcessObject.h |
Updates API documentation to include "SINGLE" / itk::SingleMultiThreader. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+116
to
+120
| include(CheckIncludeFileCXX) | ||
| check_include_file_cxx( | ||
| "itkSingleMultiThreader.h" | ||
| SITK_ITK_HAS_SINGLE_THREADER | ||
| ) |
| * - "POOL" itk::PoolMultiThreader | ||
| * - "TBB" itk::TBBThreader (optional) | ||
| * - "PLATFORM" itk::PlatformMultiThreader | ||
| * - "SINGLE" itk::SingleMultiThreader |
Add support for the "SINGLE" multi-threader option introduced in ITK PR #6222. The SingleMultiThreader executes all work synchronously on the calling thread with zero thread-pool overhead, useful for application-level parallelism scenarios. Changes: - Update SetGlobalDefaultThreader documentation to list "SINGLE" - Fix existing bug: TBB guard was checking Unknown instead of TBB - Add conditional test for Single threader in sitkCommonTests - Add runtime check in Python flat static method test
blowekamp
force-pushed
the
add-single-multithreader-support
branch
from
May 15, 2026 17:35
e6f7d78 to
27c920a
Compare
dave3d
approved these changes
May 19, 2026
zivy
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for the new
itk::SingleMultiThreaderintroduced in ITK PR #6222.Changes
sitkProcessObject.h— UpdatedSetGlobalDefaultThreaderdocumentation to list"SINGLE"as an available threader option.sitkProcessObject.cxx— Fixed pre-existing bug inSetGlobalDefaultThreaderwhere the#if !defined(ITK_USE_TBB)guard was checkingThreaderEnum::Unknowninstead ofThreaderEnum::TBB. No additional guard is needed for"SINGLE"sinceThreaderTypeFromStringon older ITK returnsUnknownfor unrecognized strings.Testing/Unit/CMakeLists.txt— Addedcheck_include_file_cxxdetection foritkSingleMultiThreader.hand passesSITK_ITK_HAS_SINGLE_THREADERas a compile definition tositkCommonTests.cxx.Testing/Unit/sitkCommonTests.cxx— Added conditional test verifyingSetGlobalDefaultThreader("SINGLE")works when available, or returnsfalsewhen not.Wrapping/Python/tests/sitkFlatStaticMethod.py— Added runtime test for"SINGLE"threader viaSetGlobalDefaultThreader.Notes
When built against an ITK with
SingleMultiThreader, users can select it via:or the environment variable
ITK_GLOBAL_DEFAULT_THREADER=Single.