Clear Filters
Clear Filters

Issue with Simulink Model Simulation inside Parfor ?

3 views (last 30 days)
I am trying to run multiple simulations with different data set on model 'ModelTest.slx' using parfor.
my code goes like this,
Parfor executes one simulation (sometime it runs two simulations). It geerates 'slprj' folder after first simulation.
Then it gets aborted with following error message.
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. ?

Accepted Answer

Edric Ellis
Edric Ellis on 12 Dec 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());
This puts each worker into a unique working directory, which might well get around the problems with the Stateflow compilation results overwriting each other.
Shivaputra Narke
Shivaputra Narke on 13 Dec 2018
This is working with sending files to workers. I have few other questions on batch program, maybe I will start a different thread for that.
Thanks for the help!
Edric Ellis
Edric Ellis on 13 Dec 2018
Great, glad this is working. Yes, it's best to keep different questions separate.

Sign in to comment.

More Answers (1)

Sean de Wolski
Sean de Wolski on 10 Dec 2018
Edited: Sean de Wolski on 10 Dec 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.


Find more on Run Multiple Simulations in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!