Are functions called in parfor independent from each other
Hello everyone!
I have a question about using parfor loop related to my statistics test. I am trying to split my test from one that has 1000 iterations to four parallel tests that have 250 iterations to save time. Am I right saying that there is no influence between workers involved in this and the test result will correspond regular 1000 iteration test? The program has no errors
Script text:
S = 250;
D = zeros(4,1);
F = zeros(4,1);
d = 4;
parfor e = 1:d
[D(e,1),F(e,1)] = MonteCarlo(S);
end
disp(‘D = ‘);
disp((D(1,1)+D(2,1)+D(3,1)+D(4,1))/(d*S));
disp(‘F=’);
disp((F(1,1)+F(2,1)+F(3,1)+F(4,1))/(d*S));Hello everyone!
I have a question about using parfor loop related to my statistics test. I am trying to split my test from one that has 1000 iterations to four parallel tests that have 250 iterations to save time. Am I right saying that there is no influence between workers involved in this and the test result will correspond regular 1000 iteration test? The program has no errors
Script text:
S = 250;
D = zeros(4,1);
F = zeros(4,1);
d = 4;
parfor e = 1:d
[D(e,1),F(e,1)] = MonteCarlo(S);
end
disp(‘D = ‘);
disp((D(1,1)+D(2,1)+D(3,1)+D(4,1))/(d*S));
disp(‘F=’);
disp((F(1,1)+F(2,1)+F(3,1)+F(4,1))/(d*S)); Hello everyone!
I have a question about using parfor loop related to my statistics test. I am trying to split my test from one that has 1000 iterations to four parallel tests that have 250 iterations to save time. Am I right saying that there is no influence between workers involved in this and the test result will correspond regular 1000 iteration test? The program has no errors
Script text:
S = 250;
D = zeros(4,1);
F = zeros(4,1);
d = 4;
parfor e = 1:d
[D(e,1),F(e,1)] = MonteCarlo(S);
end
disp(‘D = ‘);
disp((D(1,1)+D(2,1)+D(3,1)+D(4,1))/(d*S));
disp(‘F=’);
disp((F(1,1)+F(2,1)+F(3,1)+F(4,1))/(d*S)); local variables, parfor, function, monte carlo MATLAB Answers — New Questions