Skip to content

zierenberg/cudamuca

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CudaMuca

This is an implementation of the parallel multicanonical Monte Carlo sampling method.
As a benchmark system we have chosen the well studied two-dimensional Ising model on a square lattice.
We provide a CPU version using MPI and a GPU version using CUDA.

CudaMuca can be easily adapted to other systems.

Authors: Jonathan Gross, Johannes Zierenberg, Martin Weigel, Wolfhard Janke

This work is licensed under a Creative Commons Attribution 4.0 International License.

Requirements

  • CUDA capable GPU
  • NVIDIA CUDA Toolkit 6.5+
  • C++11 compatible compiler (tested with GNU compiler)
  • MPI 2.2 compiler with C++ bindings (tested with GNU compiler and OpenMPI)
  • recent version Linux or macOS, (maybe Windows)

Building

make cpu
make gpu

Usage

CPU version

Available command line arguments:

Usage :
./ising2D_cpu [mt] [-s seed] [-p nupdates] -L size
-m turns on modifyWeights, default: false
-p final production run (set number of updates, if selected), default: 0
-L sets the system size, required parameter
-s sets the initial seed, default: 1000

example run:

mpirun -np 24 ising2D_cpu -L 32 -m -s 91564

GPU version

Usage :
./ising2D_gpu [mt] [-s seed] [-p nupdates] [-i dev] -L size -W workers
-m turns on modifyWeights, default: false
-p final production run (set number of updates, if selected), default: 0
-L sets the system size, required parameter
-s sets the initial seed, default: 1000
-i select device from list of available GPUs, optional parameter, default: automatic
-W sets the number of workers, required parameter

example run:

ising2D_gpu -L 8 -m -W 26624 -i 2

File description

Random123/

Random123 is a library of "counter-based" random number generators
Can be used with CPUs and CPUs.

from D. E. Shaw Research: https://www.deshawresearch.com/resources_random123.html

ising2D.cpp

Reference implementation of the two-dimensional Ising model on CPUs using C++ and MPI.

ising2D.cu

Reference implementation of the two-dimensional Ising model on GPUs using NVIDIA's CUDA toolkit.

ising_io.hpp

This file includes all methods for reading and parsing command line arguments as well as output generated by the main program.
All methods and variables defined in here are shared between the CPU and the GPU implementation.

muca.hpp

In this header all the functions related to the multicanonical sampling algorithm are implementated.
This file is shared between CPU and GPU implementations.

  • Cuda related code

    • Update weights
    • modify weights (linear extrapolation on the sides)
  • Histogram methods

    • get histogram range
  • Flatness criteria

    • Chebychev
    • Kullback-Leibler

Generated output

The subdirectory example/ includes sample outputs generated on a Tesla K20m using the following command:

ising2d_gpu -L 16 -W 26624

stats.dat

This file is used to store all simulational parameters as well as statistics of the simulation.
Information included in this file is:

  • system size
  • random number seed
  • number of workers
  • number of updates per workers
  • number of iterations until convergence
  • total time of simulation
  • average spin flip time
  • number of thermalization updater per worker
  • number of measurement updates per worker
  • total number of updates per worker

run_iterations.dat

In this file all iterations until convergence (flat histogram) are accumulated.
The header includes the iteration number, width of the covered energy range, number of measurement updates and the Kullback-Leibler parameter.
A table with energy bins, current MUCA weights and histogram entries follows for each iteration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 78.4%
  • C++ 11.9%
  • C 4.7%
  • Objective-C 2.6%
  • Cuda 1.0%
  • JavaScript 0.6%
  • Other 0.8%