flexible memory allocation in kinetic monte carlo simulations

28
Flexible Memory Allocation in Kinetic Monte Carlo Simulations Aaron Craig

Upload: aaron-craig

Post on 15-Jul-2015

52 views

Category:

Science


1 download

TRANSCRIPT

Page 1: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Aaron Craig

Page 2: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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))

Page 3: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 4: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 5: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 6: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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)

Page 7: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 8: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 9: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 10: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Standard Inverted List Algorithm• Inverted list methods require more memory:

• The standard list requires a total allocation of

• Our model:

L nM2

n = 5

Page 11: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Standard Inverted List Algorithm

kf

(A(e, 1), ki)

Updates:

1) Replacement 2) Event moved to kf

Standard List Update

Page 12: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 13: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Cascade Procedure:

1) Replacement 2) Cascade3) Event moved to kf

Minimal Allocation Algorithm: Cascade

Case: kf < ki

Page 14: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Cascade Procedure:

1) Replacement 2) Cascade3) Event moved to kf

Minimal Allocation Algorithm: Cascade

Case: kf > ki

Page 15: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 16: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 17: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Performance Considerations

• Cascades & Allocation Considerations

• Periodicity and System-Size

• Deposition and its complications

• Cache

Page 18: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Updates:

1) Replacement 2) Event moved to kf

Flexible Allocation Algorithm: Non-cascade

Page 19: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Updates:1. Replacement2. Cascade3. Event moved to kf

Flexible Allocation Algorithm: Cascade

Page 20: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Observations

• Total allocation always grows.

• Saturation eventually occurs.

• Cascade procedures are increasingly rare

Page 21: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 22: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 23: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

CPU-time vs. P

Page 24: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

CPU-time vs. P (Inverted List Methods)

Page 25: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Allocation Ratio vs. Number of Iterations

Page 26: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

Cascade Count vs. Number of Iterations

Page 27: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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

Page 28: Flexible Memory Allocation in Kinetic Monte Carlo Simulations

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