The meaning of some magic number in EVD process using ARM PL

I am currently using the ARM PL EVD chbevd API, and I want to understand why there are quite a few "magic numbers" when using this API.

  1. Is it possible to understand the meaning of these numbers?
  2. Is it feasible to incorporate these numbers directly into the API design to hide them from the user?

Thanks!

ARM PL chbevd

Parents
  • Hi.

    The magic numbers are there because the reference LAPACK implementation does not allocate memory in their implementations.  That mean that optimized versions, like Arm Performance Libraries, all have to follow suit to ensure code is portable.

    All variables work WORK in the name are to do with workspaces that are used in the solving of the problem, with somebeing the workspace themselves and other denoting the size.  This is common throughout LAPACK routines.

    In the example you show the function can be called in "query" mode by setting LWORK/LRWORK to -1 which then returns the optimal values to set these to be to the user.  Using that mechanism allows the users code to be automated without learning those numbers (for this function).

              If LWORK = -1, then a workspace query is assumed; the routine
              only calculates the optimal sizes of the WORK, RWORK and
              IWORK arrays, returns these values as the first entries of
              the WORK, RWORK and IWORK arrays, and no error message
              related to LWORK or LRWORK or LIWORK is issued by XERBLA.

    Hope this helps.

    Chris

Reply
  • Hi.

    The magic numbers are there because the reference LAPACK implementation does not allocate memory in their implementations.  That mean that optimized versions, like Arm Performance Libraries, all have to follow suit to ensure code is portable.

    All variables work WORK in the name are to do with workspaces that are used in the solving of the problem, with somebeing the workspace themselves and other denoting the size.  This is common throughout LAPACK routines.

    In the example you show the function can be called in "query" mode by setting LWORK/LRWORK to -1 which then returns the optimal values to set these to be to the user.  Using that mechanism allows the users code to be automated without learning those numbers (for this function).

              If LWORK = -1, then a workspace query is assumed; the routine
              only calculates the optimal sizes of the WORK, RWORK and
              IWORK arrays, returns these values as the first entries of
              the WORK, RWORK and IWORK arrays, and no error message
              related to LWORK or LRWORK or LIWORK is issued by XERBLA.

    Hope this helps.

    Chris

Children
No data