{"id":18724771,"url":"https://github.com/sgpp/discotec","last_synced_at":"2025-04-12T15:45:26.321Z","repository":{"id":38338763,"uuid":"226341053","full_name":"SGpp/DisCoTec","owner":"SGpp","description":"MPI-based code for distributed HPC simulations with the sparse grid combination technique. Docs-\u003e(https://discotec.readthedocs.io/)","archived":false,"fork":false,"pushed_at":"2025-03-04T08:09:03.000Z","size":21961,"stargazers_count":8,"open_issues_count":12,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-11T11:20:02.481Z","etag":null,"topics":["combination-technique","higher-dimensional","multi-scale","simulation","sparse-grids","vlasov-solver"],"latest_commit_sha":null,"homepage":"https://sparsegrids.org/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SGpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-12-06T13:56:40.000Z","updated_at":"2025-03-04T08:09:03.000Z","dependencies_parsed_at":"2023-10-16T18:55:46.372Z","dependency_job_id":"25479389-ea80-48ab-8b6c-e1829c80f3c4","html_url":"https://github.com/SGpp/DisCoTec","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SGpp%2FDisCoTec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SGpp%2FDisCoTec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SGpp%2FDisCoTec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SGpp%2FDisCoTec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SGpp","download_url":"https://codeload.github.com/SGpp/DisCoTec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248591067,"owners_count":21129952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["combination-technique","higher-dimensional","multi-scale","simulation","sparse-grids","vlasov-solver"],"created_at":"2024-11-07T14:07:50.517Z","updated_at":"2025-04-12T15:45:26.305Z","avatar_url":"https://github.com/SGpp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DisCoTec: Distributed Combination Technique Framework\n\n[![Build Status](https://jenkins-sim.informatik.uni-stuttgart.de/buildStatus/icon?job=DisCoTec%2Fmain)](https://jenkins-sim.informatik.uni-stuttgart.de/job/DisCoTec/job/main/)\n[![License: LGPL v3](https://img.shields.io/badge/License-LGPL_v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\n[![Zenodo DOI](https://zenodo.org/badge/226341053.svg)](https://zenodo.org/badge/latestdoi/226341053)\n[![JOSS DOI](https://joss.theoj.org/papers/10.21105/joss.07018/status.svg)](https://doi.org/10.21105/joss.07018)\n[![Latest spack version](https://img.shields.io/spack/v/discotec)](https://packages.spack.io/package.html?name=discotec)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cac5bc0841784657b2bb75ea46e7cf01)](https://app.codacy.com/gh/SGpp/DisCoTec/dashboard)\n\n## What is DisCoTec?\n\nThis project contains **DisCoTec**, a code for running the *dis*tributed sparse\ngrid *co*mbination *tec*hnique with MPI parallelization.\nWhile it originates from the excellent\n[SGpp project](https://github.com/SGpp/SGpp), all the parallelization makes it a\nvery different code, such that it has become its own project.\n\nDisCoTec is designed as a framework that can run multiple instances of a\n(black-box) grid-based PDE solver implementation.\nThe most basic example we use is a [mass-conserving FDM/FVM constant advection\nupwinding solver](/examples/distributed_advection/).\nAn example of a separate, coupled solver is [SeLaLib](/examples/selalib_distributed/).\n\n### Sparse Grid Combination Technique with Time Stepping\n\nThe sparse grid combination technique (Griebel et al.\n[1992](https://ins.uni-bonn.de/media/public/publication-media/griesiam.ps.gz),\nGarcke [2013](https://link.springer.com/chapter/10.1007/978-3-642-31703-3_3),\nHarding [2016](https://link.springer.com/chapter/10.1007/978-3-319-28262-6_4))\ncan be used to alleviate the curse of dimensionality encountered in\nhigh-dimensional simulations.\nInstead of using your PDE solver on a single structured full grid (where every\ndimension is finely resolved), you would use it on many different structured\nfull grids (each of them differently resolved).\nWe call these coarsely-resolved grids component grids.\nTaken together, all component grids form a sparse grid approximation, which can\nbe explicitly obtained by a linear superposition of the individual grid\nfunctions, with the so-called combination coefficients.\n\n![schematic of a combination scheme in 2D](gfx/combischeme-2d.svg)\n\nIn this two-dimensional combination scheme, all combination coefficients are 1\nand -1, respectively.\nFigure originally published in (Pollinger [2024](https://elib.uni-stuttgart.de/handle/11682/14229)).\n\nBetween time steps, the grids exchange data through a multi-scale approach,\nwhich is summarized as the \"combination\" step in DisCoTec.\nAssuming a certain smoothness in the solution, this allows for a good\napproximation of the finely-resolved function, while achieving drastic\nreductions in compute and memory requirements.\n\n### Parallelism in DisCoTec\n\nThe DisCoTec framework can work with existing MPI parallelized PDE solver codes\noperating on structured grids.\nIn addition to the parallelism provided by the PDE solver, it adds the combination\ntechnique's parallelism.\nThis is achieved through *process groups* (pgs):\n`MPI_COMM_WORLD` is subdivided into equal-sized process groups\n(and optionally, a manager rank).\n\n![schematic of MPI ranks in DisCoTec](gfx/discotec-ranks.svg)\n\nThe image describes the two ways of scaling up:\nOne can either increase the size or the number of process groups.\nFigure originally published in (Pollinger [2024](https://elib.uni-stuttgart.de/handle/11682/14229)).\n\nCombining the two ways of scaling up, DisCoTec's scalability was demonstrated on\nseveral machines, with the experiments comprising up to 524288 cores:\n\n![timings for advection solver step on HAWK at various\nparallelizations](gfx/times-solver-on-hawk.svg)![timings for combination step on\nHAWK at various parallelizations](gfx/times-combination-on-hawk.svg)\n\nWe see the timings (in seconds) for the advection solver step and the\ncombination step, respectively.\nThis weak scaling experiment used four OpenMP threads per rank, and starts with\none pg of four processes in the upper left corner.\nThe largest parallelization is 64 pgs of 2048 processes each.\nFigure originally published in (Pollinger [2024](https://elib.uni-stuttgart.de/handle/11682/14229)).\n\nFind a more detailed discussion in the [docs](https://discotec.readthedocs.io/en/latest/parallelism.html).\n\nThere are only few codes that allow weak scaling up to this problem size:\na size that uses most of the available main memory of the entire system.\n\n## When to Use DisCoTec?\n\nIf you are using a structured grid PDE solver and want to increase its\naccuracy while not spending additional compute or memory resources on it,\nDisCoTec may be a viable option.\nThe codes most likely in this situation are the ones that solve\nhigh-dimensional problems and thus suffer the curse of dimensionality,\nsuch as the 4-6D discretizations occurring in plasma physics or\ncomputational quantum chemistry.\nBut if you have a \"normal\" 2-3D problem and find yourself\nresource constrained, DisCoTec could be for you, too!\nUse its multiscale benefits without worrying about any\nmultiscale yourself 😊\n\nWhy not try it [with your own PDE solver](https://discotec.readthedocs.io/en/latest/simple_tutorial.html)?\n\n### What Numerical Advantage Can I Expect?\n\nDepends on your problem!\n[Figure 3.6 here](http://elib.uni-stuttgart.de/handle/11682/14229)\nshows a first-order accurate 2D PDE solver achieving\napproximately second-order accuracy with the Combination Technique considering\nthe total number of DOF.\n(Figure omitted due to licensing, first published\n[here](https://www.sciencedirect.com/science/article/pii/S0021999123004333).)\n\n## When Not to Use DisCoTec?\n\n1. If memory and/or time constraints are not your limiting factor; you can easily\n   achieve the numerical accuracy you need with your resources.\n2. If your PDE solver just does not fit the discretization constraints\n   imposed by DisCoTec:\n   - a rectilinear (or mapped to rectilinear) domain\n   - structured rectilinear grids in your main data structure (=typically the\n     unknown function), stored as a linearized array\n   - numbers of values per dimension that can be chosen as various powers of two,\n     and where any power of two is a coarsened version of the discretization achieved\n     with the next power of two (\"nested discretization\").\n   - if distributed-memory parallelism is used, it must be MPI\n   - currently, DisCoTec does not support Discontinuous Galerkin schemes,\n     but it could be part of future versions (through Alpert multiwavelets).\n     Let us know in case you are interested!\n\n## Installing\n\nDisCoTec can be installed via spack, which handles all dependencies.\nWe recommend the `spack dev-build` workflow:\n\nClone both `spack` and `DisCoTec` to find or build the dependencies and then\ncompile DisCoTec:\n\n```bash\ngit clone git@github.com:spack/spack.git  # use https if ssh is not set up on github\n./spack/bin/spack external find  # find already-installed packages\n./spack/bin/spack compiler find  # find compilers present on system\n./spack/bin/spack info discotec@main  # shows DisCoTec's variants\n# shows DisCoTec's dependency tree and which parts are already found\n./spack/bin/spack spec discotec@main\n\ngit clone git@github.com:SGpp/DisCoTec.git\ncd DisCoTec\n../spack/bin/spack dev-build -b install discotec@main\n```\n\nThis will first build all dependencies, and then build DisCoTec inside the\ncloned folder.\nThe executables are placed in the respective `example` and `test` folders.\n\nTo use DisCoTec in another CMake project, you can then add the line\n\n```CMake\nadd_subdirectory(DisCoTec/src)\n```\n\nin your project's CMake files.\n\n[Here are Docs](https://discotec.readthedocs.io/en/latest/getting_started.html#installation-with-spack)\nfor CMake options and further Spack customization hints.\n\n## Read The Full Documentation\n\n[DisCoTec documentation here!](https://discotec.readthedocs.io/en/latest/)\n\n[SeLaLib public source](https://github.com/selalib/selalib) and [SeLaLib documentation](https://selalib.github.io/selalib.html)\n\nFor the current GENE documentation, you need to apply for access at [genecode.org](https://genecode.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgpp%2Fdiscotec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgpp%2Fdiscotec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgpp%2Fdiscotec/lists"}