Azzera filtri
Azzera filtri

fminbnd in parallel: no gain

3 visualizzazioni (ultimi 30 giorni)
martin
martin il 23 Gen 2014
Modificato: Matt J il 24 Gen 2014
I want to minimize a function using fminbnd on a 32-core Linux machine (running Ubuntu 13.10+matlab2013a). I do the following:
>>matlabpool
Starting matlabpool using the 'local' profile ...
connected to 12 workers
>>optim_fminbnd=optimset('fminbnd');
>>tic
>>disp('With parallelization:')
With parallelization:
>> fminbnd(@localstrul_valuespectral,0,359,optimset(optim_fminbnd,'UseParallel','a
lways'))
ans =
221.8743
>>toc
Elapsed time is 7.124580 seconds.
>>tic
>>disp('Without parallelization:')
Without parallelization:
>>fminbnd(@localstrul_valuespectral,0,359,optimset(optim_fminbnd,'UseParallel','ne
ver'))
ans =
221.8743
>>toc
Elapsed time is 7.785863 seconds
that is to say there is no gain in speed (sometimes the non-parallel version is marginally faster). Do I set the parameters wrong?

Risposta accettata

Alan Weiss
Alan Weiss il 24 Gen 2014
fminbnd is a serial algorithm. There is no gain possible using parallel processing. In fact, look at the options for fminbnd, and you see that fminbnd does not use the UseParallel option.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 Commento
Matt J
Matt J il 24 Gen 2014
Modificato: Matt J il 24 Gen 2014
However, it might be possible to use parallel operations inside the objective function localstrul_valuespectral to speed up its evluations.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by