matlabpool open n; doesn't work.
Mostrar comentarios más antiguos
Hi,
I'd like to open matlabpool with a variable number of cores, to use the maximum number of cores available. So n would equal features('numCores') here.
But matlabpool open n, matlabpool open features('numCores'), matlabpool open maxNumCompThreads don't work here. matlabpool open seems to accept only numbers and not variables.
I could do something stupid like
if features('numCores') == 4
matlabpool open 4;
elseif features('numCores') == 2
matlabpool open 2;
end
but I'd like to know if something more elegant exists.
Thanks!
Respuesta aceptada
Más respuestas (2)
If you have R2013b or later, you shouldn't be using matlabpool . You should be using parpool , which does take a variable as input directly,
parpool(n)
3 comentarios
Martin
el 7 de Mayo de 2014
Haseeb Hassan
el 7 de Oct. de 2018
Thank you Matt for your useful hint.
Bruno Silva
el 17 de En. de 2020
Thanks!
Malshikho
el 25 de Mayo de 2018
0 votos
Unfortunately I have Matlab R2010b
1 comentario
Steven Lord
el 25 de Mayo de 2018
Then use matlabpool using the syntax described in the accepted answer by Niklas Nylén.
Categorías
Más información sobre Parallel Computing Fundamentals en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!