Parfor and multithreading
Mostrar comentarios más antiguos
Hi Konrad,
I writing regarding the answer you offered about distributed computing and multithreading in: http://www.mathworks.com/matlabcentral/answers/20060-parallel-matrix-multiplication-on-a-distributed-computing-system
I work with Matlab R2011b on a cluster with 16 nodes with each 2 quad core CPU. The MDCS is set up with 32 license: 2 workers per node. I would like to set up the each worker to use multithreading on each CPU.
I tried you solution. But when I change the maxNumCompThreads to 4, this does not change the number of core that work on the cluster.
Here an example of the code I am running.
matlabpool open N
pctRunOnAll maxNumCompThreads(4)
parfor a=1:M
FunctionUsingMultithreading;
end
matlabpool close
Am I doing something wrong ? I there something to set up on the MDCS side to be able to take advantage of the multithreading ? The are setting up like:
bpsh 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 /opt/matlab/toolbox/distcomp/bin/startworker -clean -name worker1 -jobmanager p41matlab -jobmanagerhost p41cluster
bpsh 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 /opt/matlab/toolbox/distcomp/bin/startworker -clean -name worker2 -jobmanager p41matlab -jobmanagerhost p41cluster
Thanks a lot
Respuestas (1)
Jason Ross
el 9 de Abr. de 2012
0 votos
Are the CPUs really quad core, or are they dual-core with hyper-threading enabled? You'll likely need to look up the CPU specs to know.
If you have hyper-threading, it's likely this:
7 comentarios
Nicolas
el 9 de Abr. de 2012
Jason Ross
el 9 de Abr. de 2012
Great. If you look in Konrad's post, there is some code to test that the setting has been applied. Do you get the results you expect when you run that code? (it's the spmd block where you open the matlabpool and run maxNumCompThreads).
Nicolas
el 9 de Abr. de 2012
Jason Ross
el 9 de Abr. de 2012
If you add the "Threads" counter to the performance monitor, do you see a change?
Nicolas
el 9 de Abr. de 2012
Jason Ross
el 10 de Abr. de 2012
It sounds like you have it all done correctly. You might want to call support, perhaps there is something else in your environment that's preventing this from initializing as you would expect.
Nicolas
el 10 de Abr. de 2012
Categorías
Más información sobre Job and Task Creation 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!