Consider following MATLAB code snippet
indices = cell(n,1);
values = rand(m,3);
% indices{...} contains a vector of integers 1,..,m
parfor i = 1:n
currentIndices = indices{i};
currentValues = values(currentIndices,:); % each worker needs the complete values-array
end
The indices-array says which rows of the values-array are relevant inside the loop. However, each worker gets the values array, so MATLAB gives the warning of broadcasting it to each worker. Is there a way to circumvent this?
Thank you :)