Alternative to system function

7 次查看(过去 30 天)
I am trying to run system function for hundreds of iterations. What I am doing is running a Fortran based .exe file with an input inside my code. Each run for the system function within an iteration takes around 10 seconds to operate - meaning that the entire code is running for hours. I tried the jsystem function but its performance is more or less the same. Is there a way to decrease the processing time?
Here is the line I am using in my code:
system('exsim_dmb.exe < exsim_dmb.params');
Thanks!

回答(1 个)

Mario Malic
Mario Malic 2021-3-4
Hello,
you must ensure that each of your workers gets their parameters correctly and that .exe program utilise 1 core or more if you can specify.
parfor
% code
system('exsim_dmb.exe < exsim_dmb.params');
end
  1 个评论
Hakan Süleyman
Hakan Süleyman 2021-3-4
Hello Mario,
Thanks a lot for your answer. I never used parfor before, but it looks very useful. It seems there are valid and invalid cases when parfor is used, which means an adjustment is required in the code. And I am not sure if this is something practical for my case as I have a very long code. But I will definitely try to use it in my further work.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by