Retrieve existing batch job variables while the job is still running.

8 vues (au cours des 30 derniers jours)
Derrell Dsouza
Derrell Dsouza le 28 Avr 2022
Réponse apportée : arushi le 18 Jan 2024
How can we retrieve batch job variables when the job is still running?
We have something like load(job) to load job variables but it is only available when the job is finished. Can we do it using getCurrentValueStore?.
  2 commentaires
Walter Roberson
Walter Roberson le 28 Avr 2022
No, Value Stores are cooperative. Only thing that are deliberately stored become available. It does not provide any method of accessing the workspace of the job.
Derrell Dsouza
Derrell Dsouza le 28 Avr 2022
Modifié(e) : Derrell Dsouza le 28 Avr 2022
Lets say if I have function [a,b] = calculate(c,d). So in this case we are storing a and b so shouldn't it be available when i run the function in a batch job and use value store.

Connectez-vous pour commenter.

Réponses (1)

arushi
arushi le 18 Jan 2024
Hi Derrell,
I understand that you want to retrieve batch job variables while the job is still running. When you're running batch jobs, you have limited options to interact with the job's workspace while it is still running. The load function, as you mentioned, is typically used to retrieve the output variables from a finished job.
However, if you want to monitor or retrieve data from a batch job while it is still running, you can use the diary function to capture the command window output of the job. This doesn't give you direct access to the workspace variables, but it does allow you to see the output that the job is producing in real-time. You can enable the diary before starting the job and then read it periodically.
getCurrentValueStore is indeed a function that allows you to access a ValueStore object but is not for accessing variables from a batch job while it is running. The ValueStore object allows you to store key-value pairs from within the workers, and it is particularly useful when you want to accumulate data across multiple iterations or workers without sending the data back to the client after each iteration.
Please refer to the to the below documentation for “diary” function-
https://www.mathworks.com/help/matlab/ref/diary.html
Hope this helps.

Catégories

En savoir plus sur MATLAB Parallel Server dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by