saving a job.parallel object
34 ビュー (過去 30 日間)
古いコメントを表示
Sandra Martinez
2025 年 2 月 6 日 16:32
コメント済み: Sandra Martinez
2025 年 2 月 12 日 17:10
I'm running in batch and I would like to save the variable job (CJSIndependentJob or CJSTask object).
is it possible?
2 件のコメント
Steven Lord
2025 年 2 月 6 日 17:17
What do you hope/plan to do with the saved job object? Do you hope to use it to somehow pause the job and resume it later on, to be able to rerun the job, etc.?
採用された回答
Edric Ellis
2025 年 2 月 7 日 6:45
It is not supported to save job / task objects themselves - the expected workflow is that you use parcluster to get back your job / task when you restart MATLAB. In other words:
% First MATLAB session - initiate batch job
clus = parcluster("myProfile");
job = batch(clus, @someFcn, numOutputs, {in1, in2});
% Later, restart MATLAB
clus = parcluster("myProfile")
clus.Jobs % Look at existing jobs
job = clus.Jobs(3) % or whatever
6 件のコメント
Edric Ellis
2025 年 2 月 12 日 15:44
What I meant was that each individual invocation of batch returns a scalar parallel.Job instance. If you want to wait for all jobs, you could just call wait in a loop, or do:
arrayfun(@wait, job)
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!