| Version 1 (modified by , 2 years ago) ( diff ) |
|---|
It is sometimes convenient to submit jobs and let them run in the background. This easiest way to do this is to run the same step twice, with a variable loadonly that indicates whether we want to submit the job (when it is 0) or load results once the job is completed (1).
%Do we need to submit the job or download the results?
loadonly = 0;
if perform(org,'Stepname')
loadmodel(org,'PreviousStepName');
%Make sure jobs are submitted without MATLAB waiting for the results, and job name is unique
md.settings.waitonlock = 0;
md.cluster.interactive = 0; %only needed if you are using the generic cluster
md.miscellaneous.name = 'YourJobName';
%Submit job or download results, make sure that there is no runtime name (that includes the date)
md=solve(md,'Transient','runtimename',false,'loadonly',loadonly);
%Save model if necessary
if loadonly
savemodel(org,md);
end
end
Now, to submit jobs, set loadonly = 0 and launch your simulation. Once it is fully completed, you can set loadonly = 1 and run the same script, all the results will be downloaded and the model will be saved with a unique name. Good luck!
Note:
See TracWiki
for help on using the wiki.
![(please configure the [header_logo] section in trac.ini)](/trac/issm/chrome/common/trac_banner.png)