MATLAB Answers

Error using batch caused by error using save

15 views (last 30 days)
Sascha
Sascha on 10 Aug 2013
Answered: Ryan on 27 Nov 2017
Hello together,
I tried to make my first steps in the command batch. When I try to make a little example, like in the online documentation, I get an error, which I couldn't handle.
I made a script (exampleParfor.m) and testet it (it runs fine). By executing with the run-button of the editor, I choosed "Add to path". In the next step I tried to make a batch-job with this script, but I get this error:
j = batch('parforExample')
Error using batch (line 177)
An unexpected error occurred accessing properties: "CaptureDiary" "CreateTime" "DependentFiles" "Diary" "Error" "ErrorIdentifier" "ErrorMessage" "FinishTime" "Function" "InputArguments" "Name" "NumOutputArguments" "OutputArguments" "StartTime" "StateEnum" "Worker"
Caused by:
Error using save
The data no longer exists on the device.
I even tried to change the path in the command window, but the error still occurs. The operation system I am using is Linux 64bit and Matlab R2013a
Many thanks in advance,
Greatings
Sascha
  2 Comments
Walter Roberson
Walter Roberson on 28 Aug 2013
Do you have a "clear" statement in your code? And is it a "function" with a matching "end" statement (forming a static workspace) ? Or how are you determining the variables to save? Just using save with a filename and no variable name?

Sign in to comment.

Answers (1)

Ryan
Ryan on 27 Nov 2017
I have also had this error. The problem tracks down to a save() line within FileSerializer.m ... the batch command is saving task information into a batch job folder, and the task data exceeds the size for the default save option. Two fix options: (A) Change your default save option to 7.3 or (2) actually patch FileSerializer itself such that even if user save options are set to the faster -v6 save, it still works when task files are too big.
save(filename, '-struct', 'data', saveFlags);
becomes ...
try % -- TASK FILE SIZE CAN CAUSE THIS TO CRASH!, adding -v7.3 averts failure
save(filename, '-struct', 'data', saveFlags);
catch ME
save(filename, '-struct', 'data', saveFlags,'-v7.3');
end

Community Treasure Hunt

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

Start Hunting!