KMCLib: A general framework for lattice kinetic Monte Carlo (KMC) simulations

KMCLib is a general framework for lattice kinetic Monte Carlo (KMC) simulations. The program can handle simulations of the diffusion and reaction of millions of particles in one, two, or three dimensions, and is designed to be easily extended and customized by the user to allow for the development of complex custom KMC models for specific systems without having to modify the core functionality of the program. Analysis modules and on-the-fly elementary step diffusion rate calculations can be implemented as plugins following a well-defined API. The plugin modules are loosely coupled to the core KMCLib program via the Python scripting language. KMCLib is written as a Python module with a backend C++ library. After initial compilation of the backend library KMCLib is used as a Python module; input to the program is given as a Python script executed using a standard Python interpreter. We give a detailed description of the features and implementation of the code and demonstrate its scaling behavior and parallel performance with a simple one-dimensional A-B-C lattice KMC model and a more complex three-dimensional lattice KMC model of oxygen-vacancy diffusion in a fluorite structured metal oxide. KMCLib can keep track of individual particle movements and includes tools for mean square displacement analysis, and is therefore particularly well suited for studying diffusion processes at surfaces and in solids. Program summary Program title: KMCLib Catalogue identifier: AESZ_v1_0 Program summary URL: http://cpc.cs.qub.ac.uk/summaries/AESZ_v1_0.html 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 064 No. of bytes in distributed program, including test data, etc.: 1 575 172 Distribution format: tar.gz Programming language: Python and C++. Computer: Any computer that can run a C++ compiler and a Python interpreter. Operating system: Tested on Ubuntu 12.4 LTS, CentOS release 5.9, Mac OSX 10.5.8 and Mac OSX 10.8.2, but should run on any system that can have a C++ compiler, MPI and a Python interpreter. Has the code been vectorized or parallelized?: Yes. From one to hundreds of processors 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. Classification: 4.13, 16.13. External routines: KMCLib uses an external Mersenne Twister pseudo random number generator that is included in the code. A Python 2.7 interpreter and a standard C++ runtime library are needed to run the serial version of the code. 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 needed for building the backend module, Sphinx (obtainable from http://sphinx-doc.org) for building the documentation and CPPUNIT (obtainable from http://sourceforge.net/projects/cppunit/) for building the C++ unit tests. 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. Restrictions: KMCLib implements the lattice KMC method and is as such restricted to geometries that can be expressed on a grid in space. 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, and is therefore particularly well suited for studying diffusion processes at surfaces and in solids. Additional comments: The full documentation of the program is distributed with the code and can also be found at http://www.github.com/leetmaa/KMCLib/manual Running time: From a few seconds to several days depending on the type of simulation and input parameters.

[1]  Steven J. Plimpton,et al.  Crossing the Mesoscale No-Man's Land via Parallel Kinetic Monte Carlo , 2009 .

[2]  D. Gillespie A General Method for Numerically Simulating the Stochastic Time Evolution of Coupled Chemical Reactions , 1976 .

[3]  Andreas Hellander,et al.  Perspective: Stochastic algorithms for chemical kinetics. , 2013, The Journal of chemical physics.

[4]  Sebastian Matera,et al.  kmos: A lattice kinetic Monte Carlo framework , 2014, Comput. Phys. Commun..

[5]  Mikael Leetmaa,et al.  Mean square displacements with error estimates from non-equidistant time-step kinetic Monte Carlo simulations , 2015, Comput. Phys. Commun..

[6]  Jpl John Segers,et al.  Efficient Monte Carlo methods for the simulation of catalytic surface reactions , 1998 .

[7]  W. H. Weinberg,et al.  Theoretical foundations of dynamical Monte Carlo simulations , 1991 .

[8]  A. Voter,et al.  Extending the Time Scale in Atomistic Simulation of Materials Annual Re-views in Materials Research , 2002 .

[9]  Takuji Nishimura,et al.  Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator , 1998, TOMC.

[10]  Michail Stamatakis,et al.  Unraveling the Complexity of Catalytic Reactions via Kinetic Monte Carlo Simulation: Current Status and Frontiers , 2012 .

[11]  Qingchuan Xu,et al.  Atomic transport in ordered compounds mediated by local disorder: Diffusion in B 2 -Ni x Al 1 − x , 2010 .

[12]  Kah Chun Lau,et al.  Kinetic Monte Carlo simulation of the elementary electrochemistry in a hydrogen-powered solid oxide fuel cell , 2010 .

[13]  Aidan P Thompson,et al.  A constant-time kinetic Monte Carlo algorithm for simulation of large biochemical reaction networks. , 2008, The Journal of chemical physics.

[14]  A. B. Bortz,et al.  A new algorithm for Monte Carlo simulation of Ising spin systems , 1975 .

[15]  Graeme Henkelman,et al.  Adaptive kinetic Monte Carlo for first-principles accelerated dynamics. , 2008, The Journal of chemical physics.

[16]  Laurie A. Williams,et al.  Realizing quality improvement through test driven development: results and experiences of four industrial teams , 2008, Empirical Software Engineering.

[17]  James Hetherington,et al.  Parallel kinetic Monte Carlo simulation framework incorporating accurate models of adsorbate lateral interactions. , 2013, The Journal of chemical physics.

[18]  Corbett Chandler. Battaile,et al.  The Kinetic Monte Carlo method : Foundation, implementation, and application , 2008 .

[19]  Abhijit Chatterjee,et al.  Accurate acceleration of kinetic Monte Carlo simulations through the modification of rate constants. , 2010, The Journal of chemical physics.