Menu

ILU preconditioners with Armadillo matrices?

2016-07-19
2016-07-22
  • Varun Shankar

    Varun Shankar - 2016-07-19

    Hi,

    I am developing a library on Visual Studio 2012 (Windows 10, x64).

    I've hooked up ViennaCL to my code primarily to "invert" the sparse matrices I get out of Armadillo. The latter is used extensively in my code and can't be easily swapped out. I am using ViennaCL's bicgstab to invert a large sparse matrix. Armadillo is hooked up to Intel's MKL.

    I have 3 questions about interfacing ViennaCL with Armadillo that the examples didn't quite make clear.

    1. Is the standard bicgstab solver automatically parallelized with OpenMP even if a preconditioner isn't used? This doesn't seem to be the case, as my core utilization doesn't seem to show this.

    2. How does one go about hooking up the ILU preconditioner to my Armadillo matrix? It is not symmetric, and Armadillo uses the CSC format.

    3. Is the ILU-preconditioned bicgstab solver automatically parallelized on OpenMP?

    I would appreciate your help, possibly with code examples for 2!

    Thanks,

    Varun Shankar
    University of Utah

     
  • Karl Rupp

    Karl Rupp - 2016-07-19

    Hi Varun,

    1.) BiCGStab is parallelized via OpenMP if VIENNACL_WITH_OPENMP is defined (before including any ViennaCL headers) and OpenMP support is enabled in the compiler.

    2.) You have to transfer the data from your Armadillo matrix over to the viennacl::compressed_matrix if you want to use a preconditioner. Use viennacl::copy() to do so.

    3.) ILU-preconditioned BiCGStab is only OpenMP-parallelized if the conditions of 1.) are fulfilled and if the ILU-preconditioner you use is the chow_patel_ilu. Standard ILU0 or ILUT are not parallelized, because these are inherently sequential algorithms.

    Best regards,
    Karli

     
  • Varun Shankar

    Varun Shankar - 2016-07-22

    Hi Karli,

    Thanks for the prompt reply! This clears up a lot for me.

    A follow-up question: Armadillo allows you to directly access the matrix data with a pointer. Can ViennaCL utilize this, rather than forcing a copy into a viennacl::compressed_matrix? I imagine these copies will slow down my program if my matrix is changing every time-step in a simulation.

    Thanks again,

    Varun

     

Log in to post a comment.