Issue with Simulink Model Simulation inside Parfor ?

조회 수: 4 (최근 30일)
Shivaputra Narke
Shivaputra Narke 2018년 12월 10일
댓글: Edric Ellis 2018년 12월 13일
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. ?
  댓글 수: 1
Shivaputra Narke
Shivaputra Narke 2018년 12월 10일
This issue exists only for model containing stateflow.

댓글을 달려면 로그인하십시오.

채택된 답변

Edric Ellis
Edric Ellis 2018년 12월 12일
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
Shivaputra Narke
Shivaputra Narke 2018년 12월 13일
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 2018년 12월 13일
Great, glad this is working. Yes, it's best to keep different questions separate.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2018년 12월 10일
편집: Sean de Wolski 2018년 12월 10일
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.
  댓글 수: 1
Shivaputra Narke
Shivaputra Narke 2018년 12월 11일
parsim is not available in 2015b version, right ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Run Multiple Simulations에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by