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

Vector math function status #1048

Open
ye-luo opened this issue Sep 4, 2018 · 2 comments
Open

Vector math function status #1048

ye-luo opened this issue Sep 4, 2018 · 2 comments

Comments

@ye-luo
Copy link
Contributor

ye-luo commented Sep 4, 2018

This issue is motivated by #1047 and created to track the use of vector math library in QMCPACK.

QMCPACK needs to compute phase factors for PBC complex orbitals and Structure factors.
Since many sincos are needed, this can be done in two ways:

  1. Current way. Compute all phases in an array and then call the vendor vector math library. This is discouraged for three reasons. 1) scratch space need 2) long vector gives pressure cache 3) vendor library may contain threading support but it plays negatively in QMCPACK nested threading. 4) macros and cmake needed to handle different vendor library APIs.
  2. Better way. Using omp simd to have the whole loop vectorized, not only the sincos. This is better because 1) larger vectorized computing region 2) controls threading by us. Unfortunately, only Intel compiler vectorizes the loop properly because of the phase computation dot(k,r) inside the vectorized loop. So a a workaround is putting ifdef at the moment.

Long term we would like to see compilers improve and we can drop explicitly calling vendor vector math library. Intel currently turns sincos in simdized loop into libsvml and gnu turns it into libmvec. So way 2 is better for the future.

At the moment, sincos is widely available in both proprietary and open source math library but it is not in the C++ standard. So we have to protect its use and had issue #76 and maintenance pain #63.

Known issue:
#526 glibc 2.23 is affecting Ubuntu 16.04 LTS. Later Ubuntu releases are fine.

@prckent
Copy link
Contributor

prckent commented May 16, 2019

Update: glibc versions and gnu compiler are now error trapped during cmake configuration.

@ye-luo
Copy link
Contributor Author

ye-luo commented Aug 13, 2021

#3357 has some info for AMD LibM.

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

No branches or pull requests

2 participants