## MERGE SORT

### Abstract

roughly equal size. If subprogram can be solved independently, there is a possibility of significant speed up by parallel computing. The DC paradigm has been used widely to design a number of efficient algorithms for broad scientific and engineering applications. Examples include a hierarchy of particle simulation methods, in which spatially localized subproblems are solved in a global embedding field, which is efficiently computed with tree-based algorithms (see Figure). Examples of the embedding field are the electrostatic field in molecular dynamics (MD) simulations 1 and the self-consistent Kohn-Sham potential in quantum mechanical (QM) simulations in the framework of the density functional theory (DFT). 2 Figure. Schematic of a divide-and-conquer (DC) particle simulation algorithm. (Left) The physical space is subdivided into spatially localized cells, with local particles constituting subproblems (bottom), which are embedded in a global field (shaded) solved with a tree-based algorithm. (Right) To solve the subproblem in domain Ω α in the DC-DFT algorithm, coarse multigrids (gray) are used to accelerate iterative solutions on the original real-space grid (corresponding to the grid refinement level, l = 3). The bottom panel shows fine grids adaptively generated near the atoms (spheres) to accurately operate the ionic pseudopotentials on the electronic wave functions. In the following, we use the sorting problem as an example to practice the programming of parallel divide-and-conquer algorithms and examine their communication patterns.

### Keyphrases

merge sort tree-based algorithm dc paradigm parallel divide-and-conquer algorithm embedding field particle simulation algorithm coarse multigrids electronic wave function iterative solution physical space efficient algorithm global embedding field global field self-consistent kohn-sham potential communication pattern dc-dft algorithm significant speed molecular dynamic bottom panel show sorting problem local particle electrostatic field engineering application density functional theory ionic pseudopotentials original real-space grid grid refinement level equal size particle simulation method