You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.md 3.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. RELAPACK Configuration
  2. ======================
  3. ReLAPACK has two configuration files: `make.inc`, which is included by the
  4. Makefile, and `config.h` which is included in the source files.
  5. Build and Testing Environment
  6. -----------------------------
  7. The build environment (compiler and flags) and the test configuration (linker
  8. flags for BLAS and LAPACK) are specified in `make.inc`. The test matrix size
  9. and error bounds are defined in `test/config.h`.
  10. The library `librelapack.a` is compiled by invoking `make`. The tests are
  11. performed by either `make test` or calling `make` in the test folder.
  12. BLAS/LAPACK complex function interfaces
  13. ---------------------------------------
  14. For BLAS and LAPACK functions that return a complex number, there exist two
  15. conflicting (FORTRAN compiler dependent) calling conventions: either the result
  16. is returned as a `struct` of two floating point numbers or an additional first
  17. argument with a pointer to such a `struct` is used. By default ReLAPACK uses
  18. the former (which is what gfortran uses), but it can switch to the latter by
  19. setting `COMPLEX_FUNCTIONS_AS_ROUTINES` (or explicitly the BLAS and LAPACK
  20. specific counterparts) to `1` in `config.h`.
  21. **For MKL, `COMPLEX_FUNCTIONS_AS_ROUTINES` must be set to `1`.**
  22. (Using the wrong convention will break `ctrsyl` and `ztrsyl` and the test cases
  23. will segfault or return errors on the order of 1 or larger.)
  24. BLAS extension `xgemmt`
  25. -----------------------
  26. The LDL decompositions require a general matrix-matrix product that updates only
  27. a triangular matrix called `xgemmt`. If the BLAS implementation linked against
  28. provides such a routine, set the flag `HAVE_XGEMMT` to `1` in `config.h`;
  29. otherwise, ReLAPACK uses its own recursive implementation of these kernels.
  30. `xgemmt` is provided by MKL.
  31. Routine Selection
  32. -----------------
  33. ReLAPACK's routines are named `RELAPACK_X` (e.g., `RELAPACK_dgetrf`). If the
  34. corresponding `INCLUDE_X` flag in `config.h` (e.g., `INCLUDE_DGETRF`) is set to
  35. `1`, ReLAPACK additionally provides a wrapper under the LAPACK name (e.g.,
  36. `dgetrf_`). By default, wrappers for all routines are enabled.
  37. Crossover Size
  38. --------------
  39. The crossover size determines below which matrix sizes ReLAPACK's recursive
  40. algorithms switch to LAPACK's unblocked routines to avoid tiny BLAS Level 3
  41. routines. The crossover size is set in `config.h` and can be chosen either
  42. globally for the entire library, by operation, or individually by routine.
  43. Allowing Temporary Buffers
  44. --------------------------
  45. Two of ReLAPACK's routines make use of temporary buffers, which are allocated
  46. and freed within ReLAPACK. Setting `ALLOW_MALLOC` (or one of the routine
  47. specific counterparts) to 0 in `config.h` will disable these buffers. The
  48. affected routines are:
  49. * `xsytrf`: The LDL decomposition requires a buffer of size n^2 / 2. As in
  50. LAPACK, this size can be queried by setting `lWork = -1` and the passed
  51. buffer will be used if it is large enough; only if it is not, a local buffer
  52. will be allocated.
  53. The advantage of this mechanism is that ReLAPACK will seamlessly work even
  54. with codes that statically provide too little memory instead of breaking
  55. them.
  56. * `xsygst`: The reduction of a real symmetric-definite generalized eigenproblem
  57. to standard form can use an auxiliary buffer of size n^2 / 2 to avoid
  58. redundant computations. It thereby performs about 30% less FLOPs than
  59. LAPACK.
  60. FORTRAN symbol names
  61. --------------------
  62. ReLAPACK is commonly linked to BLAS and LAPACK with standard FORTRAN interfaces.
  63. Since these libraries usually have an underscore to their symbol names, ReLAPACK
  64. has configuration switches in `config.h` to adjust the corresponding routine
  65. names.