Skip to content

Commit

Permalink
Do not update nMaxThreads automatically
Browse files Browse the repository at this point in the history
nMaxThreads is given to the c code at the compilation time. It should not be changed without regenerating the c code.
Therefore, I remove this line from arSetParallelThreads.
  • Loading branch information
niklasneubrand committed Nov 7, 2024
1 parent 89fd6ae commit f3e55b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arFramework3/Advanced/arSetParallelThreads.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ function arSetParallelThreads(n, silent)

% get correct number of cores and max threads
ar.config.nCore = feature('numCores');
ar.config.nMaxThreads = 2*ar.config.nCore;
if ~isfield(ar.config, 'nMaxThreads')
ar.config.nMaxThreads = 2*ar.config.nCore;
% else:
% do not overwrite nMaxThreads. Reason:
% The value also appears as a hard-coded value in the c code.
% If you change nMaxThreads manually, use arCompile (arRecompile or arCompileAll)
% with option forcedCompile=1 to regenerate the c code.
end

% set default values
if ~exist('silent','var') || isempty(silent)
Expand Down

0 comments on commit f3e55b8

Please sign in to comment.