annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/mirparallel.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function p = mirparallel(s)
wolffd@0 2 % mirparallel(1) toggles on parallel processing: (BETA)
wolffd@0 3 % When ?Folder? or ?Folders? is used, several audio files can be analysed
wolffd@0 4 % in parallel using several parallel Matlab sessions running on the
wolffd@0 5 % different processors and/or processor cores of your computer.
wolffd@0 6 % (Requires MathWorks? Parallel Computing Toolbox.)
wolffd@0 7 % mirparallel(0) toggles back off parallel processing.
wolffd@0 8
wolffd@0 9 persistent mir_parallel
wolffd@0 10
wolffd@0 11 if nargin
wolffd@0 12 warning('MIRtoolbox Parallel computing is currently in Beta Version.');
wolffd@0 13 if s
wolffd@0 14 try
wolffd@0 15 matlabpool size;
wolffd@0 16 catch
wolffd@0 17 mirerror('mirparallel','Are you sure Parallel Processing Toolbox is installed?');
wolffd@0 18 end
wolffd@0 19 end
wolffd@0 20 mir_parallel = s;
wolffd@0 21 else
wolffd@0 22 if isempty(mir_parallel)
wolffd@0 23 mir_parallel = 0;
wolffd@0 24 end
wolffd@0 25 end
wolffd@0 26
wolffd@0 27 p = mir_parallel;