parallel_batch_greedy

Implementation of a parallel batch greedy algorithm for reduced basis methods related to the linked paper.

https://github.com/niklasreich/parallel_batch_greedy

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Implementation of a parallel batch greedy algorithm for reduced basis methods related to the linked paper.

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 5
  • Releases: 0
Created over 1 year ago · Last pushed 12 months ago
Metadata Files
Readme Contributing License Code of conduct Citation Authors

README.md

Parallel Batch Greedy Algorithm

This repository includes the code to reproduce the results of the paper

"A parallel batch greedy algorithm in reduced basis methods: Convergence rates and numerical results",
Niklas Reich, Karsten Urban, Jürgen Vorloeper, 2024.
arXiv: https://arxiv.org/abs/2407.11631
doi: https://doi.org/10.48550/arXiv.2407.11631

License

This code is built upon pyMOR and therefore includes a full pyMOR distribution.

The authors of this repository created/adapted the followoing files:

  • src/batchgreedydemos/thermalblock.py
  • src/pymor/algorithms/batchgreedy.py
  • src/bindings/scipy.py

See these files for more information.

pyMOR License

Copyright pyMOR developers and contributors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The following files contain source code originating from other open source software projects:

  • docs/source/pymordocstring.py (sphinxcontrib-napoleon)
  • src/pymor/algorithms/genericsolvers.py (SciPy)

See these files for more information.

Desciption of Code

Changed & Created Files

src/batchgreedydemos/thermalblock.py

Implementation of the model problem introduced in the paper. Arguments allow to vary the number of blocks in the domain, as well as the number of discrete values per block for the thermal conductivity. This file is meant to be executed (see below).

src/pymor/algorithms/batchgreedy.py

Implementation of the parallel batch greedy algorithm as presented in the paper (see Algorithm 3).

src/bindings/scipy.py

Small adaption to make the use of UMFPACK possible (see below for details).

Other files

All other code files stem from the used pyMOR distribution. We refer to the official documentation.

Installation

Necessary Packages

This software has been developed with Python 3.10. We recommend an installation via pip in a virtual environment. To install this software, clone this repository or download it. When you have navigated to the top level of your local copy, use

pip install -e .

to install all the necessary packages to run the code.

Optional Packages

To reproduce the results of the paper, you need to install two additional optional software components/packages.

MPI & mpi4py

MPI is needed to compute the batch in parallel, as intended. For more information on how to install MPI see here. For many Linux distributions, it is already installed.
To use MPI with Python we need an interface from the mpi4py package that can be installed via

pip install mpi4py

SuiteSparse & scikit-umfpack

SuiteSparse is "a suite of sparse matrix algorithms". Among others, it includes UMFPACK, a multifrontal LU factorization. This implementation can be used instead of the standard implementation of splu by SciPy. How SuiteSparse & scikit-umfpack can be installed is described here. If the software is installed correctly, the UMFPACK-implementation is used automatically.

Start the Benchmark

The benchmark problem that is described in the paper is found within the file src/batchgreedydemos/thermalblock.py. After navigating to the directory src/batchgreedydemos/, execute the code with

python thermalblock.py [xblocks] [yblocks] [snapshots] [batchsize]

Here [xblocks] is the number of blocks in x direction, [yblocks] is the number of blocks in y direction, [snapshots] is the number of discrete values per block for the thermal conductivity, and [batchsize] is the batch size of the parallel greedy algorithm. By setting [batchsize] to 1 we get a classical weak greedy algorithm.

When the code runs successfully, it will output a text-based summary at the end, which sums up the used configuration as well as the results.

If you have MPI installed, you can leverage a parallel worker pool by executing

mpiexec -n [numproc] python thermalblock.py [xblocks] [yblocks] [snapshots] [batchsize]

where [numproc] is the number of workers.

To give a concrete example, the results of the paper were created by executing

mpiexec -n 30 python thermalblock.py 2 2 25 [batchsize]
mpiexec -n 30 python thermalblock.py 3 3 5 [batchsize]

and [batchsize] was set to 1, ... , 16, respectively.

Smaller Test configuration

If you just want to make sure that the code runs, you can use

python thermalblock.py [xblocks] [yblocks] [snapshots] [batchsize] --test-config

This changes some otherwise static parameters[^1], so that the benchmark finishes much faster. For example

python thermalblock.py 2 2 5 3 --test-config

should finish in under a minute.

Of course, when using the test configuration, the results are not related to the results presented in the paper.

[^1]: The order of the full model is reduced (coarser spatial discretization), the size of the test set for the error analysis is reduced, and the size of the test set for the benchmarking of the reduced model is lowered.

Owner

  • Login: niklasreich
  • Kind: user

Citation (CITATION.cff)

# YAML 1.2
---
title: pyMOR
authors:
  - family-names: Fritze
    given-names: René
    orcid: https://orcid.org/0000-0002-9548-2238
  - family-names: Rave
    given-names: Stephan
    orcid: https://orcid.org/0000-0003-0439-7212
  - family-names: Schindler
    given-names: Felix
    orcid: https://orcid.org/0000-0003-1582-7118
  - family-names: Mlinarić
    given-names: Petar
    orcid: https://orcid.org/0000-0002-9437-7698
  - family-names: Balicki
    given-names: Linus
    orcid: https://orcid.org/0000-0002-8901-2889
cff-version: "1.2.0"
preferred-citation:
  title: pyMOR -- Generic Algorithms and Interfaces for Model Order Reduction
  doi: "10.1137/15M1026614"
  type: article
  authors:
  - family-names: Milk
    given-names: René
    orcid: https://orcid.org/0000-0002-9548-2238
  - family-names: Rave
    given-names: Stephan
    orcid: https://orcid.org/0000-0003-0439-7212
  - family-names: Schindler
    given-names: Felix
    orcid: https://orcid.org/0000-0003-1582-7118
