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 Center および File ExchangeDistributed Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by