Skip to main content

KRATOS Multiphysics ("Kratos") is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.

Project description

Multilevel Monte Carlo Application

MultilevelMonteCarloApplication provides different algorithms, belonging to the Monte Carlo (MC) family, to estimate statistics of scalar and field quantities of interest. The application is designed for running on distributed and high performance computing systems, exploiting both OpenMP and MPI parallel strategies. The application contains several interfaces with external libraries.

Getting started

This application is part of the Kratos Multiphysics Platform. Instructions on how to download, install and run the software in your local machine for development and testing purposes are available for both Linux and Windows systems.

Prerequisites

Build Kratos and make sure to have

add_app ${KRATOS_APP_DIR}/MultilevelMonteCarloApplication

in the compilation configuration, in order to compile the MultilevelMonteCarloApplication application.

Hierarchical Monte Carlo methods

  • Repeatedly generate the random input and solve the associated deterministic problem.
  • Convergence to the exact statistics as the number of realizations grows.
  • Problem under consideration considered as a black-box.
  • Convergence rate independent from stochastic space dimension.

Monte Carlo

  • Monte Carlo (MC) is the reference method in the stochastic analysis of multiphysics problems with uncertainties in the data parameters.
  • Levels of parallelism:
    • Between samples,
    • On each sample at solver level.
  • Hierarchy update:
    • Deterministic,
    • Adaptive.

Multilevel Monte Carlo

  • Multilevel Monte Carlo (MLMC) requires a hierarchy of levels with increasing accuracy to solve the statistical problem. Convergence rate is faster with respect to MC if MLMC hypotheses are satisfied.
  • Computation of a large number of cheap and lower accuracy realizations, while only few expensive high accuracy realizations are run.
    • Low accuracy levels: capture statistical variability,
    • High accuracy levels: capture discretization error.
  • Example of hierarchy of computational grids, showing increasing accuracy levels (by decreasing mesh size):

Solution

  • Levels of parallelism:
    • Between levels,
    • Between samples,
    • On each sample at solver level.
  • Hierarchy update:
    • Deterministic,
    • Adaptive.

Continuation Multilevel Monte Carlo

  • A set of decreasing tolerances is used and updated on the fly to adaptively estimate the hierarchy and run MLMC.
  • Levels of parallelism:
    • Between levels,
    • Between samples,
    • On each sample at solver level.
  • Hierarchy update:
    • Adaptive.

Asynchronous Monte Carlo

  • This algorithm is equivalent to MC, but designed for running in distributed environments. It avoids idle times and keeps at maximum the computational efficiency.
  • Levels of parallelism:
    • Between batches,
    • Between samples,
    • On each sample at solver level.
  • Hierarchy update:
    • Deterministic.

Asynchronous Multilevel Monte Carlo

  • This algorithm is equivalent to MLMC, but designed for running in distributed environments. It avoids idle times and keeps at maximum the computational efficiency.
  • Levels of parallelism:
    • Between batches,
    • Between levels,
    • Between samples,
    • On each sample at solver level.
  • Hierarchy update:
    • Deterministic.

Statistical tools

Power sums

  • Update on the fly of power sums.
  • A power sum of order p is defined as:

    .

h-statistics

  • The h-statistic of order p is the unbiased estimator with minimal variance of the central moment of order p.
  • h-statistic dependencies are

    .

Convergence criteria

  • Convergence is achieved if the estimator of interest reaches a desired tolerance with respect to the true estimator with a given confidence.
  • The failure probability to satisfy (for expected value and MC) is

.

  • Other convergence criteria available:
    • Mean square error,
    • Sample variance criteria (MC only),
    • Higher order (up to the fourth) moments criteria (MC only).