message: If you use this software, please cite both the article from preferred-citation and the software itself.
...

GitHub Events

Total
  • Delete event: 2
  • Issue comment event: 9
  • Pull request event: 6
  • Create event: 6
Last Year
  • Delete event: 2
  • Issue comment event: 9
  • Pull request event: 6
  • Create event: 6

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.17
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 6
Past Year
  • Issues: 0
  • Pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.17
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (15)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/add_labels.yml actions
  • actions-ecosystem/action-add-labels v1.1.3 composite
  • actions/checkout v3 composite
  • actions/labeler v4 composite
.github/workflows/autoupdate.yml actions
  • chinthakagodawita/autoupdate-action v1.6.0 composite
.github/workflows/citation.yml actions
  • actions/checkout v3 composite
  • citation-file-format/cffconvert-github-action 2.0.0 composite
.github/workflows/conda_tests.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3 composite
  • conda-incubator/setup-miniconda v2 composite
  • martijnhols/actions-cache v3.0.11 composite
  • martijnhols/actions-cache/restore v3.0.11 composite
  • styfle/cancel-workflow-action 0.11.0 composite
.github/workflows/dependencies_change.yml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • conda-incubator/setup-miniconda v2 composite
  • peter-evans/create-pull-request v4.2.2 composite
.github/workflows/enforce-labels.yml actions
  • yogevbd/enforce-label-action 2.2.2 composite
.github/workflows/git_checks.yml actions
  • actions/checkout v3 composite
  • olivernybroe/action-conflict-finder v4.0 composite
  • xt0rted/block-autosquash-commits-action v2 composite
.github/workflows/link_check.yml actions
  • actions/checkout v3 composite
  • renefritze/github-action-markdown-link-check master composite
.github/workflows/linter.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
.github/workflows/process_linter_results.yml actions
  • actions/github-script v5 composite
  • actions/setup-python v4 composite
.github/workflows/pytest_results.yml actions
  • EnricoMi/publish-unit-test-result-action v1.40 composite
.binder/Dockerfile docker
  • ${BASE} latest build
.binder/docker-compose.yml docker
  • pymor/deploy_checks devpi_${PYMOR_TEST_OS}
  • pymor/local_dev ${CI_IMAGE_TAG}
  • zivgitlab.wwu.io/pymor/docker/pymor/deploy_checks_${PYMOR_TEST_OS} ${PYPI_MIRROR_TAG}
  • zivgitlab.wwu.io/pymor/docker/pymor/devpi ${CI_IMAGE_TAG}
  • zivgitlab.wwu.io/pymor/docker/pymor/pypi-mirror_${PYPI_MIRROR}_py${DOCKER_BASE_PYTHON} ${PYPI_MIRROR_TAG}
  • zivgitlab.wwu.io/pymor/docker/pymor/testing_py${DOCKER_BASE_PYTHON} ${CI_IMAGE_TAG}
pyproject.toml pypi
requirements-ci.txt pypi
  • check-manifest ==0.48
  • check_reqs ==0.2.0
  • codecov ==2.1.12
  • docutils ==0.18.1
  • flake8-docstrings ==1.6.0
  • flake8-rst-docstrings ==0.2.6
  • hypothesis ==6.56.3
  • pybind11 ==2.9.2
  • pypi-oldest-requirements ==2021.2.0
  • pyqt5 ==5.15.7
  • pyqt5-qt5 ==5.15.2
  • pytest ==7.1.2
  • pytest-cov ==3.0.0
  • pytest-memprof ==0.2.0
  • pytest-notebook ==0.8.0
  • pytest-parallel ==0.1.1
  • pytest-regressions ==2.3.1
  • pytest-xdist ==2.5.0
  • readme_renderer ==35.0
  • rstcheck ==6.0.0.post1
  • scikit-fem ==6.0.0
  • twine ==3.8.0
requirements-optional.txt pypi
  • PySide2 >=5.15.2.1
  • bash_kernel *
  • click *
  • diskcache *
  • dune-gdt >=2021.1.3
  • dune-xt >=2021.1.3
  • gmsh *
  • ipyparallel >=6.2.5
  • ipython >=5.0
  • ipywidgets <8,>7
  • jupyter_client >=7.0.6
  • jupyter_contrib_nbextensions *
  • lxml *
  • matplotlib *
  • meshio >=4.4
  • mpi4py >=3.0.3
  • mpi4py >=3.0
  • myst-nb >=0.16
  • nbresuse *
  • numpy >=1.17.5,<1.24
  • numpy >=1.19.4,<1.24
  • packaging *
  • pillow *
  • pyevtk *
  • pygments *
  • pymess *
  • pyopengl *
  • pytest ==7.1.2
  • python-slugify *
  • pythreejs *
  • qtpy >2.0
  • scipy >=1.3.3
  • scipy >=1.3
  • scipy >=1.5.4
  • slycot >=0.4.0
  • sphinx >=5.0,<5.2
  • sphinx-autoapi >=1.8,<2
  • sphinx-material *
  • sphinx-qt-documentation *
  • sphinxcontrib-bibtex *
  • sympy *
  • torch *
  • typer *
  • xmljson *
requirements.txt pypi
  • click *
  • diskcache *
  • numpy >=1.17.5,<1.24
  • numpy >=1.19.4,<1.24
  • packaging *
  • pytest-runner >=2.9
  • qtpy >2.0
  • scipy >=1.3.3
  • scipy >=1.3
  • scipy >=1.5.4
  • setuptools *
  • typer *
  • wheel *
setup.py pypi