last day (19 days later) » 

18:25
7
Q: Parallelization with two Processors: only half number of cores run

NicoDeanI have a code which works really good in a parallelized way (with ParallelTable). I have a machine with 1 processor, 4 physical/8 logical cores, there 100% of the CPU is used for calculations: I have another machine with 22 physical/44 logical cores. It also worked 100% there (i.e. it used 44 c...

The last image says the number of processor cores is 22, which corresponds with Intel's data on the E5-2699 v4. 44 threads is the maximum the CPU can run. So it looks like the CPU can run only 44 of the 88 kernels launched.
@MichaelE2 Thanks for your answer. I added some more details on the machine. The link you post is correct, however I have a second HP Workstation which can handle two of these Intel E5-2699 processors. That sums up to 44 physical/88 logical cores. Therefore I dont understand why they are not used. Do you have any experience about Mathematica on Workstations with two Processors? Thanks!
No, sorry, I don't have such experience. The last image raises the question of whether both CPUs are being used, given the number of processor cores indicated. Maybe someone else will have an answer. Good luck!
@MichaelE2 I see now what you mean. Do you think this could be a bug in Mathmatica?
It seems like it could be a bug to me, but I have zero experience with multiple CPU machines. I could be something else. Have you tried asking Wolfram support?
18:25
\\\ Luxury ////
You may also need to adjust the values of SystemOptions["ParallelOptions" -> "ParallelThreadNumber"] and SystemOptions["ParallelOptions" -> "MKLThreadNumber"] since by default they are based on $ProcessorCount which is likely incorrectly detected in your case. This can be done on the subkernels by using ParallelEvaluate[SetSystemOptions[...]].
Considering the cost of license and extensions to have dozens of subkernels licensed, you must have support from Wolfram, yes? This is clearly a question better directed there, particularly so if it's a licensing issue.
@ilian thanks for this comment. Indeed $ProcessorCount shows only 22. But writing SystemOptions["ParallelOptions" -> "MKLThreadNumber"] and evaluating the ParallelTable still doesnt work. Could you please explain this a bit more? I don't understand what I should do with ParallelEvaluate[SetSystemOptions[...]]. Thank you very much! Btw - as this is likely the answer, you should transfer the comment to an answer maybe. @ciao i'm pretty sure there is no problem with licenses.
Have you tried turn it off and on again? That is, have you reinstalled mathematica since adding the second processor?
@mmeent good idea. I just reinstalled mathematica, but still doesnt detect the second processor.
18:25
Just to be sure, ParallelEvaluate[$KernelID] Does produce a list of 88 numbers right? (If not, you may just need to launch the kernels manually using LaunchKernels[88])
@mmeent Yes. First it says "Launching 88 kernels", then it shows me a list from 1 to 88.
Does ParallelEvaluate[{$KernelID, Sum[Prime[n], {n, 10^7}]; // Timing}] cause a near 100% load on the processor? And ParallelTable[{$KernelID, Sum[Prime[n], {n, 10^7}]; // Timing}, {88}]?
@mmeent Both have an average useage of close to 50%, and the individual cores look very similar as the second picture in the question: half of the cores are used 100%, other half is near to zero.
I'm stumped. On my PC (with a single multicore processor) I have no trouble running more Kernels than (logical) cores, and they clearly run simultaneously. (And from your response this seems to be the case at you end.) Since each subkernel is its own process, the windows scheduler should take care of distributing the load over all available logical cores. For some reason windows is not doing this on your system. Can you find out if all kernels run on the same physical processor?
Have you tried disabling "run parallel kernels at a lower process priority"? (It might be that the windows scheduler will not switch a low priority process from one physical processor to another.)
@mmeent I disactivated "run parallel kernels at a lower process priority", still half of the cores run. Taskmanager shows me that the 100%-running CPUs are CPU 0-43 (Node 0), and the ~0%-running CPUs are CPU 0-43 (Node 1) - thus I believe they run only on one physical processor. Just to make sure, i tried benchmarking tools which used 100% of all 88 logical CPUs. Thanks so much for suggesting these checks! Unfortunatly, wolfram support has not answered yet (i copied a link to this MSE-question)
18:25
And this happens regardless the Method?
@rhermans can you please specify what you mean? I tested it with ParallelTable and ParallelEvaluate, with the same behaviour. I'm not sure whether that's what you refere to.
Well, it seems the kernels are starting (you can count the number of processes) so the problem is if they are been loaded or not. Method -> "FinestGrained", and similarly "EvaluationsPerKernel" and "ItemsPerEvaluation" control how the tasks are distributed among kernels, so it would be interesting to know if the behaviour is identical for different Method specifications.
18:44
@thermans thank you, not I understand and I tested several different methods. All have the same behaviour. I updated the question (see edit3)

  last day (19 days later) »