Help me implement SPMD

12 vues (au cours des 30 derniers jours)
Austin Taylor
Austin Taylor le 1 Déc 2020
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.

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by