Git Product home page Git Product logo

parmgmc's Introduction

Parallel Multigrid Monte Carlo (MGMC)

ParMGMC is a C library implementation of the Multigrid Monte Carlo method in PETSc to sample from high-dimensional Gaussian distributions on distributed memory machines.

Dependencies

ParMGMC has the following dependencies:

  • An MPI installation (e.g., OpenMPI or MPICH)
  • PETSc (tested with version 3.21, anything >= 3.19 should work) built with C/Pardiso enabled
  • Intel MKL

After Intel MKL has been installed can be configured by running

./configure --with-mkl_cpardiso   \
            --with-mkl_pardiso    \
            --with-blas-lapack-dir=/opt/intel/oneapi/mkl/latest/lib

in the PETSc directory (the path to the Intel MKL might differ depending on the platform). For details, see PETSc documentation.

If the Python bindings should be enabled, pybind11 and petsc4py are also required. petsc4py can be built by passing --with-petsc4py during configure.

Building the library

To build the ParMGMC library CMake is required. Run

$ git clone https://github.com/nilsfriess/ParMGMC.git
$ cd ParMGMC
$ mkdir build && cd build
$ cmake .. -DCMAKE_PREFIX_PATH=/path/to/petsc
$ make

To specify a custom compiler (e.g., a MPI compiler wrapper) add -DCMAKE_C_COMPILER=mpicc.

Installing the library

To install the library to some directory, add -DCMAKE_INSTALL_PREFIX=/path/to/install during CMake configuration. Then run make install to copy the compiled library and headers to the specified directory. This also generates a pkg-config file that can be used to simplify using this library in other projects. If the environment variable PKG_CONFIG_PATH contains both the path to parmgmc.pc (located in /path/to/install/lib/pkgconfig) and the path to PETSc's pkg-config file (located in /path/to/petsc/lib/pkgconfig), then a program using ParMGMC can be compiled with

gcc main.c -o main $(pkg-config --cflags --libs petsc parmgmc)

Python bindings (experimental)

The library has experimental support for usage from Python. Pass -DPARMGMC_ENABLE_PYTHON_BINDINGS=True during the CMake config to enable Python bindings.

parmgmc's People

Contributors

nilsfriess avatar

Watchers

 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.