필터 지우기
필터 지우기

Use parfor in console

조회 수: 1 (최근 30일)
Pastor Villalpando
Pastor Villalpando 2017년 10월 10일
답변: Pastor Villalpando 2017년 10월 13일
Hello, has anyone used the parfor command from a compiled file in console?

답변 (2개)

Kojiro Saito
Kojiro Saito 2017년 10월 11일
If you mean parfor in standalone application created with MATLAB Compiler, this document will help you.
  • Export cluster profile
From MATLAB menu, go to Parallel -> Manager Cluster Profiles, then Export the "local" cluster profile to "local_mcr.settings".
  • Sample programs
Main function
function run_parallel_funct
setmcruserdata('ParallelProfile', 'local_mcr')
res = compiler_pct;
save('result.mat','res');
end
Sub function
function res = compiler_pct()
a = ones(10, 1);
parfor idx=1:10
a(idx, 1) = idx;
end
res = a;
end
  • Add the cluster profile to the application
Compile run_parallel_funct function as a standalone application. You need to add the local_mcr.settings file to your installed files.
Then, you can create standalone parfor application. Hope this help.

Pastor Villalpando
Pastor Villalpando 2017년 10월 13일
Thanks

카테고리

Help CenterFile Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by