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

Compile with OpenMP #7

Open
charnley opened this issue Apr 1, 2024 · 0 comments
Open

Compile with OpenMP #7

charnley opened this issue Apr 1, 2024 · 0 comments
Assignees

Comments

@charnley
Copy link
Member

charnley commented Apr 1, 2024

          To compile with OpenMP I edited several lines in `_compile.py` as follows:
COMPILER_FLAGS = ["-O3", "-fopenmp", "-m64", "-march=native", "-fPIC",
                     "-Wno-maybe-uninitialized", "-Wno-unused-function", "-Wno-cpp"]
extra_flags = ["-lgomp", "-lpthread", "-lm", "-ldl"] + COMPILER_FLAGS

flags = ["-L/usr/lib/", "-lblas", "-llapack"] + extra_flags

After compiling the code I compared its performance on a test problem to performance of the qml fork with the same fascf.f90 file. qmllib never seemed to use more than one core, as supported by the timings:
OMP_NUM_THREADS=1:
qml: 0.7533 mins
qmllib: 0.8178 mins
OMP_NUM_THREADS=20:
qml: 0.1390 mins
qmllib: 0.8145 mins

Originally posted by @kvkarandashev in #6 (comment)

@charnley charnley self-assigned this Apr 1, 2024
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

1 participant