Skip to content

Documented _OPENMP preprocessor flag in readme#104

Open
tgorni wants to merge 1 commit into
sissaschool:develfrom
tgorni:devel
Open

Documented _OPENMP preprocessor flag in readme#104
tgorni wants to merge 1 commit into
sissaschool:develfrom
tgorni:devel

Conversation

@tgorni

@tgorni tgorni commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

When compiled for CPU only, TurboRVB detects automatically whether openmp is supported or not. However, the number of threads is always reported to be one in the output file, since the preprocessor flag _OPENMP is never enabled. The user is now warned of this behaviour in the README.

@kousuke-nakano

Copy link
Copy Markdown
Collaborator

Thank you @tgorni !!

@kousuke-nakano

Copy link
Copy Markdown
Collaborator

I do not get why _OPENMP is not enabled via CMake :-( Do you have any clue?

@tgorni

tgorni commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

My guess is that, while !$omp pragmas are simply ignored by the compiler when openmp is not supported and a single-threaded executable is produced, if _OPENMP is permanently enabled the compilation will crash when openmp is not supported because the compiler will not find omp_* functions.

@addman2

addman2 commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator

Hi all, I noticed OMP sometimes does not work with CMake. And honestly this is a mistery to me. This is the reason why I wrote backfall make.inc build. When you compile Turbo make it will work. The mistery here is the Makefile does exactly the same thing as CMake to my knowledge, but with CMake sometimes it does not work but with Makefile it does.

Keep in mind, one has to do more tweeking when installing with make.inc, there are some example make.inc files that should work most of the times.

We need to look at this more carefully.

@kousuke-nakano

Copy link
Copy Markdown
Collaborator

Hi, #105 solved this issue :-)

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

Successfully merging this pull request may close these issues.

3 participants