vdemichev / DiaNN

DIA-NN - a universal automated software suite for DIA proteomics data analysis.
Other
283 stars 53 forks source link

dia-nn uses 12 cores only out of the 76 available #1269

Open GeorgeCMarinescu opened 3 days ago

GeorgeCMarinescu commented 3 days ago

Hello,

We have been using for a while a linux KVM host with 32 core cpu, running a virtual machine with 28 cpu cores using dia-nn 1.9 , setting number of threads to 28. It is running great, correctly balancing the load on all 28 virtual cpus.

Recently, we have installed a new 80 core KVM host server running the same Linux distribution and configuration, cloned that old windows virtual machine and changed the vm config allocating 76 cores. Windows correctly shows the 76 core, as seen in the attached picture, however dia-nn limits the threads number to 64 (whatever higher number we write there, it goes down to 64). Then out of these 64, it only uses 12. In dia-nn log we can see Logical cpu cores: 12. Any Ideea where does it take this number from and if we can change that so we can use more resources ? diann 12 logical cores

Regards, Catalin

vdemichev commented 3 days ago

Hi Catalin,

Many thanks for reporting this. Here 12 is the output of std::thread::hardware_concurrency() C++ function, specification is here https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency. The function is not guaranteed to work correctly by the specification (it's like just a hint), which apparently is there case here. What's surprising is that DIA-NN actually uses just 12, i.e. I cannot find right now where in the code it has this limitation, should use 64 (or whatever number you specify with --threads in Additional options). The total number of threads used can be also checked in https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer, should be >= 65. I wonder if you see that other multi-CPU software also actively loads just 12 cores?

Best, Vadim

GeorgeCMarinescu commented 3 days ago

Thank you for the fast reply, Vadim. Indeed, that function does not return all the time the same result on the same machine, we have just loaded more data files, and now it uses 64 cores, as shown in attached picture. Things are even stranger, as windows task manager shows 64 loaded CPUs, while process-explorer shows the same load on all 76. process_explorer_vs_windows_task_manager

In this run, we have passed the parameter -threads 74 to the command line, as additional option, however, the log says: Thread number set to 64. The threads input in dia-nn GUI is limited to 64. Was this intended, or is a bug ?

Regards, Catalin

vdemichev commented 3 days ago

Hi Catalin, I would trust process explorer :)

Best, Vadim

GeorgeCMarinescu commented 3 days ago

I trust none of them :) How is it fully loading 76 processors, if threads parameter is set to 74 and dia-nn says it uses 64 threads?!