Issue with Simulink Model Simulation inside Parfor ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shivaputra Narke
am 10 Dez. 2018
Kommentiert: Edric Ellis
am 13 Dez. 2018
Hi,
I am trying to run multiple simulations with different data set on model 'ModelTest.slx' using parfor.
my code goes like this,
parfor
simout=sim(bdroot,<options>)
..
..
..
end
Parfor executes one simulation (sometime it runs two simulations). It geerates 'slprj' folder after first simulation.
Then it gets aborted with following error message.
"C:\Users\...\parllelTest\slprj\_jitprj\jitEngineAccessInfo.mat.
Not a binary MAT-file. Try LOAD -ASCII to read as text."
Below are the details of matlab version and model settings,
Matalb 2015b,
parpool with local profile.
Simulation Mode : Normal;
Solver :Fixed Step, discrete
Does anyone have any idea about this error. ?
Akzeptierte Antwort
Edric Ellis
am 12 Dez. 2018
As @Sean says, parsim is the way to go if you can. However, as a workaround, you might get away with doing something like this:
parfor idx = ...
oldFolder = cd(getAttachedFilesFolder());
sim(..);
cd(oldFolder);
end
This puts each worker into a unique working directory, which might well get around the problems with the Stateflow compilation results overwriting each other.
2 Kommentare
Edric Ellis
am 13 Dez. 2018
Great, glad this is working. Yes, it's best to keep different questions separate.
Weitere Antworten (1)
Sean de Wolski
am 10 Dez. 2018
Bearbeitet: Sean de Wolski
am 10 Dez. 2018
Have you looked at parsim? It's the new an improved means for simulating in parallel and takes care of the file management that was always a pain to do on your own.
Siehe auch
Kategorien
Mehr zu Parallel for-Loops (parfor) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!