image thumbnail

sharedmatrix

version 1.17.0.0 (39.3 KB) by Joshua Dillon
SHAREDMATRIX Allows any Matlab object to be shared between Matlab sessions (w/o using file I/O).

4.2K Downloads

Updated 08 Jun 2011

View License

SHAREDMATRIX Allows any Matlab object (e.g., struct, nd-cell, nd-matrix, sparse matrix) to be shared between multiple Matlab sessions without resorting to file I/O. The Matlab sessions must have access to the same shared memory resources, i.e., the processes are on the same physical system. This program uses shared memory functions specified by POSIX and in doing so avoids disk I/O for sharing. The program should work on any Linux variant but was only tested on Ubuntu.

*UPDATE: Thanks to contributor Andrew Smith, we now support Windows through the Boost InterProcess library. The windows version has not been tested by the first author.

% For example, assuming you have data X:

shmkey=12345;
sharedmatrix('clone',shmkey,X);
clear X;
spmd(8)
X=sharedmatrix('attach',shmkey);
% do something with X
sharedmatrix('detach',shmkey,X);
end
sharedmatrix('free',shmkey);

For complete description please see my blog post:
http://smlv.cc.gatech.edu/2010/08/27/shared-memory-in-matlab/

Cite As

Joshua Dillon (2021). sharedmatrix (https://www.mathworks.com/matlabcentral/fileexchange/28572-sharedmatrix), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

sharedmatrix/

sharedmatrix/sharedmatrix_windows_by_andrew_smith/