SuperLU FAQ
  • BLAS library
  • Windows users
  • Symmetric problems
  • Complex types

  • BLAS library

    The BLAS library in SuperLU distribution (under CBLAS/) only serves as functional purpose, but is not fast. Many vendors provide high-performance BLAS library in their math library distributions. You should try to link with those if they are available. Alternatively, you may obtain the following public-domain fast BLAS libraries:


    Windows users

    This was tested in MS Visual Studio. However the configuration highly depends on which compiler you using. Normally there is an IDE (Integrated Development Environment) editor associated with your compiler. You can do it in two steps:

    If you are using a compiler with command line only, you have to play with the makefile or -I -L -O -c options. As SuperLU calls BLAS routines but BLAS is not a native library of MS Visual Studio, you have to build your own BLAS library in the similar way as SuperLU library. The SuperLU distribution includes a C version of BLAS in SuperLU/CBLAS directory. This version is only functional but not fast. For speed, it's better to use vendor-supplied BLAS (e.g., Intel MKL) or public domain versions (e.g., ATLAS, or Goto BLAS).


    Symmetric problem

    SuperLU cannot take advantage of symmetry, but it can still solve the linear system as long as you input both the lower and upper parts of the matrix A. If off-diagonal pivoting does not occur, the U matrix in A = L*U is equivalent to D*L'.
    In many applications, matrix A may be diagonally dominant or nearly so. In this case, pivoting on the diagonal is sufficient for stability and is preferable for sparsity to off-diagonal pivoting. To do this, the user can set a small (less-than-one) diagonal pivot threshold (e.g., 0.0, 0.01, ...) and choose an (A' + A)-based column permutation algorithm. We call this setting Symmetric Mode. To use this (in serial SuperLU), you need to set:
        options.SymmetricMode = YES;
        options.ColPerm = MMD_AT_PLUS_A;
        options.DiagPivotThresh = 0.001; /* or 0.0, 0.01, etc. */
    
    An example of using symmetric mode can be found in EXAMPLE/dlinsol1.c.

    Note that, when a diagonal entry is smaller than the threshold, the code will still choose an off-diagonal pivot. That is, the row permutation P_r may not be Identity.

    The algorithm in SuperLU_DIST is already in the spirit of symmetric mode.


    Complex types

    SuperLU supports single complex and double complex data types. The double complex is defined as a pair of doubles, as follows:
      typedef struct { double r, i; } doublecomplex;
      
    For a variable "v" of doublecomplex type, you need to use "v.r" and "v.i" to refer to the real and imaginary parts, respectively. For an array "a[]" of doublecomplex type, you can refer to the k-th element by "a[k].r" or "a[k].i".