Utilizing all cores with SPMD

2 visualizaciones (últimos 30 días)
Rony Reuveni
Rony Reuveni el 29 de Jun. de 2019
Comentada: Walter Roberson el 17 de Jul. de 2019
I have the following function.
It performs two optimizations in parallel. However, to my understanding each optimization is done on only one WORKER.
I want to know if it is possible to run both optimizations in parallel and that each will utilize more than one worker (hopefully both optimizations will utilize all 32 workers):
function [XX,XXX]=spmd_test
c = parcluster;
c.NumWorkers=32;
poolobj=parpool(c);
D=6;
X0=10;
X1=100;
fh=@(X)myfun(X,D);
spmd
switch labindex
case 1
XX = fminsearch(fh,X0,optimset('UseParallel','always','TolFun',1e-8,'TolX',1e-8,'MaxFunEvals',1000000,'MaxIter',1000000));
case 2
XXX = fminsearch(fh,X1,optimset('UseParallel','always','TolFun',1e-8,'TolX',1e-8,'MaxFunEvals',1000000,'MaxIter',1000000));
end
end
XX=XX{1};
XXX=XXX{2};
end
  7 comentarios
Rony Reuveni
Rony Reuveni el 17 de Jul. de 2019
Do you maybe have an idea why in the cluster profile manager I couldn't find any parameter controlling the number of threads per worker as suggested here:
Walter Roberson
Walter Roberson el 17 de Jul. de 2019
I just noticed that you are using R2016a. If I recall correctly that parameter was added to the cluster profile in a later release. Which release exactly is not coming to mind at the moment.
If I recall correctly you might be able to make the call to change the maximum threads in each worker, perhaps with parfevalOnAll. You would need to take some care not to ask for too many workers.

Iniciar sesión para comentar.

Respuesta aceptada

Rony Reuveni
Rony Reuveni el 16 de Jul. de 2019
Hopefully, could someone help on this subject?
Thanks,

Más respuestas (0)

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by