ValueStore
Description
ValueStore is an object that stores data owned by a specific
job. Each entry of the object consists of a value and its corresponding key. When the owning
job is deleted, the ValueStore object is deleted as well. Use
ValueStore to store data from MATLAB® workers that can be retrieved by MATLAB clients during the execution of a job (even while the job is still
running).
Any MATLAB process client or worker can write an entry to the
ValueStoreat any time. Any MATLAB process client or worker can then read this entry from theValueStoreat any time. However, the ordering of operations executed by different processes is not guaranteed.ValueStoreis not held in system memory, so it can be used to store large results.
Creation
The ValueStore object is automatically created when you create:
A job on a cluster, which is a
parallel.Jobobject. To create a job, use thebatch,createJob, orcreateCommunicatingJobfunction.A parallel pool of process workers on the local machine, which is a
ProcessPoolobject. To create a process pool, use theparpoolfunction.A parallel pool of thread workers on the local machine, which is a
ThreadPoolobject. To create a thread pool, use theparpoolfunction. (since R2023b)A parallel pool of workers on a cluster of machines, which is a
ClusterPoolobject. To create a cluster pool, use theparpoolfunction.
You can access the ValueStore object on a worker by using the getCurrentValueStore function. You can then retrieve the
ValueStore object on a client by using the ValueStore
property that is associated with the job or the parallel pool. For example, see Run Batch Job and Retrieve Data from Workers.
Properties
Object Functions
Examples
Limitations
When using
parallel.cluster.Genericclusters with'HasSharedFileSystem'set tofalse, the visibility of modifications made toValueStorewhile a job is running depends on your specific implementation. Without additional synchronization between the MATLAB client and workerJobStorageLocation, changes might only be visible once the job has completed.