Skip to content

SB10FD exits whole process on parameter error #126

Description

@bnavigator

In reference to #98 (comment):

[ben@voyagerS9:~]% python                                                                                                   [0]
Python 3.8.2 (default, Apr  8 2020, 14:31:25) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from slycot import synthesis
>>> from numpy import array
>>> A = array([[-1, 0, 0], [0, -12, -5], [0, 4, 0]])
>>> B = array([[2, 0], [0, 0.5], [0, 0]])
>>> C = array([[-0.5, 0, -0.5], [0, 0, 0], [-0.5, 0, -0.5]])
>>> D = array([[0, 0],  [0, 1], [0, 0]], dtype=float)
>>> synthesis.sb10fd(3, 2, 3, 1, 1, 100, A, B, C, D, 1e-7, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ben/src/Slycot/_skbuild/linux-x86_64-3.8/cmake-install/slycot/synthesis.py", line 2717, in sb10fd
    raise_if_slycot_error(out[-1], arg_list, sb10fd.__doc__)
  File "/home/ben/src/Slycot/_skbuild/linux-x86_64-3.8/cmake-install/slycot/exceptions.py", line 236, in raise_if_slycot_error
    raise globals()[exception](fmessage, info)
slycot.exceptions.SlycotArithmeticError: 
The Y-Riccati equation was not solved
successfully (the controller is not admissible or
there are numerical difficulties)
>>> synthesis.sb10fd(1,1,1,0,1,1,[1],[1],[1],[1],1e-3,1)
 ** On entry to SB10FD parameter number 20 had an illegal value
[ben@voyagerS9:~]%                                                                                                          [0]

The last drop out of the whole Python process should not happen. A simple Exception should be enough. Probably have to patch the Fortran code?

Activity

  1. bnavigator commented on May 17, 2020

    @bnavigator
    CollaboratorAuthor

    A quick search on the internet reveals that various libs override XERBLA not to STOP.

    From the netlib docu:

    Installers may consider modifying the STOP statement in order to
    call system-specific exception-handling facilities.

    So Travis CI and my OpenSUSE system work fine with the sb10fd unit tests. Apparently not on the Archlinux system I tested this with...

  2. repagh commented on May 18, 2020

    @repagh
    Member

    Is this dependent on the LAPACK version used? Which LAPACK does this link to?

  3. bnavigator commented on May 18, 2020

    @bnavigator
    CollaboratorAuthor

    openblas 0.3.9 on Archlinux.

    libopenblas_pthreads 0.3.9 on OpenSUSE does not exhibit this behavior.

  4. bnavigator commented on May 19, 2020

    @bnavigator
    CollaboratorAuthor

    Interestingly Job 387.4 for #129 should fail but does not, because of this bug.

    1528$ pytest --pyargs slycot --cov=$slycot_dir --cov-config=../Slycot/.coveragerc
    1529============================= test session starts ==============================
    1530platform linux -- Python 3.8.1, pytest-5.3.5, py-1.8.0, pluggy-0.13.1
    1531rootdir: /home/travis/build/python-control/slycot-coverage
    1532plugins: cov-2.8.1
    1533collected 107 items                                                            
    1534
    1535tests/test_ab01.py F                                                     [  0%]
    1536tests/test_ab08n.py ..                                                   [  2%]
    1537tests/test_ag08bd.py ....                                                [  6%]
    1538tests/test_analysis.py ...................                               [ 24%]
    1539tests/test_examples.py .............                                     [ 36%]
    1540tests/test_exceptions.py ..                                              [ 38%]
    1541tests/test_mb.py ..........                                              [ 47%]
    1542tests/test_mc.py ...                                                     [ 50%]
    1543tests/test_sb.py ...The command "pytest --pyargs slycot --cov=$slycot_dir --cov-config=../Slycot/.coveragerc" exited with 0.
    

    The Travis jobs suffering from this bug use the Netlib reference LAPACK implementation. I wonder if my Archlinux system also uses that despite having compiled against openblas...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions