[Dune-devel] SuperLU v5 support. Ticket #1704

Maikel Nadolski nadolski at math.fu-berlin.de
Wed Mar 9 13:50:43 CET 2016


Hey,

regarding the junior job and ticket #1704

https://gitlab.dune-project.org/flyspray/FS/issues/1704

I have added rudimentary Support for SuperLU v5.1.1 in dune-istl and
made a local branch with a proper commit message but I still wait for my
account registration in GitLab. So here is the patch.

A few comments.

SuperLU moved their struct GlobalLU from `slu_ddef.h` to
`slu_util.h` and passes an instance of it to every solver call.
Their idea is to store and reuse the information in certain
situations. Its documented in their code

Glu      (input/output) GlobalLU_t *
          If options->Fact == SamePattern_SameRowPerm, it is an input;
            The matrix A will be factorized assuming that a
            factorization of a matrix with the same sparsity pattern
            and similar numerical values was performed prior to
            this one.
            Therefore, this factorization will reuse both row and column
            scaling factors R and C, both row and column permutation
            vectors perm_r and perm_c, and the L & U data structures
            set up from the previous factorization.
          Otherwise, it is an output.

I made a test setting a macro HAVE_GLOBALLU_T_IN_UTIL which fails for
older versions, because they moved the structure definition to match the
function calls better i think. It would be way better to test wether we
can link against solver functions having the correct signature instead
of this "hack" (taking 22 instead of 21 arguments). Because that is
semantically what we actually want to know. I will probably do that.

I have tested with SuperLU 4.3 and SuperLU 5.1.1 but it shouldn't be
much different with 5.0. I changed the script for finding the library to
only look for 5.1.1 and not 5.0 because i havent that version yet. The
tests work for me so far. And it looks like this:

dune-istl $ mkdir build-istl_with_SuperLU_4.3/
dune-istl $ cd build-istl_with_SuperLU_4.3/
build-istl_with_SuperLU_4.3 $ cmake ../
-DSUPERLU_ROOT=$HOME/Development/Dune/SuperLU-install_4.3
-DCMAKE_PREFIX_PATH=${STORAGE}/dune

[...]

-- Performing Test HAVE_GLOBALLU_T_IN_UTILS
-- Performing Test HAVE_GLOBALLU_T_IN_UTILS - Failed
-- Performing Test SUPERLU_MIN_VERSION_4_3
-- Performing Test SUPERLU_MIN_VERSION_4_3 - Success

[...]

build-istl_with_SuperLU_4.3 $ make build_tests
[...]
build-istl_with_SuperLU_4.3 $ ctest -R ^superlu
Test project Development/Dune/dune-istl/build-istl_with_SuperLU_4.3
    Start 11: superluamgtest
1/6 Test #11: superluamgtest ...................   Passed    1.66 sec
    Start 12: superlufastamgtest
2/6 Test #12: superlufastamgtest ...............   Passed    1.22 sec
    Start 44: superlustest
3/6 Test #44: superlustest .....................   Passed    0.13 sec
    Start 45: superlutest
4/6 Test #45: superlutest ......................   Passed    0.13 sec
    Start 46: superluctest
5/6 Test #46: superluctest .....................   Passed    0.13 sec
    Start 47: superluztest
6/6 Test #47: superluztest .....................   Passed    0.16 sec

100% tests passed, 0 tests failed out of 6

Total Test time (real) =   3.48 sec

dune-istl $ mkdir build-istl_with_SuperLU_5.1.1/
dune-istl $ cd build-istl_with_SuperLU_5.1.1/
build-istl_with_SuperLU_5.1.1 $ cmake ../
-DSUPERLU_ROOT=$HOME/Development/Dune/SuperLU-install_5.1.1
-DCMAKE_PREFIX_PATH=${STORAGE}/dune

[...]

-- Performing Test HAVE_GLOBALLU_T_IN_UTILS
-- Performing Test HAVE_GLOBALLU_T_IN_UTILS - Success
-- Performing Test SUPERLU_MIN_VERSION_4_3
-- Performing Test SUPERLU_MIN_VERSION_4_3 - Success

[...]

build-istl_with_SuperLU_5.1.1 $ make build_tests
[...]
build-istl_with_SuperLU_5.1.1 $ ctest -R ^superlu
Test project
/home/mi/guttula/Development/Dune/dune-istl/build-istl_with_SuperLU_5.1.1
    Start 11: superluamgtest
1/6 Test #11: superluamgtest ...................   Passed    1.67 sec
    Start 12: superlufastamgtest
2/6 Test #12: superlufastamgtest ...............   Passed    1.28 sec
    Start 44: superlustest
3/6 Test #44: superlustest .....................   Passed    0.17 sec
    Start 45: superlutest
4/6 Test #45: superlutest ......................   Passed    0.18 sec
    Start 46: superluctest
5/6 Test #46: superluctest .....................   Passed    0.25 sec
    Start 47: superluztest
6/6 Test #47: superluztest .....................   Passed    0.22 sec

100% tests passed, 0 tests failed out of 6

Total Test time (real) =   3.80 sec


Does this mean the results are ok? I havent looked much at what the
tests do test. Someone needs to confirm that. I am also unsure what we
can do with the GlobalLU_t structure or if they use it only internally.

But I also looked at some of the projects for GSoC nad have some
questions. Shall i write to the mailing list or directly to the mentors?

Cheers,
Maikel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: support_superlu_5.patch
Type: text/x-patch
Size: 8501 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20160309/797766f1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5498 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20160309/797766f1/attachment-0001.bin>


More information about the Dune-devel mailing list