flexible memory allocation in kinetic monte carlo simulations
TRANSCRIPT
Flexible Memory Allocation in Kinetic Monte Carlo Simulations
Aaron Craig
Context & Motivation: Epitaxy• Kinetic Monte Carlo Monte Carlo Markov Processes Stochastic Processes ⇢ ⇢ ⇢
Source: physics.lancs.ac.uk/lamsa/pages/page3.htm
“Surface of a GaAs film grown by liquid phase epitaxy” Lancaster Materials and Surface Analysis Service
(Lancaster University (UK))
Context & Motivation: Epitaxy
• Monte Carlo Simulations use a random number to select state-transitions in Markov processes.
• Kinetic Monte Carlo simulations simulate the time-evolution of systems in nature.
• Only a small fraction of transitions are accessible: sparse transition matrix
• K.M.C. for crystal growth: Markov process modeling the behavior of a system of atoms
• Stochastic simulation: discrete or continuous time-scales
Simple Cubic, Solid-on-solid Epitaxial Growth
• Cubic Lattice of lateral dimension
• Permitted transitions in system state: changes in height array
• Moves or ‘Hops’: Atoms move from one lattice site to another
• Deposition: Stochastic ‘rain’
• Determination of rates: local bond-coordination
• Simplest case: Only nearest neighbors determine rate
• Single species
M2
H
Simple Cubic, Solid-on-solid Epitaxial Growth
• Our model allows five possible rates: one for each coordination:
, .
• The parameter reflects bond-strength.
• The pre-factor is adjusted to reflect the model.
• Periodic boundary conditions
• Exploit the finite number of rates, categories
E
n = 0, ..., 4rn = Ke�En
K
Tour of Methods
• Linear Search
• Inverted List Methods
• (1) Standard Inverted List Algorithm
• (2) Minimal Allocation Algorithm
• Cascade procedure
• (3) Flexible Allocation Algorithm
• Synthesis of methods (1) and (2)
Linear Search Algorithm
1. Compute the partial sums by summing over the event index:
! ! 2. Select a random number . !3. Find the integer for which . !4. Carry out event . Update height array , rates. !5. Return to step 1.
Ri =iX
j=1
rj
u 2 [0, R]
i
i
Ri�1 < u Ri
H
Standard Inverted List Algorithm
1. Sum the rates by category: !!!!2. Select a random number . !3. Find the integer for which . !4. Carry out a randomly-selected event with rate . !5. Update the list , inverse list , and occupation array . !6. Return to step 1.
Ri =iX
j=1
Cj r̂j
u 2 [0, R]
i Ri�1 < u Ri
r̂i
L A C
Standard Inverted List Algorithm
• Two types of list updates:
• (1) Updates to the list of events : categorization by rate
• (2) Updates to the inverse list : -‘addresses’
• Advantages of Inverted List Methods:
• (1) Fixed cost per iteration: computational costs do not scale with , the size of the system.
• (2) Both and can be maintained with a small number of updates per iteration.
L
LA
M2
L A
Standard Inverted List Algorithm• Inverted list methods require more memory:
• The standard list requires a total allocation of
• Our model:
L nM2
n = 5
Standard Inverted List Algorithm
kf
(A(e, 1), ki)
Updates:
1) Replacement 2) Event moved to kf
Standard List Update
Minimal Allocation Algorithm
• Total Memory Allocation:
• Each iteration necessitates a cascade procedure.
• Cases requiring special treatment
• Problem: as increases, performance suffers.
• Fixed cost per iteration (scales with )
• Slower than standard inverted list method, but uses less memory
M2
n
n
Cascade Procedure:
1) Replacement 2) Cascade3) Event moved to kf
Minimal Allocation Algorithm: Cascade
Case: kf < ki
Cascade Procedure:
1) Replacement 2) Cascade3) Event moved to kf
Minimal Allocation Algorithm: Cascade
Case: kf > ki
Flexible Allocation Algorithm
• Idea: synthesis of previous two methods
• Total memory allocation , .
• Size of is model-dependent.
• Memory Considerations for large systems
• Performance outlook for more complex models
(1 + ↵)M2 ↵ << n� 1
↵
Overview of the Algorithm
• Two cases:
• Case 1: Destination sub-list contains unoccupied space
• Two updates required
• Case 2: No unoccupied space
• Cascade procedure required
• Cases requiring special treatment
Performance Considerations
• Cascades & Allocation Considerations
• Periodicity and System-Size
• Deposition and its complications
• Cache
Updates:
1) Replacement 2) Event moved to kf
Flexible Allocation Algorithm: Non-cascade
Updates:1. Replacement2. Cascade3. Event moved to kf
Flexible Allocation Algorithm: Cascade
Observations
• Total allocation always grows.
• Saturation eventually occurs.
• Cascade procedures are increasingly rare
Further Application
• Many models: larger number of possible rates
• Face-centered cubic lattice
• System size: lattice sites
• Rates determined by neighbors and ‘next-nearest’ neighbors
• 91 distinct rates
M3 5003
Parameters!
• System-size:
• Rates: ,
!
M2 = 22p , p = 5, ..., 12
108
rij = e�Enij E = 3
• iterations
r̂1 = 1 (1)
r̂2 = e�3 ⇡ 4.98⇥ 10�2 (2)
r̂3 = e�6 ⇡ 2.48⇥ 10�3 (3)
r̂4 = e�9 ⇡ 1.23⇥ 10�4 (4)
r̂5 = e�12 ⇡ 6.14⇥ 10�6 (5)
• Deposition rate: d = 10�6 monolayers
M2 · s
CPU-time vs. P
CPU-time vs. P (Inverted List Methods)
Allocation Ratio vs. Number of Iterations
Cascade Count vs. Number of Iterations
Conclusions
• Effects of System-size
• Intersection of inverted list algorithms’ curves results from this model’s small number of rates.
• For models with more rates, we expect a larger difference in the performances of the inverted list algorithms.
• Other Models
References
[1] T.P. Schulze, "Efficient Kinetic Monte Carlo Simulation," Journal of Computational Physics 227 (2008) 2455 - 2462
[2] T.P. Schulze, "Kinetic Monte-Carlo Simulations with Minimal Searching," Phys. Rev. E 65 (2002) Art. no. 036704