Giter Site home page Giter Site logo

discotec-combischeme-utilities's Introduction

DisCoTec-combischeme-utilities

Python utilities to create (combination technique schemes) input files for the DisCoTec code.

pytest workflow

Combination Schemes

The DisCoTec code is a black-box framework for PDE solvers that uses the sparse grid combination technique. For an overview on the topic of Sparse Grids, read Sparse Grids in a Nutshell by Jochen Garcke. A lot of proofs and assumptions about combination technique schemes are also summarized here by Brendan Harding.

The resulting files will have .json structure: a long list of dictionaries that each contains a coefficient "coeff" and a level vector "level".

Get the code

Only available on GitHub currently. In your shell, clone the repository:

git clone [email protected]:SGpp/DisCoTec-combischeme-utilities.git

or

git clone https://github.com/SGpp/DisCoTec-combischeme-utilities.git

The Python modules required to use all functionality can be found in the requirements.txt file

Run the tests

Enter the directory you just cloned and execute pytest on the test file

pytest test_combischeme_utils.py

You should see that all tests are passing. If not, please create an issue

Create combination schemes

To create combination schemes in Python, have a close look at the test file -- there are quite a few examples there.

For use with the command line, there are some thin scripts for creating combination scheme files. For instance, you can initially create a combination scheme from the minimum and maximum levels with

python3 create_combischeme.py --lmin 1 2 3 4 --lmax 5 6 7 8

which will place a .json file in your folder that has the combination technique memory requirement in its file name. For the minimum and maximum level parameters above, it will be scheme_10.34_MiB.json.

Divide combination schemes (e.g. for assigning to different systems)

Along the same lines, you can then split this scheme into two parts with

python3 divide_combischeme_by_level_sum.py --file_name scheme_10.34_MiB.json

and the resulting files would have _split1 and _split2 in their file names.

If you want to use the static task assignment functionality in DisCoTec, you can also assign schemes to process groups with a fair share of degrees of freedom for each process group

python3 assign_combischeme_to_groups.py --file_name=scheme_10.34_MiB_split1.json --num_groups=32

which will add an entry "group_no" into each level in the .json file that tells DisCoTec which process group should run the particular component grid.

For really large regular combination schemes, it can make sense to do it all in one step

python3 create_large_assigned_schemes.py --lmin 1 1 1 1 1 1 --lmax 18 18 18 18 18 18 --num_groups 15 20

because this allows the code to use some optimizations which will make it run a lot faster.

As an alternative, you can use the METIS-based heuristic partitioning with

python3 divide_combischeme_metis.py --scheme_file scheme_10.34_MiB.json --num_partitions=2 --target_partition_weights 0.5 0.5

or the one-step variant

python3 divide_combischeme_metis.py --lmin 1 1 1 1 1 1 --lmax 18 18 18 18 18 18 --num_partitions=2 --target_partition_weights 0.5 0.5

The level-sum criterion and METIS heuristic approach will deliver the same results for small schemes and fair splits (= all METIS partitions are weighted equally).

As an example, this split of the scheme lmin=(1, 1, 1, 1), lmax=(6, 6, 6, 6) is generated as part of the tests, and is equal for both approaches:

graph visualization of the scheme lmin=(1, 1, 1, 1), lmax=(6, 6, 6, 6), when distributed to four parts

Current limitations

  • always assumes some default on the number of boundary points, which may need to be adjusted in source
  • only "regular" combination schemes implemented (level difference in each dimension is equal), no tilted planes etc.
  • memory computations assume 8 byte data types such as double

Acknowledgements

Some of the code originated in the EXAHD project (at the time, in this repo) and was written by Christoph Kowitz, Mario Heene, and Alfredo Parra Hinojosa.

If you use the code academically, please cite it.

discotec-combischeme-utilities's People

Contributors

dependabot[bot] avatar freifrauvonbleifrei avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.