Hierarchy

  • Hierarchy strategies:

    • stochastic adaptive refinement: hierarchy of levels built refining in space, performing solution-oriented adaptive space refinement. The coarsest mesh is shared between all realizations, and for each realization different meshes are generated, accordingly to the random variable. Requires compiling MESHING_APPLICATION.
    • deterministic adaptive refinement: hierarchy of levels built refining in space, performing solution-oriented adaptive space refinement. All meshes are shared between all realizations, and adaptive refinement is done at pre-process, exploiting a user-defined random variable. Requires compiling MESHING_APPLICATION.
    • standard: the user takes care of building the hierarchy, using the strategy he prefers (such as uniform refinement).
  • Metric strategies:

    • geometric error estimate: the analysis of the hessian of the numerical solution controls the mesh refinement.
    • divergence-free error estimate: the analysis of the mass conservation controls the mesh refinement (suitable only for CFD cases). Requires compiling EXAQUTE_SANDBOX_APPLICATION. In progress.

External Libraries

MultilevelMonteCarloApplication makes use of third part libraries. Information about these libraries can be found in their respective pages, which are listed below.

XMC

XMC is a Python library, with BSD 4 license, designed for hierarchical Monte Carlo methods. The library develops the above-mentioned algorithms, statistical tools and convergence criteria. The library presents a natural integration with Kratos, which is XMC default solver. By default, an internal version of the library is used. If one wants to use an external version of the library, the environment variable XMC_BACKEND=external should be set.

PyCOMPSs

PyCOMPSs is the Python library required in order to use task-based programming software COMPSs in a Python environment. By default PyCOMPSs is not required in order to run the application. In case one wants to run using this library, the environment variable EXAQUTE_BACKEND=pycompss must be set. The current version is able to run several thousands of samples at once exploiting PyCOMPSs in distributed systems, maximizing parallelism and computational efficiency. Optimal scalability up to 128 working nodes (6144 CPUs) has been demonstrated with both OpenMP and MPI parallelisms.

Instructions for the installation can be found in the Kratos wiki. To run with runcompss, the environment variable EXAQUTE_BACKEND=pycompss must be set to use the distributed computing capabilities. Additionally, running with runcompss requires to add to the PYTHONPATH the path of the XMC library, that is /path/to/Kratos/applications/MultilevelMonteCarloApplication/external_libraries/XMC. You can add the library to the PYTHONPATH either in the .bashrc file, or directly when running the code using the runcompss key --pythonpath. We refer to the Kratos wiki for details.

Mmg and ParMmg

Mmg is an open source software for simplicial remeshing. It provides 3 applications and 4 libraries. Instructions for installing Mmg can be found in the Kratos wiki. ParMmg is the MPI parallel version of the remeshing library Mmg. Instructions for installing ParMmg can be found in the Kratos wiki.

Scalability

AMC and AMLMC denote the asynchronous Monte Carlo and the asynchronous Multilevel Monte Carlo methods, respectively. Sources: [1] and [4].

Examples

Many examples can be found in the Kratos Multiphysics Examples repository.

License

The MultilevelMonteCarloApplication is OPEN SOURCE. The main code and program structure are available and aimed to grow with the need of any user willing to expand it. The BSD (Berkeley Software Distribution) licence allows to use and distribute the existing code without any restriction, but with the possibility to develop new parts of the code on an open or close basis depending on the developers.

Main References

[1] Tosi, R., Amela, R., Badia, R. M. & Rossi, R. (2021). A Parallel Dynamic Asynchronous Framework for Uncertainty Quantification by Hierarchical Monte Carlo Algorithms. Journal of Scientific Computing. https://doi.org/10.1007/s10915-021-01598-6

[2] Amela, R., Ayoul-Guilmard, Q., Badia, R. M., Ganesh, S., Nobile, F., Rossi, R., & Tosi, R. (2019). ExaQUte XMC. https://doi.org/10.5281/zenodo.3235833

[3] Krumscheid, S., Nobile, F., & Pisaroni, M. (2020). Quantifying uncertain system outputs via the multilevel Monte Carlo method — Part I: Central moment estimation. Journal of Computational Physics. https://doi.org/10.1016/j.jcp.2020.109466

[4] Ejarque, J., Böhm, S., Tosi, R., Núñez, M., & Badia, R. M. (2021). D4.5 Framework development and release. ExaQUte consortium.

Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

