Hello, I am trying to suppress following output 'Evaluating tall expression using the Parallel Pool 'local':' for gather function. Unfortunately it is in a parfor loop so I can't use evalc to suppress it. Can anyone help me?
조회 수: 4 (최근 30일)
이전 댓글 표시
Angelo Scacciavillani
2018년 5월 19일
댓글: Angelo Scacciavillani
2018년 5월 22일
Hello, I am trying to suppress following output 'Evaluating tall expression using the Parallel Pool 'local':' for gather function. Unfortunately it is in a parfor loop so I can't use evalc to suppress it. Can anyone help me?
댓글 수: 0
채택된 답변
Preethi Ayyamperumal
2018년 5월 22일
"evalc" violates transparency in parfor loops and hence restricted. Such transparency restrictions apply only to the direct body of the parfor construct, and not to any functions called from there.
As a workaround, hide your call to evalc('gather(argument)') in a MATLAB function and call the function from "parfor" loop to suppress the output of "gather" function.
Refer to the following code for example:
ds = datastore('airlinesmall.csv');
varnames = {'ArrDelay', 'DepDelay'};
ds.SelectedVariableNames = varnames;
ds.TreatAsMissing = 'NA';
parfor i = 1:4
tt = tall(ds)
a = tt.ArrDelay;
m = mean(a,'omitnan');
s = std(a,'omitnan');
one_sigma_bounds = [m-s m m+s];
supress_gather_output(one_sigma_bounds,a);
end
function supress_gather_output(one_sigma_bounds,a)
[t,sig1] = evalc('gather(one_sigma_bounds)');
[max_delay, min_delay] = evalc('gather(max(a),min(a))');
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tall Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!