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.0.2-cp39-cp39-win_amd64.whl (423.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

KratosMultilevelMonteCarloApplication-9.0.2-cp38-cp38-win_amd64.whl (423.6 kB view details)

Uploaded CPython 3.8 Windows x86-64

KratosMultilevelMonteCarloApplication-9.0.2-cp37-cp37m-win_amd64.whl (423.5 kB view details)

Uploaded CPython 3.7m Windows x86-64

KratosMultilevelMonteCarloApplication-9.0.2-cp36-cp36m-win_amd64.whl (423.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

File details

Details for the file KratosMultilevelMonteCarloApplication-9.0.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 677426aa089c0ee92f8bc657251ed0bd37666d2af9750482a85831479eca029e
MD5 fadb2715d06655b325ea15f6ba24d752
BLAKE2b-256 9d5745dc02cdc34ddec2edf3bae986c6d62b11e507ad407139fbfa8d800475d3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3421744b9ee61015d01f5a233de8b3b0b7281559b410e10274360c44b2a860bb
MD5 82038647ce14afc703d6a1912e865fa8
BLAKE2b-256 b37f481f992a41bf95d897f607cf88e549a74a359b127b904adb3b9db0e4edc3

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2b7e5f64ddde58456106b29f3fe71a6df63cd35b1820e8c2c566fd8fcab4822e
MD5 a11a72844bfd39dd3fc9b17723fdfdad
BLAKE2b-256 a74df0641c3d72ab63efc9dec3577365c73d566bfeff52d25fbdc2f13115c963

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 1d66e97b9b7dd9803e9067987fdd03532b848696a6e92587e74b1bbbf8dc36ab
MD5 9dd25cc55c6f27671844d52aede71397
BLAKE2b-256 2de2e7ae6d6d52d235c4b8abcb4a69bfd9dc8de8ca7f0c795ea97a17a7766bd9

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 621b76e0bbcb44039048ceb8bc45f7407161a1177239cb39d5ad13409c753d28
MD5 d25974c761e71de2fbcf6d7c6e1d845f
BLAKE2b-256 966f9d27a745bd3c7a52432db88e4ee0fab962a8030c51e2a348b0d62b9994c7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f5b78021d44550e8846ac85c3e865fbc4104b4a4fd1598344a24a294f4aa631f
MD5 e362f11a44af8a2724d6971067356762
BLAKE2b-256 e703fe26a5cacac0badabdff4de59790a002abd2cd53271511ef15eed81bf596

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 935225e989dc52889214e95b146689d256869ec252d469b8c8a69738d7a61b29
MD5 be1b0d80bbd237640ba8461fd2c361c2
BLAKE2b-256 376d7e8ad2230dd1c6232977b258925fe0797ee6f28728fa4539fd57545df07d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 84b80837f874a15ce34dc746ecf227aa7b7ad3478678fef4ffd4c4af2574ffab
MD5 023859fee7d060ed007fb05773014396
BLAKE2b-256 10501667f57ce68ec96dd21587e60b3eed4b9ca6c95fde1d82d918767ff390d2

See more details on using hashes here.

Provenance

File details

Details for the file KratosMultilevelMonteCarloApplication-9.0.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for KratosMultilevelMonteCarloApplication-9.0.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d2c68dd43ccce3473542ccf8659fb3420aae5b4fcc2817f644c6c55a4e26e510
MD5 3f53301d856ffe000745feddee4d9c59
BLAKE2b-256 d663a0b4a7305443b452a281e3deca3981013e2bc797bd52eca6c59e00c51551

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