KratosMultilevelMonteCarloApplication-9.2.0-cp310-cp310-win_amd64.whl (436.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

KratosMultilevelMonteCarloApplication-9.2.0-cp39-cp39-win_amd64.whl (435.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

KratosMultilevelMonteCarloApplication-9.2.0-cp38-cp38-win_amd64.whl (436.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

KratosMultilevelMonteCarloApplication-9.2.0-cp37-cp37m-win_amd64.whl (436.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

KratosMultilevelMonteCarloApplication-9.2.0-cp36-cp36m-win_amd64.whl (436.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: KratosMultilevelMonteCarloApplication-9.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 436.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ec5d4c85c68af38117f33ac774f1d1bfb7d954c516042a9a487418a3ff68588a
MD5 6091b3970be5c35abbb8fdf9f9d9ad0b
BLAKE2b-256 2c43cc90df085619fba136861fffe3dc018abfdf33b86db46c0a5666daf92dba

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d872e251dca70cb41fb47a2ee2c3822ef2c3afce5dfeb8b8db892fc96bd7611e
MD5 4dccae9b146fc32158c60c30cb49d0ff
BLAKE2b-256 f256c06b0cad75e11b32d60ecb50c56b988fb3997931efdf90aabdb1aab5b849

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: KratosMultilevelMonteCarloApplication-9.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 435.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2a45bfbf96c02519c51c5327f8be8475bd777031bf3fb3636c6d3cfb9fd84eca
MD5 5972ffede48da9d5f5be2c72d0aec24e
BLAKE2b-256 25598def332c1753a65a22331af9d991d8a6313bb48f92158eaf2321c30984a8

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 03739847b7dd25cbdc6d5b9de3dc61438029450565b3bea528e3608b1b29a309
MD5 98527ef9cc67d62be22e67d1127aff22
BLAKE2b-256 21be96141bdd774da41f2afa93e5cc6736989a54e743c58379a09a3ef5af381a

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: KratosMultilevelMonteCarloApplication-9.2.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 436.1 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6bbb7edc0ab3b75d38f933e6986cb785f3b260c95045ee1ca0599338adaf8733
MD5 cf44d2500a405ccb9daa17cf670ca203
BLAKE2b-256 a5834e9181f4a0e9bc94bf00433ea19ea90aaccfbc6cad30806edf72a1b66b1b

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8ff8a4abb391a77cc5ad9e03ca7b2f841172fcfe5cf3a5da452c82278bb1c8c
MD5 7ae4b069969260cf69887a331b313317
BLAKE2b-256 58dfeea6f1189b305b51b867a91ee2d24936a992e882eb7fd0c19bc375c3f55a

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: KratosMultilevelMonteCarloApplication-9.2.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 436.1 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 79f03b63db5dcf35def3a1660ceb485da2b18e0bc2c3e72c8379b3ff3f8c3b94
MD5 0a035b5e74f381e8478a86f33e6d7e17
BLAKE2b-256 8780e860ee83e431047aa2401261e65eb210e4fec2bf852921231e3b629651d1

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 feb837397b3d4a98399d7153fc8cc20db8d19ebeca3ed6ce7f2012010679910d
MD5 9ab0b49475941d5ec4c6b4988a7a97e1
BLAKE2b-256 7fc53f14793893623d98709e435f28209e5ea189628bef022e9ad06ffe787c72

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: KratosMultilevelMonteCarloApplication-9.2.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 436.1 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e1b47064bd47e81c3aff08a374281c94191dd543e82444c75fdb9c1c4c59b832
MD5 55cb8839a52f5132cd27ea1efc1c486e
BLAKE2b-256 0b93394ab1b81535f361e3a7d42a18209f53d136f998e391c8ec4bd1945b70e8

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.2.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.2.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 11f885bff8c04c77d60fdea2d47ae70d4955103f8f4bc22f0dba4546092795bb
MD5 d168a141d198048eed3d77ed730c5e0c
BLAKE2b-256 4ea3385d9643f31c5ebdb7d3c305cf7b27d197cabdd115da64add50a29ac59b2

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page