-
Book Overview & Buying
-
Table Of Contents
Julia High Performance
By :
Distributed arrays are a fully generic solution that scales across many networked hosts in order to work on data that cannot fit in the memory of a single machine. However, in many circumstances, although the data does fit in the memory, we want multiple Julia processes to improve throughput by fully utilizing all the cores in a machine. In this situation, shared arrays are useful to get different Julia processes operating on the same data.
Shared arrays, as the name suggests, are arrays that are shared across multiple Julia processes on the same machine.
Constructing SharedArray requires specifying its type, its dimensions, and the list of process IDs that will have access to the array, as follows:
S=SharedArray( Float64, (100, 100, 5), pids=[2,3,4,5]);
Once a shared array is created, it is accessible in full to all the specified workers (on the same machine). Unlike a distributed array, the data is not partitioned, and hence there is no need for any data transfer between nodes...