How to delay a queued job's execution until some other jobs have finished

1 visualizzazione (ultimi 30 giorni)
How do I make a batch job delay its execution until another set of jobs is executed?
The background is the following:
  1. I have to execute multiple simulation runs in parallel.
  2. I want to output the result of all the simulations into one plot
  3. I want to save the diaries of each simulation run to check for warnings and errors.
  4. I want to continue working interactively while the simulations are running.
To fulfil requirements 1 & 2, I can use `batch(.)` to execute the jobs and `wait(.)` to wait for their completition before creating the plots, or `parfor`. However, to fulfill requirement 3, I need to use `batch(.)`, because I have found no possibility to save the diaries and outputs of `parfor` parallel jobs. This is possible with `batch(.)`.
To fullfil requirement 4, my idea was to create a plotting job which saves the plots to disk. It can read the output of the preceeding jobs from disk as well. However, I fear that I might block one worker if the plotting job executes before all the simulation jobs are complete.
Thank you for any idea!

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by