elastix icon indicating copy to clipboard operation
elastix copied to clipboard

Does "-threads" option serve two purposes at the same time, correctly?

Open N-Dekker opened this issue 3 years ago • 0 comments
trafficstars

The "-threads" option is being used to specify the global maximum number of threads being used by the process (by calling itk::MultiThreaderBase::SetGlobalMaximumNumberOfThreads, as implemented by Stefan (@stefanklein), commit 1cf92cb33a8901c08f00ec707e3695a0aee4e815 (2007):

https://github.com/SuperElastix/elastix/blob/1cf92cb33a8901c08f00ec707e3695a0aee4e815/src/Core/Kernel/elxElastixMain.cxx#L593-L600

At the same time it is being used to specify the number of work units (formerly called "number of threads") of a metric, as implemented by Marius (@mstaring) commit 2fc2c495837f64416263fa7c5d1e2bc4e3e061fa (2013).

https://github.com/SuperElastix/elastix/blob/2fc2c495837f64416263fa7c5d1e2bc4e3e061fa/src/Core/ComponentBaseClasses/elxMetricBase.hxx#L127-L132

Does that work well together? Is the intention to just try to use the maximum number of threads for the metric? If so, shouldn't MetricBase just call itk::MultiThreaderBase::GetGlobalMaximumNumberOfThreads(), instead of retrieving the "-threads" option again?

N-Dekker avatar Aug 26 '22 11:08 N-Dekker