Skip to content

Compute Mandelbrot Set using adaptive mesh refinement

License

Notifications You must be signed in to change notification settings

tpadioleau/AMR_mandelbrot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMR_mandelbrot

Compute Mandelbrot Set using adaptive mesh refinement technique and C++/kokkos library for multi-architecture execution. This is not intended to be efficient computation, but just a simple illustrative example of use of class Kokkos::UnorderedMap container (multi-architecture hash map data container). Mandelbrot set is computed iteratively, refined cells are inserted into the hashmap based data structure.

The following source code is self-contained; C++/kokkos library sources are included as a git submodule.

Example of Mandelbrot set with level_min=6 and level_max=11

./compute_mandelbrot_amr 6 11

mandelbrot set

How to build ?

Get the sources

Make sure to clone this repository recursively, this will also download kokkos source as a git submodule.

git clone --recurse-submodules https://github.com/pkestene/AMR_mandelbrot.git

Kokkos is built as part of this project with the cmake build system.

build the code

build for Kokkos/OpenMP execution

To build kokkos/OpenMP backend

mkdir build_openmp; cd build_openmp
ccmake -DKOKKOS_ENABLE_OPENMP=ON -DCMAKE_BUILD_TYPE=Release ..
make

Optionally, you can (recommended) activate HWLOC support by turning ON the flag KOKKOS_ENABLE_HWLOC.

ccmake -DKOKKOS_ENABLE_OPENMP=ON -DCMAKE_BUILD_TYPE=Release -DKOKKOS_ENABLE_HWLOC=ON ..

build for Kokkos/Cuda

Obviously, you need to have Nvidia/CUDA driver and toolkit installed on your platform. Then you need to

  1. tell cmake to use kokkos compiler wrapper for cuda:

    export CXX=/complete/path/to/kokos/bin/nvcc_wrapper
  2. activate CUDA backend in the ccmake interface.

    • Just turn on KOKKOS_ENABLE_CUDA
    • select cuda architecture, e.g. set KOKKOS_ARCH to Kepler37 (for Nvidia K80 boards)
    # example build for cuda
    mkdir build_cuda; cd build_cuda
    ccmake -DKOKKOS_ENABLE_CUDA=ON -DKOKKOS_ARCK=Kepler37 -DKOKKOS_ENABLE_CUDA_LAMBDA=ON -DKOKKOS_ENABLE_HWLOC=ON ..
    make

About

Compute Mandelbrot Set using adaptive mesh refinement

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 83.4%
  • C 14.7%
  • CMake 1.9%