InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

`TBBMultiThreader::SetNumberOfWorkUnits` ignores GlobalMaximumNumberOfThreads, OK?

Open
#6,362 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

The SetNumberOfWorkUnits member function of MultiThreaderBase does at https://github.com/InsightSoftwareConsortium/ITK/blob/c14ff0e61d3f37ff3c4d6619b404586cc055bc56/Modules/Core/Common/src/itkMultiThreaderBase.cxx#L259-L262

```cpp
m_NumberOfWorkUnits = std::clamp(numberOfWorkUnits, 1, m_PimplGlobals->m_GlobalMaximumNumberOfThreads);
```

However, SetNumberOfWorkUnits member function of TBBMultiThreader ignores GlobalMaximumNumberOfThreads, as it just does, at https://github.com/InsightSoftwareConsortium/ITK/blob/c14ff0e61d3f37ff3c4d6619b404586cc055bc56/Modules/Core/Common/src/itkTBBMultiThreader.cxx#L105-L108
```cpp
m_NumberOfWorkUnits = std::max(1u, numberOfWorkUnits);
```

Is that behavior difference intended? If so, why would TBBMultiThreader behave different than the other threaders, with respect to SetNumberOfWorkUnits?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.