Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] aesz_v1_1.tar.gz(1500 Kbytes)
Manuscript Title: KMCLib 1.1: Extended random number support and technical updates to the KMCLib general framework for kinetic monte-carlo simulations
Authors: Mikael Leetmaa, Natalia V. Skorodumova
Program title: KMCLib v1.1
Catalogue identifier: AESZ_v1_1
Distribution format: tar.gz
Journal reference: Comput. Phys. Commun. 196(2015)611
Programming language: Python and C++.
Computer: Any computer that can run a C++11 compatible C++ compiler and a Python 2.7 interpreter.
Operating system: Tested on Ubuntu 14.4 LTS, Ubuntu 12.4 LTS, CentOS 6.6, Mac OSX 10.10.3, Mac OSX 10.9.5 and Mac OSX 10.8.2 but should run on any system that can have a C++11 compatible C++ compiler and a Python 2.7 interpreter.
Has the code been vectorised or parallelized?: Yes, with MPI. From one to hundreds of processors may be used depending on the type of input and simulation.
RAM: From a few megabytes to several gigabytes depending on input parameters and the size of the system to simulate.
Keywords: KMC, lattice, kinetic, Monte Carlo, diffusion, simulation, framework, plugin, Python, PRNG, true-random numbers.
Classification: 4.13, 16.13.

External routines: To run the serial version of KMCLib no external libraries are needed other than the standard C++ runtime library and a Python 2.7 interpreter with support for numpy. For running the parallel version an MPI implementation is needed, such as e.g. MPICH from http://www.mpich.org or Open-MPI from http://www.open-mpi.org. SWIG (obtainable from http://www.swig.org/) and CMake (obtainable from http://www.cmake.org/) are both needed for building the backend module, while Sphinx (obtainable from http://sphinx-doc.org) is needed for building the documentation. CPPUNIT (obtainable from http://sourceforge.net/projects/cppunit/, also included in the KMCLib distribution) is needed for building the C++ unit tests

Does the new version supersede the previous version?: Yes

Nature of problem:
Atomic scale simulation of slowly evolving dynamics is a great challenge in many areas of computational materials science and catalysis. When the rare-events dynamics of interest is orders of magnitude slower than the typical atomic vibrational frequencies a straight-forward propagation of the equations of motions for the particles in the simulation can not reach time scales of relevance for modeling the slow dynamics.

Solution method:
KMCLib provides an implementation of the kinetic Monte Carlo (KMC) method that solves the slow dynamics problem by utilizing the separation of time scales between fast vibrational motion and the slowly evolving rare-events dynamics. Only the latter is treated explicitly and the system is simulated as jumping between fully equilibrated local energy minima on the slow-dynamics potential energy surface.

Reasons for new version:
The v1.1 revision increases the reliability and flexibility of the random number generation options in KMCLib, which is a central part of the KMC algorithm. The new release also comes with extended support for additional compilers and updates to the build system to simplify the installation procedure on some widely used platforms.

Summary of revisions:

  • Enough time has passed since the introduction of the <random> header in the C++ standard runtime library with the C++11 standard, that most installed compilers today have support to enable the use of C++11 specific language features in C+++. The <random> standard header comes with a set of well-defined pseudo random number generators (PRNG). Using standard library routines in favor of custom implementations has the obvious advantage of being more reliable and with guaranteed support over a longer time. From the v1.1 revision, KMCLib therefore relies on the C++11 standard library <random> header to produce pseudo-random numbers. This also makes it easier to enable support for several different PRNG:s for the user to choose from. From previously only supporting a Mersenne-twister implementation, KMCLib now has support for using the Mersenne-twister [1], the 24 and 48-bit RANLUX [2] generators, as well as a 'minimal-standard' PRNG [3].
  • For machines with a random device installed, KMCLib v1.1 can run simulations with true random numbers. This is enabled by using the std::random_device generator in C++. If the random device is properly installed the true random numbers are available to KMCLib out of the box and the user only needs to specify the use of the random device with an input flag in the same way as she chooses any of the available PRNG:s.
  • The v1.1 revision includes major updates to the build system. The build system has no effect on the outcome of the simulations, but has a great impact on how easy it is to install the program. The intel compiler is widely available on super computer clusters and support for this compiler widely extends the number of systems where KMCLib can be easily setup and run. The popularity of the Mac platform also makes smooth installation and compilation with clang desirable. With version v1.1 the make system for KMClib now includes support for the clang compiler on Mac and support for both the intel compiler and the gcc compiler on Linux. See the reference manual for details of which versions of the operating systems and compilers have been tested.

KMCLib implements the lattice KMC method and is as such, restricted to geometries that can be expressed on a grid in space. See the original paper describing KMCLib [4] for further details.

Unusual features:
KMCLib has been designed to be easily customized, to allow for user-defined functionality and integration with other codes. The user can define her own on-the-fly rate calculator via a Python API, so that site-specific elementary process rates, or rates depending on long-range interactions or complex geometrical features can easily be included. KMCLib also allows for on-the-fly analysis with user-defined analysis modules. KMCLib can keep track of individual particle movements and includes tools for mean square displacement analysis based on the algorithm described in ref. [5], and is therefore particularly well suited for studying diffusion processes at surfaces and in solids. With the release of v1.1 KMCLib now supports several different pseudo random number generators, but can also, if a random device is installed on the machine, use true random numbers via the std::random_device generator.

Additional comments:
The full documentation of the program is distributed with the code and can also be found online at http://leetmaa.github.io/KMCLib/manual-v1.1/.

Running time:
From a few seconds to several days depending on the type of simulation and input parameters.

[1] M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623- dimensionally equidistributed uniform pseudorandom number generator", ACM Trans. on Modeling and Computer Simulation, 8 (1998) 3,
[2] M. Lscher, "A portable high-quality random number generator for lattice field theory calculations", Computer Physics Communications, 79 (1994) 100110.
[3] S. K. Park, K. W. Miller and P. K. Stockmeyer, "Technical correspondence", Communications of the ACM, 36 (1993) 105
[4] M. Leetmaa and N. V. Skorodumova, "KMCLib: A general framework for lattice kinetic Monte Carlo (KMC) simulations", Computer Physics Communications, 185 (2014) 2340
[5] M. Leetmaa and N. V. Skorodumova, "Mean square displacements with error estimates from non-equidistant time-step kinetic Monte Carlo simulations", Computer Physics Communications, 191 (2015) 119