soedinglab / CCMpred

Protein Residue-Residue Contacts from Correlated Mutations predicted quickly and accurately.
http://www.ncbi.nlm.nih.gov/pubmed/25064567
GNU Affero General Public License v3.0
107 stars 25 forks source link

The CPU runs on a single thread #35

Open liimy1 opened 2 years ago

liimy1 commented 2 years ago

Hello,When I run a program with a CPU, it tells me that only one CPU thread is used.How can I run the program with 6 or more CPU cores as in the literature? thank you!

sseemayer commented 2 years ago

Please make sure you are compiling with OpenMP support. Then, you can use the -t argument to specify the number of threads you wish to use.

lm-jkominek commented 8 months ago

Sorry for the necro, but I wanted to chime in here since I just faced this problem myself and others might also be turned away because of this issue. I think it is highly relevant because CCMpred scales so nicely, so performance is a very important aspect here. I know it can (and probably should) run on a GPU, but sometimes we don't have that luxury.

Turns out, the problem lies not with CCMpred itself, but instead with CMake that it uses for compilation. For whatever reasons, modern versions of CMake fail to pass the OpenMP flags to the compiler and linker in the Makefile, and so the program is compiled without the multi-thread support. It will read the -t param, and it will tell you that it is using X threads, but in the background it will actually be utilizing only a single CPU.

The solution was to use an old version of CMake, installed via pip. In my tests only CMake versions 3.9.6 and 3.10.3 worked. Both are over 5 years old now, with the current version being 3.27.7, so I'm wondering if that's something that could be rectified @sseemayer ?