Customizing SharedArray

When creating a SharedArray as in
using SharedArrays
using Distributed


a = SharedArray{Float64}(40)

the partitioning of entries is made automatically. Does anyone knows if it is possible to set my own partitioning of the data ? Related question: where can I find a full documentation of the package SharedArrays?
Many thanks.

SharedArrays is a standard library, so the documentation is part of the documentation of the core language. Relevant entries:


1 Like

Thanks for the links but I am looking for a detailed documentation if it exists.

What do you mean by “partitioning” here? The SharedArray is accessible to all processes that it’s mapped on equally, i.e. it is not a chunked array. You can change which workers have the array mapped with the pids kwarg.

If you mean that you want to be able to initialize it differently, you can just do that after you create it.

I suppose it’s not super well documented since it’s a pretty simple mechanism; I found the code pretty enlightening, so maybe you will too. If you find anything that’s not documented that you think is important for using a SharedArray, you’re welcome to open a PR to improve the docs :slightly_smiling_face:

By partitioning, I mean I want to impose the number of local indices for each worker.