| File Information |
| Description |
The latest Matlab releases (starting with R2007a) include support for multiple cores. However, Matlab will only take advantage of multiple cores in evaluating certain computations like an FFT or a FIR filtering operation. Matlab will never be able to determine if, for example, consecutive function calls in a for-loop are independent of each other.
With this package, I provide some MATLAB-functions realizing parallel processing on multiple cores on a single machine or on multiple machines that have access to a common directory.
If you have multiple function calls that are independent of each other, and you can reformulate your code as
resultCell = cell(size(parameterCell));
for k=1:numel(parameterCell)
resultCell{k} = myfun(parameterCell{k});
end
then, replacing the loop by
resultCell = startmulticoremaster(@myfun, parameterCell);
allows you to evaluate your loop in parallel in several processes. All you need to do in the other Matlab processes is to run
startmulticoreslave;
No special toolboxes are used, no compilation of mex-files is necessary, everything is programmed in plain and platform-independent Matlab. If one of your slave processes dies - don't care, the master process will go on working on the given task.
Please consider that the communication between the processes, which is done by saving/loading temporary files, causes some overhead. Thus, if your function calls only need fractions of a second, the overhead will eat the advantage of the parallelization or can even lead to an increase of computation time. However, the multicore package can do several function evaluations after each other in every process before communicating again. In this way the overhead percentage can be lowered. See the help of function startmulticoremaster.m for more details.
Note: The Matlab multithreading capability (R2007a and higher) might terminate all the advantage gained by using the multicore package. So make sure that you UNcheck "Enable multihreaded computation" under File/Preferences/General/Multithreading in all involved Matlab sessions.
Dicuss with others users here: http://groups.yahoo.com/group/multicore_for_matlab
Keywords: Parallel processing, distributed computing, multiple core. |
| MATLAB release |
MATLAB 7.5 (R2007b)
|
| Zip File Content |
|
| HTML Files |
Multicore
|
| Other Files |
chompsep.m, concatpath.m, datenum2.m, deletewithsemaphores.m, displayerrorstruct.m, existfile.c, existfile.m, findfiles.m, generateemptyfile.m, getfiledate.m, gethostname.m, getusername.m, license.txt, mbdelete.m, mbload.m, mbtime.m, multicoredemo.m, postprocessdemo.m, regexptokens.m, removefilesemaphore.m, setfilesemaphore.m, startmulticoremaster.m, startmulticoreslave.m, tempdir2.m, testfun.m, textwrap2.m, translatedatestr.m, userfeedback.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (37) |
| 28 Jan 2007 |
Michal Kvasnicka
|
|
|
| 28 Jan 2007 |
lucia Come
|
|
|
| 28 Jan 2007 |
Zhijun Wang
|
|
|
| 29 Jan 2007 |
Zhijun Wang
|
|
|
| 29 Jan 2007 |
William Renaud
|
|
|
| 30 Jan 2007 |
Michal Kvasnicka
|
|
|
| 30 Jan 2007 |
Michal Kvasnicka
|
|
|
| 02 Mar 2007 |
schena gianni
|
|
|
| 21 May 2007 |
Darren 3M
|
|
|
| 14 Jun 2007 |
Markus Buehren
|
|
|
| 26 Aug 2007 |
happy matlabuser
|
|
|
| 27 Aug 2007 |
Kevin Thom
|
|
|
| 05 Oct 2007 |
Huy Bui
|
|
|
| 21 Oct 2007 |
David Brown
|
|
|
| 07 Dec 2007 |
Andrea Soldan
|
|
|
| 18 Dec 2007 |
A. S.
|
|
|
| 14 Jan 2008 |
igor scardanzan
|
|
|
| 04 Feb 2008 |
Igor S
|
|
|
| 08 Feb 2008 |
Markus Buehren
|
|
|
| 25 May 2008 |
Jun Kim
|
|
|
| 30 Jun 2008 |
uju jbl
|
|
|
| 14 Jul 2008 |
Robert Turner
|
|
|
| 03 Sep 2008 |
M H
|
|
|
| 15 Sep 2008 |
Bruno Cordani
|
|
|
| 19 Dec 2008 |
Janos Rohaly
|
|
|
| 21 Dec 2008 |
Marcio Sales
|
|
|
| 07 Jan 2009 |
Arturo Serrano
|
|
|
| 12 Jan 2009 |
Arturo Serrano
|
|
|
| 24 Jan 2009 |
Vasilis Kapetanidis
|
|
|
| 25 Jan 2009 |
Jordi Arnabat
|
|
|
| 30 Jan 2009 |
Andrew Scott
|
|
|
| 05 Feb 2009 |
Moody
|
|
|
| 10 Feb 2009 |
Markus Buehren
|
|
|
| 18 Feb 2009 |
Richard Crozier
|
|
|
| 02 Apr 2009 |
Richard
|
|
|
| 02 Jun 2009 |
dpb10
|
|
|
| 03 Jun 2009 |
Thomas
|
|
|
| Updates |
| 26 Jan 2007 |
bad line breaks in description... |
| 29 Jan 2007 |
Informational text added to demo, improvements in file access organization. |
| 21 May 2007 |
Updated info due to new Matlab multicore functionality. |
| 29 May 2007 |
Another note about multithreading |
| 30 May 2007 |
Update of documentation contained in zip file, no changes to source code. |
| 15 Jun 2007 |
Slave process will now create the temporary directory if it is not existing. |
| 22 Jun 2007 |
There was a subfunction missing (which is only executed after a write error). |
| 22 Jun 2007 |
Yet another small update. |
| 25 Sep 2007 |
Improved support for small numbers of very long function evaluations. |
| 12 Oct 2007 |
A file was missing - sorry. |
| 14 Nov 2007 |
Update of contact information in documentation. |
| 14 Nov 2007 |
Old e-mail address removed from help comments of m-files. |
| 07 Dec 2007 |
A subfunction that is only executed on certain systems was missing. |
| 03 Nov 2008 |
Subfunction datenum2 was not needed. |
| 15 Dec 2008 |
Semaphore stuff improved. |
| 17 Dec 2008 |
Forgot to include file chompsep.m |
| 21 Dec 2008 |
Semaphore mechanism improved. |
| 07 Jan 2009 |
Introduced parameter EVALSATONCE which causes the multicore package to do several function evaluations after each other before saving/loading and thus reducing the communication overhead. Demo function MULTICOREDEMO heavily commented. |
| 18 Jan 2009 |
I have nearly re-written both master and slave in order to make the package even more robust and to reduce the overhead for inter-process communication. |
| 27 Jan 2009 |
Another change to the semaphore mechanism. |
| 22 Feb 2009 |
File regexptokens.m added.
Dicussion group created: http://groups.yahoo.com/group/multicore_for_matlab |
| 09 Mar 2009 |
If a slave is killed during working on a job, the master will now generate the parameter file of that job again instead of working on the file himself. This will increase performance in certain situations. |
| 17 Mar 2009 |
Added an optional waitbar. |
| 20 Mar 2009 |
Added estimation of time left in waitbar. |
| 05 Apr 2009 |
Using system-dependent file separators in paths again. Waitbar shows progress during parameter file generation now. |
| 07 Apr 2009 |
Two bugs fixed, one regarding the waitbar, one regarding the semaphore mechanism. |
| 10 Apr 2009 |
In each multicore run, "clear functions" is now called once to ensure that changes to m-files take effect. |
| 12 Apr 2009 |
Call to "clear functions" now in master and slaves, bug fixed. |
| 13 Apr 2009 |
File displayerrorstruct.m was missing. |
| 15 Apr 2009 |
Bug fixed. |
| 17 Jun 2009 |
Estimation of time left changed, post-processing function introduced. |
| 19 Jun 2009 |
Structure being passed to post-processing function changed (still undocumented feature) |
|