I want to check/improve some correction algorithm I use.
The whole thing is implemented in Matlab and goes something like this
for ii = 1:nn
... % Prepare some input files
parfor i = 1:n
system('...'); % simulation code
end
... % Use the output and prepare some stuff that can be used to prep the next iteration
end
Wherey n is a bigger number than the #Treads I can use. This normaly takes a while to run and in the meantime I would like to use the computer for other (non cpu hungry) tasks. Therefore I would like to run the system calls with low priority.
I already tried to do this using new or start but then the call doesn't wait till it's finished and just proceeds. There would be a dirty hack over checking if the output files exist, but then again I was asking myself if there was not a better solution for that...
Any help would be greatly appreciated
yours magu_
try using the /wait flag in start command:
>> system( 'start /LOW /WAIT matlab.exe' );
started a new matlab instance and resumed execution only after I closed the opened application.
Of course, you need to replace matlab.exe in my proposed solution with the simulation program name you want to run.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With