I want to minimize a function using fminbnd on a 32-core Linux machine (running Ubuntu 13.10+matlab2013a). I do the following:
>>matlabpoolStarting 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','always'))ans = 221.8743>>tocElapsed time is 7.124580 seconds.>>tic>>disp('Without parallelization:')
Without parallelization:
>>fminbnd(@localstrul_valuespectral,0,359,optimset(optim_fminbnd,'UseParallel','never'))ans = 221.8743>>tocElapsed 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?
Best Answer