Skip to content

In LAPACKE tgsen, allocate iwork when ijob = 0. Fixes #772. #773

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
merged 1 commit into from
Dec 1, 2022

Conversation

mgates3
Copy link
Collaborator

@mgates3 mgates3 commented Dec 1, 2022

Description
Allocates iwork when ijob = 0. See issue #772.
Before, ijob = 0 segfaults:

lapackpp/test> ./tester --ijob 1,2,3,4,5,0 --dim 10 tgsen
LAPACK++ version 2022.07.00, id c878e31
input: ./tester --ijob '1,2,3,4,5,0' --dim 10 tgsen
                                                                              
type   ijob  jobvl  jobvr       n     error   time (s)  ref time (s)  status  
   d      1  novec  novec      10  0.00e+00   0.000617      0.000517  pass    
   d      2  novec  novec      10  0.00e+00    0.00151       0.00160  pass    
   d      3  novec  novec      10  0.00e+00    0.00405       0.00277  pass    
   d      4  novec  novec      10  0.00e+00    0.00120       0.00121  pass    
   d      5  novec  novec      10  0.00e+00    0.00345       0.00319  pass    
Segmentation fault

After, it passes:

lapackpp/test> ./tester --ijob 1,2,3,4,5,0 --dim 10 tgsen
LAPACK++ version 2022.07.00, id c878e31
input: ./tester --ijob '1,2,3,4,5,0' --dim 10 tgsen
                                                                              
type   ijob  jobvl  jobvr       n     error   time (s)  ref time (s)  status  
   d      1  novec  novec      10  0.00e+00    0.00132       0.00121  pass    
   d      2  novec  novec      10  0.00e+00    0.00272       0.00283  pass    
   d      3  novec  novec      10  0.00e+00    0.00376       0.00300  pass    
   d      4  novec  novec      10  0.00e+00    0.00131       0.00122  pass    
   d      5  novec  novec      10  0.00e+00    0.00314       0.00312  pass    
   d      0  novec  novec      10  0.00e+00   0.000246      0.000236  pass    
All tests passed for tgsen.

Checklist

  • The documentation has been updated.
  • If the PR solves a specific issue, it is set to be closed on merge.

@langou
Copy link
Contributor

langou commented Dec 1, 2022

Thanks @mgates3. In addition the comments of xTGSEN read:
IWORK is INTEGER array, dimension (MAX(1,LIWORK))
Yup, we do want IWORK to be allocated in LAPACKE. (In particular since we do write in IWORK(1) as you point out.)

@langou langou merged commit 687bec3 into Reference-LAPACK:master Dec 1, 2022
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.

2 participants