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

Add Index-64 API as extended API with _64 suffix for LAPACKE #888

Merged
merged 18 commits into from
Feb 10, 2024

Conversation

mkrainiuk
Copy link
Contributor

@mkrainiuk mkrainiuk commented Jul 28, 2023

Description
This PR enables extended 64-bit Integer API with _64 suffix for LAPACKE and its dependencies (#666).

As it was suggested in #666 Fortran API renaming happens via common header file SRC/lapack_64.h instead of compilation flag. So potentially same file could be reused in other projects. But this approach requires Fortran compiler to support preprocessing. So I had to remove new header file from Fortran files (the header is added during the build to the local copy of each file 32d3f56) and enabled new extended API only for GNU and Intel compilers (fac7a32), based on my experiments LLVM compiler has some problems with preprocessing Fortran.

Please note, for the migration simplification (and it was also one of Julia language community feedback) the extended API with _64 suffix is added to ALL functionality, including functions that don't have Integer type in the API.

Most of the changes in LAPACK address the problem with FORTRAN 77 line length limitation. All FORTRAN 77 lines with LAPACK API and length > 69 symbols failed because of 3 more symbols with _64. Since I'm not sure this project uses any linter tools, I run my local script for simply moving the last argument from the affected line to the new line, all changes made by the script are grouped to:

  • 185aa3d for LAPACK
  • 3970a1a for MATGEN
  • and some manual changes after rebasing on the latest master 8da80f0

Let me know if the code should be updated with some linter tool.

There was also a problem with missed MOD files in LAPACK parallel build (the file that needs the MOD file could be compiled before the file that has the required modules). PR includes the fix for it b658fd6.

Checklist

  • The documentation has been updated. LAPACK documentation is in PDF format, I can't update.
  • If the PR solves a specific issue, it is set to be closed on merge. It addresses LAPACK part in CBLAS/LAPACKE extension for 64bit integer #666
  • Local testing and new LAPACKE _64 examples passed

-fdefault-integer-8 and -Werror=conversion caused build errors in CI because of implicit casting INTEGER to REAL or COMPLEX in many files. Existing flag "-DBUILD_INDEX64=ON" has the same problem with this flag. The following commits address this problem by changing casting from implicit to explicit:

All CI steps passed after rebasing, continuous-integration/appveyor/pr step problem was cause by LLVM Fortran compiler, since now the extended API is disabled for this compiler, this step also passed.

@mkrainiuk mkrainiuk marked this pull request as draft July 28, 2023 22:00
@mkrainiuk mkrainiuk force-pushed the lapacke_64 branch 6 times, most recently from 1b5a4b2 to d3bcc3a Compare August 1, 2023 17:47
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (827cb8e) 0.00% compared to head (bc5d836) 0.00%.
Report is 3 commits behind head on master.

Files Patch % Lines
INSTALL/droundup_lwork.f 0.00% 1 Missing ⚠️
INSTALL/sroundup_lwork.f 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master     #888    +/-   ##
========================================
  Coverage    0.00%    0.00%            
========================================
  Files        1930     1929     -1     
  Lines      190409   190627   +218     
========================================
- Misses     190409   190627   +218     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mkrainiuk mkrainiuk marked this pull request as ready for review August 1, 2023 18:34
@weslleyspereira
Copy link
Collaborator

Hi @mkrainiuk. Would you be able to merge to/rebase with the current master? The script for the Github Actions needed to be updated. Thanks

@mkrainiuk
Copy link
Contributor Author

Hi @mkrainiuk. Would you be able to merge to/rebase with the current master? The script for the Github Actions needed to be updated. Thanks

Thanks @weslleyspereira! After rebasing everything is passing except for continuous-integration/appveyor/pr I'm investigating why.

Copy link
Collaborator

@angsch angsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I have only looked at the examples - this is not a proper review)

For the DGESV examples, wouldn't it be good to just hard-code a sample matrix? I find the number of lines dedicated to command line argument parsing, and memory handling a bit too high for a what I assume shall be a simple example of how to call the LAPACKE function. Further, for the sake of readability, please fix the indentation and line breaks of the DGESV examples.


/* Initialization */
lda=n, ldb=n;
A = (double *)malloc(n*n*sizeof(double)) ;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

free() is missing (2 more occurrences in this file and 3 more in the row major counterpart)

Copy link
Contributor Author

@mkrainiuk mkrainiuk Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it, fixed both the original examples and the ones with extended API.

@mkrainiuk mkrainiuk force-pushed the lapacke_64 branch 7 times, most recently from af63fd0 to fac7a32 Compare January 3, 2024 02:16
@mkrainiuk
Copy link
Contributor Author

@langou since all tests passed now please let me know if there is something else I need to complete in order to merge the PR?

@langou langou merged commit c6bc401 into Reference-LAPACK:master Feb 10, 2024
14 checks passed
@langou
Copy link
Contributor

langou commented Feb 10, 2024

Thanks for the reminder @mkrainiuk

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.

4 participants