Rank: 374884 based on 0 downloads (last 30 days) and 0 file submitted
photo

Will

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Will View all
Updated File Comments Rating
20 Dec 2010 sharedmatrix SHAREDMATRIX Allows any Matlab object to be shared between Matlab sessions (w/o using file I/O). Author: Joshua Dillon

This function fills an important gap in Matlab's parallel toolbox. It's common to have a large (usually read-only) dataset on which you would like to do some operations in parallel, but you would like to avoid 2 bottlenecks:

1) Having to read the data off disk (slow).

2) Having to store the same local copy on each worker (waste of memory).

I had an application which was severely RAM limited and could only use half of the cores on my local cluster, due to the need to keep common data files in memory on each worker. This function solved that problem by allowing each worker access to the same shared copy of the data. It works well and is fast.

Some implementation issues which might save you time:

1) You will need to make the changes Joshua mentioned above to sharedmatrix.c.

2) On OSX, the default maximum of shared memory is set to 4MB at boot time. You can easily increase this by creating a config file. See this page for instructions: http://www.spy-hill.com/help/apple/SharedMemory.html

3) Be careful not to clear attached shared variables in your code. As noted in the documentation, this will cause an error.

19 Dec 2010 sharedmatrix SHAREDMATRIX Allows any Matlab object to be shared between Matlab sessions (w/o using file I/O). Author: Joshua Dillon

Hi Joshua,

I'm trying to compile this on OSX 10.6 (Snow Leopard) with R2010b. gcc complains about the following error:

"error: dereferencing pointer to incomplete type"

in reference to

((mxArrayHack*)*A)->data.number_array.pdata = pr;

Any idea what might be causing this? I'm not a C programmer by any stretch. Thanks in advance if you are able to come up with anything.

Contact us