Code Monkey home page Code Monkey logo

mckl's Introduction

Monte Carlo Kernel Library

Introduction

The MCKL library provides a framework for implementing Monte Carlo algorithms. It was originally developed for the purpose of parallel implementation of SMC algorithms. But it now supports other algorithms as well. The library provides basic building blocks for implementing parallelizable Monte Carlo algorithms.

Installation

This is a header only template C++ library. To install the library just move the contents of the include directory into a proper place, e.g., /usr/local/include on Unix-alike systems.

Documentation

The documents are hosted by Read the Docs. To generate the documents, the following is required: Doxygen, Sphinx and the RTD theme.

cd /path/to/mckl/source
cd docs
doxygen
make html

Third-party dependencies

This library requires a working BLAS implementation. Some of the library's functionalities can only be used if a optional dependencies are present. Notably, HDF5, TBB, OpenMP and MKL. One can tell the library that these optional features are available by defining configuration macros such as -DMCKL_HAS_HDF5=1 during compilation.

Optional runtime library

In addition to the header-only library, one can optionally build and use a runtime library. To build the library, one need a recent version of NASM assembler and the CMake program. The library is only supported on x86-64 CPUs and 64-bit Unix-alike systems.

To build and install the library,

cd /path/to/mckl/source
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/prefix/to/install/directory
make lib
make install

To use and link to the library in a user program, say prog.cpp,

c++ -DMCKL_USE_ASM_LIB=1 -o prog prog.cpp -lmckl

The runtime library provides optimized implementation of selected RNGs Performance of the header-only implementation might vary considerably depending on the compiler. Though even the worst case, the performance is still better than most alternatives, the best performance of some RNGs can provide best performance regardless of the choice of compiler.

Further, one can define a configuration macro MCKL_USE_ASM_VMF to a non-zero value, to use an assembly implementation of selected vectorized math functions when MKL VML is unavailable. This feature is highly experimental. These functions are fast, but have slightly lower accuracy for some values of input than the standard library or MKL VML in high accuracy mode.

Compiler support

This library makes heavy use of some template metaprogramming techniques. It requires a C++14 standard conforming compiler.

This library has been regularly tested with recent clang, GCC and Intel C++ Compiler in C++14 mode.

Other compilers might work but are not tested. Complete C++14 implementation is required with thread-local storage as an exception.

Examples

Examples are in the example subdirectory, to build them,

export CXXFLAGS="-std=c++14"
cd /path/to/mckl/source
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make example

Some examples may only be built if optional dependencies are present.

License

The MCKL library is distributed with a 2-clause BSD license which can be found in the LICENSE file distributed with the source.

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.