QMCPACK / QMCPACK/qmcpack

Vector math function status

Open
#1,048 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
403
Forks
154
Avg merge
1d 13h
Merged PRs (30d)
90

Description

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.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by reviewing issues #1047, #76, #63, and #526, then locate the phase-factor and structure-factor computations and their current vendor-library or omp simd paths. The desired end state and acceptance criteria are not defined, so confirm the intended approach with maintainers before changing code.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
hpc, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.