-
Notifications
You must be signed in to change notification settings - Fork 480
Add safe scaling xLARTG from https://doi.org/10.1145/3061665 #493
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #493 +/- ##
==========================================
- Coverage 83.41% 83.31% -0.10%
==========================================
Files 1821 1820 -1
Lines 185725 170835 -14890
==========================================
- Hits 154914 142334 -12580
+ Misses 30811 28501 -2310
Continue to review full report at Codecov.
|
|
So this is related to #419 when we had potential infinite loop. Ed's code does not have infinite loops. (Since there is no loop!) I think it was good to have PR #419. Now I also think that Ed's codes are better and we should move to this. Ed gave us quite some codes, so this PR is a first attempt to integrate in a limited fashion the codes. In addition, Ed gave us some nice testing for these subroutines. That quite exercises the range of the IEEE numbers. The code are in F90. The syntax is not the one from legacy LAPACK. This sounds good to me. Comments on the PR welcome. It could be good to check #411 with this set of codes work with the matrix in #411. |
|
You might also find this one as an interesting read (in case you already haven't) https://arxiv.org/pdf/1904.09481 |
|
Minor comment - to my knowledge, "DEPRECATED" has been used for functions that got removed from canonical LAPACK for some reason, but may still be required by older software. Accordingly there is a BUILD_DEPRECATED option to revive them. I do not think there is an "attic" for superseded algorithms, and perhaps with git it is not needed. |
|
I also don't think the deprecation is necessary. The interface is exactly the same, most users won't (and shouldn't) notice the change. The code looks good, i don't mind fortran 90. I'm a bit worried about the documentation though, can doxygen parse that different format? |
|
Hi @martin-frbg and @thijssteel, @martin-frbg describes this as "an "attic" for superseded algorithms", yes that was exactly the intent of placing the superseded routines in DEPRECATED. Maybe we should have an ATTIC folder then. (Not kidding.) I am fine either ways on this issue. DEPRECATED, ATTIC, or not storing them. Since both @martin-frbg and @thijssteel seem in favor to not storing, fine with me. Probably cleaner to just move on, and remove the routines from the distribution and the master plain and simple. OK with me. @thijssteel: "I'm a bit worried about the documentation though, can doxygen parse that different format?" => oh yes, good point, we need to make these routines "doxygen" friendly. And in particular the tags [in], [out], etc. are used by quite a few parser to automagically generate some wrappers, or what not. So, yes, I agree with @thijssteel, we need to add the "doxygen" preamble. Cheers, |
|
Some more remarks:
|
Some other questions:
Thanks! |
|
To be clear, i'm not against modules. I just expressed some (minor) concern that A better solution might be determining them on compilation time if that's possible. And even then, do we even care about those machines? |
A bit out of scope for this PR, but anyway. I use vscode, with some plugins you can get syntax highlighting and some error checking. I also wrote https://github.com/thijssteel/fortranfixedformlinter. It's a really basic linter that can automatically handle line continuations, but its a bit too agressive for LAPACK. |
I'm sorry if I expressed myself badly. Let me give a more complete explanation about what I meant:
|
I created a Doxygen preamble for |
|
I have just added Doxygen preambles to all new files. The |
…/3061665; Let the compiler determine the Fortran layout by the file extension
92cd6f1 to
f1550e0
Compare
…RTG-from-Edward-Anderson Add safe scaling xLARTG from https://doi.org/10.1145/3061665
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 xLARTG with Edward's safe scaling xLARTG codes.
Since the codes were written in the Fortran90 standard, I removed
from the
CMakeLists.txt. The compiler now determines the Fortran layout by the file extension.