Help me implement SPMD
조회 수: 15 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Distributed Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!