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
ValueStore
at any time. Any MATLAB process client or worker can then read this entry from theValueStore
at any time. However, the ordering of operations executed by different processes is not guaranteed.ValueStore
is 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.Job
object. To create a job, use thebatch
,createJob
, orcreateCommunicatingJob
function.A parallel pool of process workers on the local machine, which is a
ProcessPool
object. To create a process pool, use theparpool
function.A parallel pool of thread workers on the local machine, which is a
ThreadPool
object. To create a thread pool, use theparpool
function. (since R2023b)A parallel pool of workers on a cluster of machines, which is a
ClusterPool
object. To create a cluster pool, use theparpool
function.
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.Generic
clusters with'HasSharedFileSystem'
set tofalse
, the visibility of modifications made toValueStore
while 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.