Help me implement SPMD

12 次查看(过去 30 天)
Austin Taylor
Austin Taylor 2020-12-1
I have wrote the following random walk script that works well:
clear all; close all; clc;
N = [1:100];
XX = zeros(1,10);
X = randi(10,1);
R = zeros(1,100);
for i = 1:length(R)
R(i) = randi(2,1);
if R(i) == 1
X = X + 1;
if X == 11
X = 1;
end
elseif R(i) == 2
X = X - 1;
if X == 0
X = 10;
end
end
XX(i) = X;
end
scatter(N,XX,'.')
Now, I would like to implement spmd, using two cores, where lab 1 takes care of grid 1:5 and lab 2 takes care of grid 6:10.
I have used spmd previously, but I am having a difficult time implenting it into my criteria. I would appreciate any help, advice, examples to get me started.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Distributed Arrays 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by