-
Notifications
You must be signed in to change notification settings - Fork 383
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
Disable FP checks for a certain LAPACK routine. #1268
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,7 +216,12 @@ subroutine tridag_solve & | |
|
||
use clubb_precision, only: & | ||
core_rknd ! Variable(s) | ||
|
||
#ifndef NDEBUG | ||
#ifdef ARCH_MIC_KNL | ||
use, intrinsic :: ieee_exceptions | ||
!use, intrinsic :: ieee_arithmetic | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove this commented out line if it is not required to keep it for future reference? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can remove the comment. Are we no longer fans of comments? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to keep the descriptive comments you added about why these line are added. I was just talking about removing the line |
||
#endif | ||
#endif | ||
implicit none | ||
|
||
! External | ||
|
@@ -265,9 +270,24 @@ subroutine tridag_solve & | |
! SUBROUTINE DGTSV( N, NRHS, DL, D, DU, B, LDB, INFO ) | ||
!----------------------------------------------------------------------- | ||
|
||
|
||
if ( kind( diag(1) ) == dp ) then | ||
call dgtsv( ndim, nrhs, subd(2:ndim), diag, supd(1:ndim-1), & | ||
#ifndef NDEBUG | ||
#ifdef ARCH_MIC_KNL | ||
! when floating-point exceptions are turned on, this call was failing with a div-by-zero on KNL with Intel/MKL. Solution | ||
! was to turn off exceptions only here at this call (and only for machine with ARCH_MIC_KNL defined) (github 1183) | ||
call ieee_set_halting_mode(IEEE_DIVIDE_BY_ZERO, .false.) ! Turn off stopping on div-by-zero only | ||
!call ieee_set_halting_mode(ieee_usual, .false.) ! Turn off stopping on all floating-point exceptions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, can we remove the commented out lines (except the descriptive comments) unless they are necessary to keep? Otherwise, it all looks good to me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can remove comments. There are two different ways to turn on/off floating-point issues and I thought that some machines/compilers might have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From your explanation above, I think it makes sense to keep these lines for future reference. |
||
#endif | ||
#endif | ||
call dgtsv( ndim, nrhs, subd(2:ndim), diag, supd(1:ndim-1), & | ||
rhs, ndim, info ) | ||
#ifndef NDEBUG | ||
#ifdef ARCH_MIC_KNL | ||
call ieee_set_halting_mode(IEEE_DIVIDE_BY_ZERO, .true.) ! Turn back on stopping on div-by-zero only | ||
!call ieee_set_halting_mode(ieee_usual, .true.) ! Turn off stopping on all floating-point exceptions | ||
#endif | ||
#endif | ||
|
||
else if ( kind( diag(1) ) == sp ) then | ||
call sgtsv( ndim, nrhs, subd(2:ndim), diag, supd(1:ndim-1), & | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ndkeen : Would you please let me know why it is necessary to comment out this CPP directive? I may have missed it while you were discussing this issue in issue #1183
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessary. This macro addresses an old issue where LAPACK may not have had the isnan() function, which they probably all have now. I don't think we need it. If you would like me to take it out of the PR, I can do that. However, I think it is more efficient to clean-up things like this as we go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. If you think it is no longer required, please remove this altogether (rather than commenting out), otherwise all these commented out lines will stay in the code forever.