How do I index codistributed arrays in a spmd block
问题 I am doing a very large calculation (atmospheric absorption) that has a lot of individual narrow peaks that all get added up at the end. For each peak, I have pre-calculated the range over which the value of the peak shape function is above my chosen threshold, and I am then going line by line and adding the peaks to my spectrum. A minimum example is given below: X = 1:1e7; K = numel(a); % count the number of peaks I have. spectrum = zeros(size(X)); for k = 1:K grid = X >= rng(1,k) & X <= rng