Skip to content

Pressio/pressio-distributed-linalg

Repository files navigation

Overview

pressio-tools includes Python bindings providing the following functionalities:

  • computation of sample mesh indices for hyper-reduction via

    • leverage scores: using algorithm 5.1 of this paper

    • other methods to come soon

  • SVD for shared- or distributed-memory (tall-skinny) matrix

  • QR factorization of a shared- or distributed-memory (tall-skinny) matrix

pressio-tools is self-contained but mainly developed as an auxiliary tool to pressio.

Installing

We provide two separate build/installation modes:

  • to work only on shared-memory data:

    • basic mode requiring only Python and a C++ compiler; intended to get you started quickly
    • see the wiki page.
  • to work on potentially distributed-memory data:

    • more advanced mode relying on MPI and Trilinos to operate on potentially distributed large-scale data
    • see the wiki page.

Usage

Interested in the leverage scores-based sample mesh functionality?

  • Look at the sharedmemory demo where data is read from a single ascii file

    • the matrix is stored in a single file
    • Run as:
    export PTOOLSREPO=<fullpath-to-your-pressio-tools-clone>
    export DEMODIR=${PTOOLSREPO}/demos/samplemesh_levscores_onnode_via_driver_script
    cd ${PTOOLSREPO}/driver-scripts
    python3 hypred_levscores.py --input ${DEMODIR}/input.yaml --data-dir=${DEMODIR}
  • Look at the parallel demo where data is split over multiple ascii files

    • the matrix is block-row distributed, stored as "matrix.txt.3.i", where i=0,1,2 is the MPI rank
    • Run as:
    export PTOOLSREPO=<fullpath-to-your-pressio-tools-clone>
    export DEMODIR=${PTOOLSREPO}/demos/samplemesh_levscores_parallel_via_driver_script
    cd ${PTOOLSREPO}/driver-scripts
    mpirun -n 3 python3 hypred_levscores.py --input ${DEMODIR}/input.yaml --data-dir=${DEMODIR}

Interested in the SVD functionality?

  • Look at the sharedmemory demo where data is read from a single ascii file

    • the matrix is stored in a single file
    • Run as:
    export PTOOLSREPO=<fullpath-to-your-pressio-tools-clone>
    export DEMODIR=<fullpath-to-pressio-tools>/demos/svd_onnode_via_driver_script
    cd ${PTOOLSREPO}/driver-scripts
    python3 computeSVD.py --input ${DEMODIR}/input.yaml --data-dir=${DEMODIR}
  • Look at the parallel demo where data is split over multiple ascii files

    • the matrix is block-row distributed, stored as "matrix.txt.3.i", where i=0,1,2 is the MPI rank
    • Run as:
    export PTOOLSREPO=<fullpath-to-your-pressio-tools-clone>
    export DEMODIR=${PTOOLSREPO}/demos/svd_parallel_via_driver_script
    cd ${PTOOLSREPO}/driver-scripts
    mpirun -n 3 python3 computeSVD.py --input ${DEMODIR}/input.yaml --data-dir=${DEMODIR}
  • Look at the parallel demo where the parallel SVD is called within Python

    • the matrix is block-row distributed over 3 MPI ranks
    • Run as:
    cd <your-pressio-tools-clone>/demos/svd_parallel_call_from_python
    mpirun -n 3 python3 main.py

Questions?

Find us on Slack: https://pressioteam.slack.com or open an issue on github.

License and Citation

License

The full license is available here.