Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CPU runs on a single thread #35

Open
liimy1 opened this issue Mar 24, 2022 · 2 comments
Open

The CPU runs on a single thread #35

liimy1 opened this issue Mar 24, 2022 · 2 comments

Comments

@liimy1
Copy link

liimy1 commented Mar 24, 2022

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
Copy link
Contributor

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
Copy link

lm-jkominek commented Nov 28, 2023

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants