Change search
ReferencesLink to record
Permanent link

Direct link
KMCLib 1.1: Extended random number support and technical updates to the KMCLib general framework for kinetic Monte-Carlo simulations
Department of Physics and Astronomy, Uppsala University, Uppsala, Sweden.
KTH, School of Industrial Engineering and Management (ITM), Materials Science and Engineering, Multiscale Materials Modelling. Department of Physics and Astronomy, Uppsala University, Uppsala, Sweden.
2015 (English)In: Computer Physics Communications, ISSN 0010-4655, E-ISSN 1879-2944, Vol. 196, 611-613 p.Article in journal (Refereed) Published
Abstract [en]

We here present a revised version, v1.1, of the KMCLib general framework for kinetic Monte-Carlo (KMC) simulations. The generation of random numbers in KMCLib now relies on the C++11 standard library implementation, and support has been added for the user to choose from a set of C++11 implemented random number generators. The Mersenne-twister, the 24 and 48 bit RANLUX and a ’minimal-standard’ PRNG are supported. We have also included the possibility to use true random numbers via the C++11 std::random-device generator. This release also includes technical updates to support the use of an extended range of operating systems and compilers. New version program summary Program title: KMCLib v1.1 Catalogue identifier: AESZ-v1-1 Program summary URL: Program obtainable from: CPC Program Library, Queen’s University, Belfast, N. Ireland Licensing provisions: GNU General Public License, version 3 No. of lines in distributed program, including test data, etc.: 49,398 No. of bytes in distributed program, including test data, etc.: 1,536,855 Distribution format: tar.gz 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 vectorized 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. Catalogue identifier of previous version: AESZ-v1-0 Journal reference of previous version: Comput. Phys. Comm. 185 (2014) 2340 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 or Open-MPI from SWIG (obtainable from and CMake (obtainable from are both needed for building the backend module, while Sphinx (obtainable from is needed for building the documentation. CPPUNIT (obtainable from, 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 cannot 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.Restrictions: 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 Running time: From a few seconds to several days depending on the type of simulation and input parameters. References: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.M. Lscher, "A portable high-quality random number generator for lattice field theory calculations", Computer Physics Communications, 79 (1994) 100110.S. K. Park, K. W. Miller and P K. Stockmeyer, "Technical correspondence", Communications of the ACM, 36 (1993) 105.M. Leetmaa and N. V. Skorodumova, "KMCLib: A general framework for lattice kinetic Monte Carlo (KMC) simulations", Computer Physics Communications, 185 (2014) 2340.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.

Place, publisher, year, edition, pages
Elsevier, 2015. Vol. 196, 611-613 p.
Keyword [en]
Diffusion, Kinetic, KMC, Monte Carlo, PRNG, Random device, Simulation, True random numbers
National Category
Computer Science
URN: urn:nbn:se:kth:diva-174666DOI: 10.1016/j.cpc.2015.06.016ISI: 000362602900054ScopusID: 2-s2.0-84942111540OAI: diva2:871564

QC 20151116

Available from: 2015-11-16 Created: 2015-10-07 Last updated: 2016-02-15Bibliographically approved

Open Access in DiVA

No full text

Other links

Publisher's full textScopus

Search in DiVA

By author/editor
Skorodumova, Natalia
By organisation
Multiscale Materials Modelling
In the same journal
Computer Physics Communications
Computer Science

Search outside of DiVA

GoogleGoogle Scholar
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

Altmetric score

Total: 36 hits
ReferencesLink to record
Permanent link

Direct link