spmd

How do I index codistributed arrays in a spmd block

感情迁移 提交于 2020-01-23 10:43:15
问题 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

How do I index codistributed arrays in a spmd block

狂风中的少年 提交于 2019-12-06 00:12:29
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(2,k); spectrum(grid) = spectrum(grid) + peakfn(X(grid),a(k),b(k),c(k)]); end Here, each peak has some

Sending data to workers

被刻印的时光 ゝ 提交于 2019-11-27 23:44:47
I am trying to create a piece of parallel code to speed up the processing of a very large (couple of hundred million rows) array. In order to parallelise this, I chopped my data into 8 (my number of cores) pieces and tried sending each worker 1 piece. Looking at my RAM usage however, it seems each piece is send to each worker, effectively multiplying my RAM usage by 8. A minimum working example: A = 1:16; for ii = 1:8 data{ii} = A(2*ii-1:2*ii); end Now, when I send this data to workers using parfor it seems to send the full cell instead of just the desired piece: output = cell(1,8); parfor ii

Sending data to workers

做~自己de王妃 提交于 2019-11-26 21:34:36
问题 I am trying to create a piece of parallel code to speed up the processing of a very large (couple of hundred million rows) array. In order to parallelise this, I chopped my data into 8 (my number of cores) pieces and tried sending each worker 1 piece. Looking at my RAM usage however, it seems each piece is send to each worker, effectively multiplying my RAM usage by 8. A minimum working example: A = 1:16; for ii = 1:8 data{ii} = A(2*ii-1:2*ii); end Now, when I send this data to workers using