Shared Memory with MPI.jl

Sorry if this question is silly, I am new to parallel programming, I am using MPI.jl for writing distributed code. I want the processes to share an array. Is is possible to do this ? I know one way is to let one process store the array and other processes can access it by send/receive, but I think that might be slow.

On a single computer, yes, on multiple computers, I don’t think so. If all the processes are on a single computer then using Memory-mapped I/O · The Julia Language to map a file into memory for each process should allow all them all to see the same memory.

However with a single computer it would probably be better to just use threads so there isn’t any process communication.

I’m not sure if there is a network file system that would allow you to mmap a file, which is why this probably won’t work across multiple computers.

1 Like