Resource Sharing in Parallel Computing

The Wolfram Language's symbolic parallel computation architecture provides a uniquely convenient mechanism for communicating and sharing resources between parallel processes. Its foundation is a virtual shared memory model, implemented on top of WSTP-based message passing, running seamlessly on arbitrary clusters or networks of processors.

Shared Variables and Functions

(RefLink[SetSharedVariable, paclet:ref/SetSharedVariable]) — set symbols to share values across subkernels

(RefLink[SetSharedFunction, paclet:ref/SetSharedFunction]) — set functions to share downvalues across subkernels

(RefLink[$SharedVariables, paclet:ref/$SharedVariables]), (RefLink[$SharedFunctions, paclet:ref/$SharedFunctions]) — lists of shared variables, functions

(RefLink[UnsetShared, paclet:ref/UnsetShared]) — stop sharing variables or functions

Synchronization

(RefLink[CriticalSection, paclet:ref/CriticalSection]) — synchronize concurrent access to a shared resource

Broadcasting Definitions

(RefLink[DistributeDefinitions, paclet:ref/DistributeDefinitions]) — distribute definitions to all parallel subkernels

(RefLink[ParallelNeeds, paclet:ref/ParallelNeeds]) — load the same package into all parallel subkernels

(RefLink[ParallelEvaluate, paclet:ref/ParallelEvaluate]) —evaluate an expression on all parallel subkernels