Skip to content

Add safe scaling xLASSQ routines from https://doi.org/10.1145/3061665 #494

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

Merged

Conversation

weslleyspereira
Copy link
Collaborator

@weslleyspereira weslleyspereira commented Feb 19, 2021

Edward Anderson stated in his paper https://doi.org/10.1145/3061665 the following:

The square root of a sum of squares is well known to be prone to overflow and underflow. Ad hoc scaling
of intermediate results, as has been done in numerical software such as the BLAS and LAPACK, mostly
avoids the problem, but it can still occur at extreme values in the range of representable numbers. More
careful scaling, as has been implemented in recent versions of the standard algorithms, may come at the
expense of performance or clarity. This work reimplements the vector 2-norm and the generation of Givens
rotations from the Level 1 BLAS to improve their performance and design. In addition, support for negative
increments is extended to the Level 1 BLAS operations on a single vector, and a comprehensive test suite
for all the Level 1 BLAS is included.

  • This PR replaces the original xLASSQ with Edward's safe scaling xLASSQ codes.

  • Since the codes were written in the Fortran90 standard, I removed

# Tell CMake that our Fortran sources are written in fixed format.
set(CMAKE_Fortran_FORMAT FIXED)

from the CMakeLists.txt. The compiler now determines the Fortran layout by the file extension.

@weslleyspereira weslleyspereira marked this pull request as draft February 19, 2021 21:19
@weslleyspereira weslleyspereira marked this pull request as ready for review February 22, 2021 14:10
@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Merging #494 (d71dd6e) into master (5a929d8) will increase coverage by 0.04%.
The diff coverage is 99.56%.

❗ Current head d71dd6e differs from pull request most recent head 38aeb8b. Consider uploading reports for the commit 38aeb8b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #494      +/-   ##
==========================================
+ Coverage   83.36%   83.41%   +0.04%     
==========================================
  Files        1820     1821       +1     
  Lines      185545   185725     +180     
==========================================
+ Hits       154673   154914     +241     
+ Misses      30872    30811      -61     
Impacted Files Coverage Δ
SRC/zlassq.f90 98.30% <98.30%> (ø)
SRC/classq.f90 100.00% <100.00%> (ø)
SRC/dlassq.f90 100.00% <100.00%> (ø)
SRC/la_xisnan.F90 100.00% <100.00%> (ø)
SRC/slassq.f90 100.00% <100.00%> (ø)
SRC/dcombssq.f 87.50% <0.00%> (-12.50%) ⬇️
SRC/scombssq.f 87.50% <0.00%> (-12.50%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6728b6d...38aeb8b. Read the comment docs.

@weslleyspereira
Copy link
Collaborator Author

I have just added Doxygen preambles to all new files. The la_constants module(s) depend(s) on #501.

@langou langou added this to the LAPACK 3.10.0 milestone Mar 18, 2021
@weslleyspereira weslleyspereira force-pushed the try-xLASSQ-from-Edward-Anderson branch from a017400 to a4e4a7e Compare March 31, 2021 22:09
@weslleyspereira weslleyspereira force-pushed the try-xLASSQ-from-Edward-Anderson branch from a4e4a7e to 3606023 Compare March 31, 2021 22:11
@langou langou merged commit 0856911 into Reference-LAPACK:master Apr 6, 2021
christoph-conrads pushed a commit to christoph-conrads/lapack that referenced this pull request May 23, 2021
@langou langou mentioned this pull request May 26, 2021
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