DFT-FE 1.0: A massively parallel hybrid CPU-GPU density functional theory code using finite-element discretization
간접 관련 수소연료전지 · (6) PEM(고분자전해질막) (7) MEA(막전극접합체)(21) 에폭시수지
기본 정보
- 저자
- DOI
- 10.1016/j.cpc.2022.108473
- 저널
- Computer Physics Communications
- 발행년도
- 2022
- 발행기관
- Elsevier BV
- 피인용수
- 56
- 라이선스
- publisher-specific-oa
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1016/j.cpc.2022.108473
- 토픽
- Graphene research and applications
- OpenAlex ID
- W4289712286
평가 내용
- 관련도
- 간접 관련
- 사업분야
- 수소연료전지 · (6) PEM(고분자전해질막)
- 부 분야
- (7) MEA(막전극접합체), (21) 에폭시수지
- R&D 측면
- 분석·모델링
- 확신도
- 0.70
- 근거 용어
- density functional theory, Kohn-Sham, solid-state electrolytes, materials design, electronic structure
- 판단 근거
- 이 논문은 밀도범함수이론(DFT)을 활용한 대규모 전자 구조 계산 소프트웨어(DFT-FE 1.0)에 관한 연구입니다. 직접적인 제품 연구는 아니나, 고분자 전해질(PEM)이나 이온 전도성 소재의 원자 단위 거동 및 물성 예측을 위한 시뮬레이션 방법론으로서 코오롱인더스트리의 수소연료전지 및 화학 소재 R&D에 간접적으로 활용될 수 있습니다.
- R&D 활용 포인트
- 수소연료전지용 고분자 전해질막(PEM)의 이온 전도 메커니즘 분석이나 신규 기능성 고분자/수지 소재의 분자 설계 및 물성 예측 시뮬레이션 도구로 활용 가능합니다.
- 평가 입력
- 섹션 본문 201,245자 중 30,032자 발췌
초록
초록이 없습니다.
본문 206,996자
본문 펼치기
섹션 본문 255문단 · 199,613자
(제목 없음)
1We present DFT-FE 1.0, building on DFT-FE 0.6 [Comput. Phys. Commun. 246, 106853 (2020)], to conduct fast and accurate large-scale density functional theory (DFT) calculations (reaching ∼ 100, 000 electrons) on both many-core CPU and hybrid CPU-GPU computing architectures. This work involves improvements in the real-space formulation-via an improved treatment of the electrostatic interactions that substantially enhances the computational efficiency-as well highperformance computing aspects, including the GPU acceleration of all the key compute kernels in DFT-FE. We demonstrate the accuracy by comparing the ground-state energies, ionic forces and cell stresses on a wide-range of benchmark systems against those obtained from widely used DFT codes. Further, we demonstrate the numerical efficiency of our implementation, which yields ∼ 20× CPU-GPU speed-up by using GPU acceleration on hybrid CPU-GPU nodes. Notably, owing to the parallel-scaling of the GPU implementation, we obtain wall-times of 80−140 seconds for full groundstate calculations, with stringent accuracy, on benchmark systems containing ∼ 6, 000 − 15, 000 electrons.
Introduction
2Electronic structure calculations based on Kohn-Sham density functional theory (DFT) have played a very important role in providing key insights into a wide variety of materials properties, including mechanical, electronic, magnetic and optical properties of materials. A significant fraction of the world's computational resources are being utilized for these calculations, and these have provided predictive capability for material modeling, especially qualitative trends, leading to accelerated materials design and discovery. There are about hundred electronic structure codes available, with the plane-wave (PW) basis [1; 2; 3; 4; 5] and the atomic-orbital type basis [6; 7; 8; 9; 10] being the most commonly employed basis sets. Though these basis sets enjoy many advantages, the inherent limitations of PW basis sets of restricting the simulations domains to periodic geometries and boundary conditions, the lack of systematic convergence for AO basis sets, compounded by the limited parallel scalability for both PW and AO basis sets have resulted in the development of systematically improvable and scalable real-space discretization techniques like finite-difference [11; 12; 13; 14; 15], finite-elements [16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29], and other reduced order basis techniques [30; 31; 32; 33; 34]. We note that finite-element (FE) basis employed in this work is a relatively new entrant to real-space methods for DFT and offers several key advantages in comparison to the other widely discretization schemes. In particular, FE basis provides systematic convergence for any materials system [22], can accommodate periodic, non-periodic and semi-periodic boundary conditions, and can offer excellent parallel scalability owing to the locality of the FE basis functions [28]. Furthermore, the FE basis sets are amenable to adaptive spatial resolution, not only allowing the possibility of large-scale all-electron calculations [26; 35] by combining with enrichment functions, but also mixed all-electron and pseudopotential calculations [36].
3A variety of application areas demand large-scale DFT calculations involving tens of thousands of electrons, which include ab initio modeling of dislocation cores [37; 38; 39; 40; 41; 42; 43; 44; 45; 46] in metals and semiconductors, ion diffusivity and migration barrier predictions in solid-state electrolytes [47; 48; 49], large-scale bio-molecular simulations [50; 51; 52; 53], spin-spin interactions in defects in solids for applications in quantum computing [54; 55; 36], and many others. Accurate simulations of these large-scale materials systems with DFT usually involve geometry optimizations, or nudged-elastic band calculations, or long time-scale ab-initio molecular dynamics simulations, all of which require a large number of DFT ground-state calculations. Conducting systematically convergent DFT calculations on such large-scale systems has been challenging owing to the cubic scaling computational complexity of DFT calculations with system size and the limited parallel scalability of state-of-the-art DFT codes. To this end, accurate computational methods that are robust, computationally efficient and scalable on evolving heterogeneous parallel computing architectures are crucial to enable large-scale ab-intio simulations on realistic materials systems involving many tens of thousands of electrons.
4Paving the way for large-scale DFT calculations, numerous efforts have focused on reducing the cubic scaling computational complexity [56; 57; 58; 59; 60; 61] for both metallic and insulating systems over the past few decades. Alternate approaches to enable large-scale DFT calculations include developing efficient methodologies to reduce the computational pre-factor associated with the cubic scaling computational complexity, and massively scalable numerical implementations taking advantage of the evolving computing architectures. Our recent work on DFT-FE 0.6 [28] is along this direction and presents an accurate, efficient and massively parallel finite-element framework for large-scale DFT calculations on many core CPU architectures. The numerical implementation in the work employed computationally efficient strategies which were instrumental in reducing data movement costs and latency on many core CPU architectures. To this end, DFT-FE 0.6 exhibited close to quadratic scaling till 30, 000 − 40, 000 electrons, thereby delaying the onset of cubic scaling com-plexity. Additionally, excellent parallel scaling performance has been demonstrated up to 192,000 MPI tasks, with significant speedups of up to 10× observed in computational times in comparison to widely used plane-wave codes for material systems with more than 10,000 electrons. The capability of DFT-FE 0.6 to simulate very large systems reaching up to ∼ 60, 000 electrons has been demonstrated, which remains computationally prohibitive using plane-wave codes. However, despite the demonstrated performance, many inefficiencies remain in DFT-FE 0.6, which are addressed as a part of this work. In particular, DFT-FE 0.6 restricts the nuclear charges to be coincident with corner finite-element nodes in the finite-element mesh. This, in turn, requires refined FE discretizations, even in the case of pseudopotential calculations yielding smooth solutions. In addition to increased computational cost, this approach would incur additional overheads during geometry optimization and molecular dynamics simulations due to the requirement of frequent remeshing during the course of geometry updates. Furthermore, the implementation procedures in DFT-FE 0.6 does not take advantage of the recent advances in heterogeneous computing architectures, and can execute only on massively parallel many-core CPU architectures.
5We present here DFT-FE 1.0, a massively parallel hybrid CPU-GPU DFT code using finiteelement discretization for large-scale density functional theory calculations. The current effort builds on DFT-FE 0.6 [28], addresses the aforementioned limitations of DFT-FE 0.6, and presents a computationally efficient implementation of DFT-FE on hybrid CPU-GPU architectures. In particular, electrostatic energy and the relevant configurational force expressions (for geometry relaxation) associated with the Kohn-Sham DFT functional are reformulated in terms of smeared nuclear charges, allowing the flexibility for the atoms to float in pseudopotential calculations, in contrast to the use of point charges coincident with finite-element nodes in DFT-FE 0.6. This enables the use of coarser finite-element meshes with higher-order FE interpolating polynomial up to degree 7, thereby reducing the number of basis functions required to achieve the desired accuracy-by a factor of ∼ 3× for the benchmark systems studied in this work-which, in turn, translates to a similar improvement in the computational efficiency. Furthermore, DFT-FE 1.0 focuses on efficient GPU porting of key computational kernels in Chebyshev filtered subspace iteration procedure (ChFES) [28; 29]-the solver employed in DFT-FE for the solution of the Kohn-Sham equations-by utilizing the massive fine grained parallelism of GPUs in both double and complex double datatypes. We note that a good GPU porting efficiency is strongly coupled to the ratio of compute to the data movement associated with the underlying numerical implementation, which in turn is dependent on the algorithms and the basis sets employed. This aspect was also demonstrated in our prior work [29], which described a proof of concept GPU implementation for DFT calculations on hybrid CPU-GPU architectures employing the finite-element basis. To this end, our GPU implementation strategies in the current work hinges on exploiting the following HPC-centric ideas: (i) finite-element level matrix-multi vector products in the Chebyshev filtering step of ChFES, (ii) mixed precision arithmetic based processor-boundary communication in the assembly of domain-decomposed finite-element level vectors, (iii) mixed precision based floating point operations and communications in the computation of overlap matrix and projected Hamiltonian, (iv) employing GPU direct communication, and overlapping compute and data movement -via-asynchronous programming paradigms in the Chebyshev filtering step, as well as the computation of overlap matrix and projected Hamiltonian.
6The accuracy and performance of the aforementioned methodology improvements and implementation innovations in DFT-FE 1.0 are studied using a wide a range of benchmark systems. To this end, the accuracy is validated on representative benchmark systems using state-of-the art codes like Quantum Espresso (QE ) and NWChem for pseudopotential and all-electron DFT calculations, respectively. DFT-FE 1.0 provided excellent agreement on ground-state energies, ionic forces and stresses with QE and NWChem . Furthermore, the aforementioned implementation advances on hybrid CPU-GPU architectures resulted in high throughput performances leading to ∼ 16 − 20× CPU-GPU speedups for a wide range of material system sizes, ranging from ∼ 4, 000 − 30, 000 electrons. We note that the speedups obtained in the present work are found to be much higher than the reported CPU-GPU speedups from state-of-the-art DFT codes where a GPU implementation is available [62; 63; 64; 65; 66; 67]. Furthermore, excellent parallel scalability has been demonstrated using DFT-FE 1.0 on hybrid CPU-GPU architectures over a range of system sizes. In particular, the strong scaling aspect of the current implementation has been instrumental in reducing the walltime to around ∼ 1 − 2 minutes for system sizes of ∼ 6, 000 − 14, 000 electrons for the ground-state DFT calculation. The performance of DFT-FE 1.0 was also demonstrated on a very large system comprising of 114,674 electrons, where the ground-state calculation took around ∼ 54 minutes on 3600 GPUs (600 nodes of the Summit supercomputer).
7The remainder of the paper is organized as follows. Section 2 starts with a discussion on the governing equations in DFT, and presents the local real space formulation implemented in DFT-FE 1.0 with an improved electrostatics treatment by employing smeared floating charges to describe the ions. Subsequently, the configurational forces-used to evaluate ionic forces and cell stresses for geometry optimization-in the framework of smeared floating charges is presented, followed by the finite-element discretization of the Kohn-Sham DFT problem. Section 3 describes the numerical methodologies employed in DFT-FE 1.0 , and Section 4 discusses the various aspects of the numerical implementation on hybrid CPU-GPU architectures. Section 5 presents the results on benchmark systems, demonstrating the accuracy, computational efficiency and parallel scaling performance of DFT-FE 1.0 on hybrid CPU-GPU architectures. We finally conclude along with an outlook in Section 6.
82. Real-space Kohn-Sham DFT formulation and finite-element discretization 2.1. Kohn-Sham DFT governing equations with improved electrostatics treatment For a materials system with N at nuclei and N e electrons, the ground-state properties in Kohn-Sham density functional theory are given by solving the N lowest eigenvalues of the following non-linear eigenvalue problem [68]:
9where R = {R 1 , R 2 , · · · R Nat } denotes the positions of the N at nuclei, ρ denotes the electron density, V eff (ρ, R) denotes the effective single electron Kohn-Sham potential, and ǫ i and ψ i denote the eigenvalues and eigenfunctions of the Kohn-Sham Hamiltonian, respectively. We discuss below the formulation in the context of spin-independent Kohn-Sham Hamiltonian. However, extension to spin-dependent case is straightforward [69], and is implemented in DFT-FE . Further, we discuss the formulation in an infinite periodic crystal, and obtain the formulation for the non-periodic system as a special case of the periodic formulation with appropriate changes to the boundary conditions. In the periodic case where V eff (ρ, R) is periodic on the unit cell, instead of solving the Kohn-Sham problem on a large periodic supercell, it is computationally efficient to invoke the Bloch theorem [69; 70], which entails solving the reduced Kohn-Sham equations on a much smaller periodic unit cell with periodic boundary conditions on the electronic fields. In particular, the Kohn-Sham eigenfunctions ψ n,k (x) using the Bloch theorem are expressed as
10where i = √ −1 and u n,k (x) is a complex-valued function that is periodic on the unit cell satisfying u n,k (x + L r ) = u n,k (x) for all lattice vectors L r , and k denotes a point in the first Brillouin zone of the reciprocal space. Substituting the above in Eq. 1, the reduced Kohn-Sham equations on the unit cell are given by
11where V loc eff (ρ, R) and V nl eff (x, y, R) are the local and non-local contributions to V eff (ρ, R), with the non-local contribution arising from the consideration of pseudopotentials. We note that the governing equations for the non-periodic case are recovered from Eq. 3 by replacing the periodic geometry with a non-periodic simulation domain along with appropriate boundary conditions, and considering only the Γ-point (k = 0). In the above, the electron density ρ is given in terms of the orbital occupancy function f n,k = f (ǫ n,k , µ) ∈ [0, 1] and the canonical wavefunctions as
12where ffl BZ denotes the volume average of the integral over the Brillouin zone corresponding to the periodic unit cell Ω p , and µ represents the Fermi-energy, determined by the constraint on the total number of electrons in the system (N e ) given bŷ
13To avoid numerical instabilities, particularly in metallic systems with large number of eigenstates around the Fermi energy, we use a smooth Fermi-Dirac distribution [1; 56] for f given by
14where σ = k B T denotes the regularization parameter with k B denoting the Boltzmann constant and T representing the finite electronic temperature. We note that f (ǫ i , µ) is denoted as f i in the remainder of the manuscript. The effective single electron potential, V eff (ρ, R), is composed of:
15where V xc (ρ) is the functional derivative of the exchange-correlation energy functional E xc (ρ), which accounts for the many-body quantum-mechanical interactions between electrons [71]. We adopt the generalized gradient approximation (GGA) [69; 72] for the exchange correlation functional description throughout the manuscript, which is given by the following semi-local form:
16We remark that DFT-FE also implements other local and semi-local functional forms (LDA, LSDA, SGGA). The term V el (ρ, R), in the effective potential (Eq. 7), is the variational derivative of the total classical electrostatic interaction energy inside the periodic unit cell, which is composed of
17where, E H , E ext and E zz denote the electrostatic interaction energy between electrons (Hartree energy), interaction energy between nuclei and electrons, and repulsive energy between nuclei, respectively. These are given by
18where Z a denotes the charge on the a th nucleus in the periodic unit cell, and the summation over r extends over all the lattice sites in the infinite periodic crystal. Further, all integrals involving x in Eqs. 10 are over the periodic domain represented by the unit cell, whereas the integrals involving y are over R 3 . Henceforth, unless otherwise specified, we will adopt this convention. In the case of pseudopotential treatment, where only the valence electronic wavefunctions are computed in an effective potential generated by the the nucleus and the core electrons, E ext in Eq. 10 is defined as
19In the above, V a psp,loc denotes the local part of the pseudopotential operator, and E psp,nl is the non-local pseudopotential energy given by
20where V nl eff (x, y, R) := a r V a psp,nl (x, y, R a +L r ) denotes the non-local part of the pseudopotential operator. In DFT-FE , we employ norm-conserving pseudopotentials, and the action of V nl eff (x, y, R) on a wavefunction is given by the following separable operator form [69; 73]:
21with C a,nk lpm =Ω p r ′ χ a lpm (y, R a + L r ′ )e ik·(y−L r ′ ) u n,k (y) dy,
22where l denotes the azimuthal quantum number, m denotes the magnetic quantum number, |χ lpm denotes the pseudopotential projector with p denoting the index corresponding to the projector component for a given l, h lp denotes the pseudopotential constant, and |ξ a lm denotes the single atom pseudo-wavefunction. The above form applies to both Troullier-Martins (TM) pseudopotential [74] and optimized norm conserving Vanderbilt pseudopotential (ONCV) [75], both of which are implemented in DFT-FE [28]. We note that the all-electron treatment in E ext is recovered from Eq. 11 by setting V psp,nl = 0 and V a psp,loc (|x − (R a + L r )|) = − Za |x−(Ra+Lr)| . Next, we discuss the reformulation of electrostatics as local variational problems, which is based on our previous works [28; 76; 22], while highlighting the key difference in this work in the efficient treatment of nuclear charges. First, we briefly discuss the local reformulation using the conventional approach of regularized Dirac distributions, where we begin by defining a nuclear charge
23denoting a regularized Dirac distribution centered at R a . Using the regularized Dirac distribution and rearranging the electrostatic energy terms into charge neutral groups, the total electrostatic interaction energy in Eqs. 10-11 is reformulated as
24We note that the last two terms are not present in the case of an all-electron treatment. Subsequently, to efficiently compute terms with extended interactions in the electrostatic interaction energy in Eq. 14, we reformulate them by defining auxiliary electrostatic potentials as discussed in [77; 22; 78], and rewrite the electrostatic energy in Eq. 14 as the following local form:
25where ϕ(x, R) and V a δ (x, R a ) are the auxiliary electrostatic potentials corresponding to the total charge distribution (ρ + b) and the a th nuclear charge b a δ , respectively, given by:
26The above potentials can be efficiently computed by taking recourse to the solution of a Poisson problem, as the kernel of the extended interaction corresponds to the Green's function of the Laplace operator.
27The above local formulation of electrostatics has been efficiently implemented in DFT-FE 0.6 [28] using finite-element (FE) discretization, where the point nuclear charges are enforced to be coincident with the corner nodes of the FE triangulation. The FE discretization provides the regularization of the solution of V a δ and ϕ, and we refer to [22] for a detailed discussion and systematic convergence studies. However, this approach requires a more refined discretization around the nuclei for an accurate solution of the Kohn-Sham ground-state problem, even in the case of pseudopotential calculations with a smooth external potential, V a psp,loc (|x − R a |). To alleviate these issues, in this work, we consider fictitious non-overlapping smeared nuclear charges,
28, in the spirit of [79]. This results in significantly smoother auxiliary electrostatic potentials, which are free of the Coulomb singularities, and are denoted by:
29where V a sm (x, R a ) matches the exact nuclear potential (− Za |x−Ra| ) beyond a certain cutoff radius, denoted by r a c . The modified local reformulation of electrostatics incorporating the above auxiliary potentials is obtained as
30where the all-electron treatment is obtained by setting V a ext,loc (|x−R a |) = V a nuc (|x−R a |) := − Za |x−Ra| , and the pseudopotential treatment is given by setting V a ext,loc (|x − R a |) = V a psp,loc (|x − R a |). Next, following [79], we define b a sm to be b a sm (r) = − Z a g(r, r a c ) ,
31where g(r, r a c ) denotes a smooth radial smeared charge distribution for a unit charge, which is strictly local within r ≤ r c and integrates to unity. Further, the value of r a c for each atom is chosen to be smaller than half the nearest neighbour distance. Here, we use the following second-derivative continuous form for g(r, r c ) [79]:
32We remark that a similar smeared nuclear charges strategy has also been adopted in a recent work [35], involving enriched finite-elements for solution of all-electron Kohn-Sham DFT equations. Finally, incorporating the functional derivative of the local reformulation of the electrostatic energy with smeared nuclear charges in Eq. 18 into Eq. 3, the governing equations of Kohn-Sham DFT for the periodic unit cell are:
33V a psp,nl (x, y, R a + L r )e ik·y u n,k (y) dy = ǫ n,k u n,k on Ω p , ; ∀ k ∈ BZ
34where the action of the non-local pseudopotential operator, V a psp,nl , is given in Eq. 13. We note that the above equations can be easily modified to the non-periodic setting by considering (k = 0, L r = 0) and replacing Ω p with Ω 0 , which denotes a large non-periodic domain with a vacuum layer surrounding the material system with appropriate Dirichlet boundary conditions on ϕ.
Configurational forces with smeared nuclear charges
35Evaluation of ionic forces and periodic unit cell stresses in DFT are required for structural optimization and molecular dynamics. In DFT-FE, we employ the configurational forces approach [76] to evaluate them in an unified and variationally consistent manner. The formulation naturally accounts for the dependence of the basis functions on the ionic positions (Pulay force corrections), in this case the FE basis functions. The configurational forces are evaluated as the generalized directional derivative of the Kohn-Sham free energy functional with respect to the position of the material point x. The Kohn-Sham free energy for a given position of atoms is formulated as a local variational problem, whose Euler-Lagrange equations correspond to the Kohn-Sham governing equations (cf. Eq. 21). We refer to [76] for a detailed discussion on the derivation of configurational forces, and to [28] for the configurational force expression used in DFT-FE 0.6, which includes the expressions involving GGA type exchange correlation functionals.
36The expression for the configurational forces, which we derive below, differs from our previous works in several key aspects of the derivation. First, is the use of non-overlapping smeared nuclear charges, b a sm (|x − R a |), in the local reformulation of the electrostatics in this work (cf. Eq. 18) instead of the regularized Dirac distributions, b a δ (|x − R a |), used in our previous works. In our previous formulation [76], we impose rigid body constraints to the perturbation of the material point x in the compact support of the regularized Dirac distribution nuclear charge in order to preserve the integral constraint´b a δ (|x − R a |)dx = 1. We note that the above regularization and rigid body perturbation constraints are naturally realized in the previous formulation by considering the charge distribution as point charges coincident with the nodes of the FE triangulation. However, in the current formulation, the smeared nuclear charges are independent of the underlying FE discretization. Thus we relax the aforementioned constraints leading to additional terms in the configurational force expression. The second key difference from the previous formulation is in the treatment of the smeared charge self potential, V a sm (x, R a ), where we no longer assume that this is a radial function dependent only on |x − R a |, which may not hold for the FE discretized potential due to discretization errors. In order to compute the relevant response of V a sm (x, R a ) with respect to perturbation of the material point x, we separately consider the response of perturbations with respect to x, y and R a in the non-local expression for V a sm (x, R a ) =´R 3 b a sm (|y−Ra|) |x−y| dy (cf.
37Eq. 17.). We develop strategies to evaluate the resulting terms in an accurate and efficient manner. Finally, the other remaining consideration in this work is the use of integration by parts to transfer the gradient operators away from potentially non-smooth fields (e.g. non-local pseudopotential projectors) on to the solution fields (u n,k (x), ϕ(x), V a sm (x, R a )), which are relatively smoother in case of pseudopotential calculations. This results in a drastic reduction in the number of quadrature points required to accurately integrate the terms involving the smeared nuclear charges, local part of the pseudopotential, and non-local pseudopotential projectors.
38The starting point for deriving the configurational forces is the local variational problem of the Kohn-Sham free energy F 0 (R). Based on prior work [76; 28], the local variational problem can be formulated in terms of wavefunctions, fractional occupancies and the electrostatic potentials as:
39where
40where Y and H 1 (R 3 ) denote suitable function spaces. In the above, we note that
41The energy functional corresponding to electrostatic energy, L el using the local reformulation of the electrostatics with smeared nuclear charges (cf. Eq. 18) is expressed as:
42where V a sm denotes the electrostatic potential corresponding to the a th nuclear charge. Let τ ε : Ω p → Ω p ′ represent the infinitesimal perturbation of the underlying space that preserves the periodic geometry. The mapping of a material point x to a new point x ′ , given by
43where Υ denotes the generator of this mapping. Further, the reciprocal space also gets perturbed by the mapping κ ′ = κ ε (k) due to the perturbation of the real-space. Denoting F 0 ( τ ε ) to be the ground-state free energy in the perturbed space, the configurational force with respect to this perturbation along the generator Υ is evaluated by computing the Gâteaux derivative of F 0 ( τ ε ) given by
44where E, E ext,corr and E ′a denote the Eshelby tensors whose expressions in terms of the solutions of the saddle point problem (22) on the unperturbed space (x) are provided below. If U = {ū 1,k ,ū 2,k ,ū 3,k · · ·ū N,k } denote the Kohn-Sham eigenfunctions corresponding to the lowest N eigenvaluesǭ = {ǭ 1,k ,ǭ 2,k , · · · ,ǭ N,k } with occupanciesf = {f 1,k ,f 2,k · · ·f N,k }, andφ denotes the electrostatic potential-all solutions of the saddle point problem (22))-the expressions for the Eshelby tensors: E, E ext,corr , E ′a , and force terms: F sm , F ext,corr , F psp,nl in Eq. 28 are given by
45Further,
46and finally, F psp,nl = F nl + F nl * , with
47In the above, the terms F sm and F ext,corr , which capture the electrostatic contributions related to smeared nuclear charges and external potential correction, are the significant changes compared to previous versions of DFT-FE [28; 76]. We refer to Appendix A for details regarding the combined evaluation ofΩ p E ext,corr : ∇Υ(x) dx + F ext,corr , requiring additional consideration for accurate and efficient evaluation of
48Further, we refer to [76] for the detailed expression and derivation of F
49. Additionally, we refer to [78; 76] for details on recasting the integral over R 3 in the third term in Eq. 28, as sum of integrals over bounded domains and surface integrals on the bounded domains. We remark that using Eq. 28, the i th component of the ionic force on any given atom is computed by choosing the compact support of the generator, Υ i (x), to contain only the atom of interest. Along similar lines, the periodic unit cell stress tensor is evaluated by choosing the generator to be an appropriate affine transformation: Υ i = C ij x j , as explained in [76]. In the context of ionic forces for the pseudopotential case, we employ a further simplification in the evaluation of the configurational forces by taking advantage of the smooth electronic fields to allow the atom positions to float independent of the underlying space. The ionic forces are computed in this case by setting Υ(R a +L r ) to be an unit vector along the desired force component and setting Υ(x) = 0. The ionic force expression thus obtained can be shown to be equivalent to the Hellman-Feynman force [69], as would be expected.
Discrete Kohn-Sham DFT equations
50We now present the discretization of the Kohn-Sham DFT problem using a finite-element (FE) basis, which is a piecewise polynomial and strictly local basis set [80]. In particular, we employ C 0 continuous Lagrange polynomials generated using Gauss-Lobatto-Legendre (GLL) nodal points, also known as spectral finite-elements (FE). We refer to our prior work [22] for details on the adaptive higher order spectral FE based discretization of the Kohn-Sham equations. We briefly discuss these aspects, and also present those aspects that differ in this work compared to the previous implementation, DFT-FE 0.6 [28]. We begin by discretization of the electronic fields in the Kohn-Sham problem Eq. 21-the wavefunctions and the electrostatic potentials-in the FE basis given by
51where N h j : 1 ≤ j ≤ M denotes the strictly local Lagrange polynomials generated using the nodes of the FE triangulation, T h , with the characteristic mesh size denoted by h. Further, the order of the interpolating polynomials is denoted by p. u h n,k , ϕ h and V a h sm denote the FE discretized fields, with u j n,k , ϕ j and V a j sm denoting the coefficients in the expansion of the n th discretized wavefunction and the electrostatic potentials. The coefficients are also referred to as the nodal values of the discretized fields represented using the FE triangulation. Systematic reduction of the discretization error using the above FE basis is achieved through reducing h, or increasing p. We refer to [22] for derivation of a priori error estimates for the discrete ground-state energy of the Kohn-Sham problem, with respect to h and p.
52Applying the above FE discretization to the Kohn-Sham eigenvalue problem in Eq. 21 results in a generalized hermitian eigenvalue problem (GHEP) given by H kû n,k = ǫ h n,k Mû n,k where H k denotes the discrete Hamiltonian matrix, M denotes the overlap matrix (or commonly referred to as the mass matrix in finite element literature), and ǫ h n,k denotes the n th eigenvalue corresponding to the discrete eigenvectorû n,k . The discrete Hamiltonian matrix is further decomposed as H k = H loc,k + H nl,k , where
53In the above, V h eff,loc (ρ h , R) is given by:
54where V a h sm (x, R a + L r ) is obtained by solving the following discretized Poisson equations:
55Here, Ω a denotes a bounded domain enclosing the atom a with Dirchlet boundary conditions set to the exact nuclear potential, V a nuc (|x − R a |). The distance of the Dirchlet boundary of Ω a from R a must be much larger than the smeared charge cut-off, r a c , for an accurate solution of V a h sm . We note that, in the case of all-electron calculations, V a ext,loc (|x − (R a + L r )|) = V a nuc (|x − (R a + L r )|) and H nl,k is zero. In the case of pseudopotential calculations, V a ext,loc (|x − (R a + L r )|) = V a psp,loc (|x − (R a + L r )|) and additionally, H nl,k is given by
56(33) Finally, the matrix elements of the overlap matrix M in the GHEP are given by M jk =
57We note that the matrices H loc,k and M are sparse as the FE basis functions are strictly local in real space with a compact support over elements sharing a given FE node. Further, the vectors C a,k lpm,j in H nl,k are also sparse since the projectors χ a lpm (x, R a + L r ) have a compact support, thus rendering a sparse structure to the discrete Hamiltonian H k .
58We transform the GHEP into a standard Hermitian eigenvalue problem (SHEP), which can be solved more efficiently. Using the fact that there exists an unique positive definite symmetric square root of M, the GHEP-H kû n,k = ǫ h n,k Mû n,k -is transformed to the following SHEP:
59However, the evaluation and application of M −1/2 is computationally expensive. To this end, we employ Gauss-Lobatto-Legendre (GLL) quadrature rules-with quadrature points coincident with the nodes of the spectral FE basis-to evaluate the integrals in the overlap matrix, which renders the overlap matrix diagonal [22]. Furthermore, H k , the Hermitian matrix in the SHEP, retains the sparsity of H k in the GHEP. Finally, the discrete Kohn-Sham eigenvalue problem along with the discretized Poisson equation for the total electrostatic potential ϕ h are given by:
60which are solved self-consistently to obtain the electronic ground-state. Subsequently, we compute the discrete total ground-state energy E h in terms of the discrete ground-state solution fields (ǭ h n,k ,ρ h ,φ h ) as follows:
61We note that the use of smooth smeared nuclear charges, b a sm allows the nuclear positions to float independent of the FE triangulation, leading to generation of more efficient FE triangulations with relatively coarser h values and higher values of p (p = 6 or 7). Our earlier implementations with the nuclear positions restricted to corner nodes of FE elements typically used p = 4 or 5 with smaller h values, to maintain an appropriate mesh quality around the atom. In the case of all-electron calculations, we still require the nuclear positions to be located on the corner nodes of FE elements, to capture the cusp in the all-electron wavefunctions.
Numerical methodology
62In this section, we discuss the solution procedure for the spectral finite-element discretized Kohn-Sham equations (cf. Eq. (35)), implemented in DFT-FE . DFT-FE is built over the deal.II open-source FE library [81], and uses its infrastructure for adaptive mesh refinement, FE grid handling, and efficient parallel objects. DFT-FE accommodates FE basis with adaptive spatial resolution, which is constructed using an octree-based hexahedral mesh generator based on the p4est library [82] through deal.II. We refer to [28] for a detailed discussion on the adaptive refinement strategies implemented in DFT-FE in the context of both pseudopotenial and all-electron problems.
63Starting from an initial guess for Kohn-Sham electron density and eigenfunctions, the discrete nonlinear SHEP is solved self-consistently along with Poisson equations (cf. Eq. (35)) to compute the Kohn-Sham ground-state solution. In particular, the nonlinear SHEP problem is treated as a fixed point iteration-also referred to as the self-consistent field (SCF) iteration-in terms of electron density: ρ h = F (ρ h ), where F (ρ h ) involves computing the occupied eigenspace for a given ρ h . We employ Anderson and Broyden electron density mixing schemes [83; 84] to accelerate the fixed point iteration. Additionally, we have implemented the Kerker preconditioner [85], which provides an improved SCF convergence rate that is expected to be independent of system size for homogeneous metallic systems. In each SCF iteration step, we use a computationally efficient and scalable Chebyshev polynomial filtered eigensolver (ChFES) [86; 22; 28] to evaluate the occupied eigenspace of the discrete Kohn-Sham Hamiltonian. Furthermore, in each SCF iteration step, the total electrostatic potential is computed by solving a Poisson problem, using a Jacobi preconditioned conjugate gradient solver. Algorithm 1 lists all the steps in the SCF procedure followed in DFT-FE . We remark that although the formulation in Section 2 is presented in the context of multiple kpoints sampling the first BZ zone, going forward we drop the dependence on k-points for notational convenience and clarity. All the numerical methods discussed below easily extend to multiple kpoints.
64The most dominant computational step in each SCF iteration (Algorithm 1) is the ChFES procedure, which involves the Chebyshev polynomial filtering (CF) and the Rayleigh-Ritz (RRGEP) steps. CF scales quadratically with system size, and is observed to be the dominant computational cost for small and medium system sizes. However, for large system sizes the cubic-scaling computational cost of RRGEP dominates. The numerical implementation of ChFES in DFT-FE 0.6 [28] enabled fast and large-scale DFT calculations by using scalable numerical algorithms and reduction of the computational prefactor of the cubic-scaling Rayleigh-Ritz procedure through development of mixed-precision strategies combined with a spectrum splitting approach. The numerical algorithm of ChFES in this work is along similar lines as DFT-FE 0.6. For the sake of completeness, we will briefly review the numerical methodology of ChFES, and also discuss the modified Rayleigh-Ritz procedure employed in the present work. [RRGEP] Rayleigh-Ritz generalized eigenvalue problem in the subspace spanned by Ψ f :
65using a mixing scheme, and go to step 3.
Chebyshev filtered eigensolver
66In order to solve the SHEP problem-H Ψ i = ǫ h i Ψ i -we use the Chebyshev filtering procedure [86; 22], which exploits the fact that the eigenstates of interest correspond to the lowest occupied states (wanted eigenspectrum). The main idea behind the Chebyshev filtering approach is to construct a scaled-and-shifted Hamiltonian (H = c 1 H + c 2 ) such that the desired (wanted) eigenspectrum of the discrete Kohn-Sham Hamiltonian ( H) is mapped to (-∞, -1) and the remainder of the eigenspectrum is mapped to (-1,1). Subsequently, exploiting the property of Chebyshev polynomials, which have a fast growth in (-∞, -1) and (1,∞) but take small values in [-1,1], a subspace that is a close approximation to the desired eigensubspace can be computed. To elaborate, the Chebyshev filtered eigensolver (ChFES) is based on the action of a degree m Chebyshev polynomial filter acting on an input subspace Ψ in given by the following recursive iteration:
67where the choice of m is based on the upper bound of H, which is related to the smallest mesh size [28]. The resulting subspace of Chebyshev filtered vectors, Ψ f , is a good approximation to the desired eigenspace, with the approximation error decreasing systematically with the degree of the polynomial. Further, the Chebyshev filter operations are applied to all wavefunction vectors simultaneously which lends to efficient implementation on modern computing architectures, as will be discussed later in Section 4. Upon computing Ψ f , the desired eigenstates of H required for computing the electron density are obtained by a Rayleigh Ritz procedure (step 5.b in Algorithm 1), which involves projecting the SHEP onto the subspace spanned by Ψ f and subsequently solving a much smaller generalized Hermitian eigenvalue problem (GHEP). We next discuss the numerical algorithm of the RRGEP procedure.
683.2. Rayleigh-Ritz step with spectrum-splitting and mixed precision algorithms, and electron density computation
69The cubic scaling RRGEP procedure in our ChFES solver employs two key ideas-spectrumsplitting approach and mixed precision algorithms-to reduce the computational prefactor. First, considering the spectrum-splitting approach, the key idea is that the lowest N oc eigenstates of the Kohn-Sham eigenvalue problem H Ψ i = ǫ h i Ψ i with orbital occupancy f i = 1 are not explicitly necessary for the computation of the electron density. This allows us to reformulate the density computation as only requiring the top N fr = N − N oc fractionally occupied eigenstates ( Ψ R fr ofĤ) and the orthonormalized Chebyshev filtered wavefunctions ( Ψ o ) (cf. Algorithm 3). For typically used Fermi-Dirac smearing temperatures ∼ 500 K, N fr is 10-15% of N even for metallic systems, which can provide significant computational prefactor reduction in the RRGEP procedure. We remark that the computational advantages of using spectrum-splitting approach have been demonstrated in DFT-FE 0.6 [28], with the algorithm being adapted from developments in previous works [12; 87; 88].
70where Q fr and D fr denote the top N fr fractionally occupied eigenstates of the projected Hamiltonian with D fr containing the corresponding eigenvalues in ascending order, and (iii) (RRGEP-ST) Transform the fractionally occupied eigenstates to the FE basis ( Ψ R fr = Ψ f Q fr ) as well as compute the orthonormalized Chebyshev filtered wavefunctions ( Ψ o = Ψ f L −1 † ). Subsequently, Ψ R fr , Ψ o , and D fr are used to compute the output electron density, ρ h out (x) at quadrature points inside each FE cell (cf. Algorithm 3). In the above, the use of spectrum-splitting approach reduces the computational cost scaling of Ψ R fr in RRGEP-ST-F step to O(M N N fr ) from O(M N 2 ). Furthermore, in the RRGEP-D step, the resulting SHEP solve (after recasting the GHEP) now entails a partial diagonalization problem, which can also be performed with a reduced prefactor. In DFT-FE, we perform partial diagonalization using ELPA library's [89; 90] direct eigensolver.
71To further enable computational prefactor reduction of our RRGEP algorithm, we employ mixed precision arithmetic. Mixed precision computing strategies provide significant reductions in computational and data movement costs on modern computing architectures, and thus are being increasingly adopted in scientific computing. However, due to the stringent accuracy requirements in DFT solvers, there has only been a limited exploration of mixed precision strategies in DFT solvers [16; 28; 29]. In the context of the ChFES procedure, a FP64-FP32 mixed precision algorithm has been developed in DFT-FE 0.6 [28] for the orthogonalization and Rayleigh-Ritz steps. Similar mixed precision strategies are used in this work in the context of the generalized eigenvalue problem based RRGEP procedure. The key idea exploited here is that the Chebyshev filtered vectors, Ψ f , adaptively approach the eigenvectors corresponding to the lowest N states of H. Accordingly, the overlap matrix S = Ψ † f Ψ f and the projected Hamiltonian matrixĤ = Ψ † f H Ψ f approach diagonal matrices as the SCF approaches convergence. We take advantage of this to use mixed precision strategies for the dominant O(M N 2 ) steps in steps 1 and 3 of Algorithm 2. In particular, for the computation of S = Ψ † f Ψ f and Ψ o = Ψ f L −1 † , the diagonal entries are computed in FP64 while the off-diagonal entries are computed in FP32 as their contribution tends to zero as the Algorithm 2 Generalized eigenvalue problem based Rayleigh-Ritz step with spectrum-splitting procedure:
72Compute matrices for projection of Kohn-Sham eigenvalue problem onto the subspace spanned by Ψ f :
73Solve for N fr highest eigenstates of the generalized hermitian eigenvalue problem (GHEP) :
741: Compute Fermi-energy (µ) using the constraint:
75Compute electron density at any point x belonging to a FE cell e: SCF approaches convergence. Next, in the case of the projected Hamiltonian matrixĤ = Ψ † f H Ψ f , we use a mixed strategy which takes advantage of bothĤ approaching diagonal matrix as well as the spectrum-splitting method in RRGEP. In this approach, we consider the following split of the Chebyshev filtered wavefunctions
76where the columns Ψ oc f and Ψ fr f contain the first N oc and the remaining N fr wavefunctions, respectively. Subsequently, we computeĤ in mixed precision as
77where we exploit the fact that as the SCF approaches convergence, the diagonalization step in RRGEP (step 2 of Algorithm 2) to compute the N fr highest eigenstates of the GHEP:ĤQ fr = SQ fr D fr , tends to be solely determined by the smallĤ fr−fr block ofĤ [28].
78The accuracy and robustness of the above mixed precision strategies have been demonstrated in DFT-FE 0.6 [28] on various pseudopotential benchmark problems. In particular, the number of SCF iterations remains unchanged between double precision and mixed precision simulations, and the error in the energy and ionic forces due to mixed precision is more than two orders of magnitude lower than the discretization errors. In this work, we further demonstrate accuracy and robustness of our mixed precision RRGEP implementation by comparing the energy, ionic forces and cell stresses against QE for benchmark problems, as will be discussed in Section 5.1. Finally, the performance benefits of using the above mixed precision strategies on hybrid CPU-GPU architectures are demonstrated in Section 4.4.
General implementation strategy
79The central consideration in DFT-FE 1.0 implementation strategy for the SCF procedure (cf. Algorithm 1) is on reducing data-movement and data-access costs while exposing fine grained parallelism in the computation on modern many-core CPU and hybrid CPU-GPU architectures. Given the heavy penalty associated with data movements, both intra-node as well as inter-node data transfers, relative to the fast compute performance on hybrid CPU-GPU architectures, such considerations are critical to maximize performance and parallel scalability of the key computational kernels in our SCF procedure, as will be demonstrated below. All the key computational kernels in our Chebyshev filtered eigensolver based SCF procedure, namely CF, RRGEP and DC can be First, in the case of CF, the core computational kernel HX (as part of the Chebyshev recursive iteration in Eq. 37, with X being the intermediate wavefunctions vectors), is a FE discretized sparse-matrix times a dense-matrix (sparse-dense) multiplication. Particularly, in the context of FE discretization, this operation is very amenable to GPU acceleration. We recast the above sparse-dense multiplication as small FE cell level dense matrix times dense matrix (dense-dense) multiplications simultaneously across all FE cells in a given processor. These simultaneous densedense multiplications are performed very efficiently by optimized math libraries on either CPUs or GPUs, and combined with our contiguous data access patterns, allows to significantly boost the arithmetic intensity by lowering the data access costs. Section 4.3 discusses more on these aspects and provides the relevant performance benchmarks on hybrid CPU-GPU architectures. Further, efficient construction of these FE cell-level dense matrices ( H) is discussed in Section 4.2 below.
80Next, we consider the O(M N 2 ) steps in RRGEP-OP and RRGEP-ST that constitute large dense-dense multiplications. In general, such operations are able to achieve high performance on many-core CPU architectures and hybrid CPU-GPU architectures. However, in our case they present a unique challenge due to the extreme aspect ratios (M/N ≫ 1) involved. To this end, in Section 4.4, we adopt a scalable approach that boosts the overall performance by reducing the data movement costs significantly. Another important aspect of our implementation is the use of mixed precision strategies and the use of a column-blocked approach to matrix-matrix multiplications in CF, RRGEP-OP and RRGEP-ST. While mixed precision strategies speed up compute as well as reduce data movement costs, the blocked approach to matrix operations provide other benefits-reduction of peak memory, and opportunities to overlap compute and communication. Furthermore, optimal hardware aware data transfer pathways such as GPU direct communication are also used to reduce data movement costs in the RRGEP-OP and RRGEP-ST. Sections 4.3 and 4.4 elaborate on these aspects and demonstrate relevant performance benchmarks on hybrid CPU-GPU architectures.
81Finally, in the case of O(N 3 ) RRGEP-D step, we use the scalable direct eigensolver approaches using the state-of-the-art ELPA library [89], which has been efficiently implemented both for manycore and hybrid CPU-GPU architectures [91; 90]. Upon efficient implementation of the above core computational kernels, the bottlenecks in performance shifted to the remaining O(M N ) scaling steps-density computation (DC) and computation of ionic forces (IF)-which are also optimized for both CPUs and GPUs, using similar strategies as outlined above. We also remark that initialization costs (INIT), total electrostatic potential solve (TEP), and electron-density mixing schemes (DM) are the other remaining costs which are not yet ported to GPUs, but optimizations have been performed to ensure they constitute a small portion of the total run-time.
FE cell-level Hamiltonian matrix construction
82We describe a computationally efficient procedure for the construction of discretized Hamiltonian matrix at the finite-element cell level focusing on increasing the arithmetic intensity and reducing the data-access costs. This is accomplished by recasting the quadrature integrations arising in Eq. 30 in the form of BLAS level 3 matrix-matrix multiplications which can in-turn utilize optimized math kernel libraries in CPUs/GPUs to perform these arithmetic operations. In particular, we focus here on the second and third term of the Eq. 30 which is computed for every self-consistent field iteration. Recall from Eq. 30, the contribution to the discretized Hamiltonian matrix for a given FE cell (e) corresponding to V h eff,loc (ρ h , R) can be written aŝ
83where 1 ≤ j, k ≤ M cell with M cell denoting the number of FE nodes in a given cell (e) and further, I = (j, k) 1≤j,k≤M cell is the composite index. In the above equation, n q denotes the number of quadrature points in the given FE cell (e), q p denotes the p th quadrature point while w p denotes the corresponding quadrature weight. j p denotes the determinant of the finite-element Jacobian matrix evaluated at the p th quadrature point corresponding to the mapping from the reference cell in the natural coordinate system to the real-space cell [80]. We also note in Eq. 40 that P Ip , the Ip th component of the matrix P is given by
84p , the p th component of the vector v (e) ∈ R nq is given by w p j p V h eff,loc (q p , R). Denoting the number of FE cells present in a given MPI task to be M c , we define a matrix V ∈ R nq×Mc with the vector v (e) forming the e th column of V. Subsequently, the quadrature summation in Eq. 40 for all the cells can be recast as a single matrix-matrix multiplication operation between the matrices P and V as:
85We note that for a p th quadrature point, the product P Ip = N h i (q p )N h j (q p ) is symmetric with respect to i and j for a given composite index I, and, consequently, the terms in the product corresponding to i ≥ j are only stored in the matrix P. Hence, the size of the matrix P in Eq. 41 is M sym × n q where M sym = M cell (M cell + 1)/2
86An additional contribution to the discretized Hamiltonian matrix (third term in Eq. 30) arises in the case of GGA exchange-correlation functional and involves the spatial derivatives of FE basis functions. This can be written in terms of σ(x) = |∇ρ(x)| 2 and the derivatives with respect to reference FE cell coordinate directions [ξ = (ξ 1 , ξ 2 , ξ 3 )] as follows:
87where 1 ≤ j, k ≤ M cell and J −1 denotes the inverse of the finite-element Jacobian matrix. The summation over quadrature points and the spatial directions in Eq. 42 for all M c cells in a given MPI task can be recast as a matrix-matrix multiplication operation as shown below:
88where
89In the above, P qp ∈ R Msym×3 is evaluated for every quadrature point q p . As before, with I = (j, k) 1≤j,k≤M cell ; j≤k denoting the composite index and s = {1, 2, 3} denoting the spatial coordinate index, the Is th component of matrix P qp ∈ R mc×3 is given by
90The matrix V qp ∈ R Mc×3 evaluated for every quadrature point q p . Denoting e th row vector of the matrix V qp to be v qp (e) , the s th component v qp (e) is given by v qp s
91Similar ideas as discussed above are also used to recast the FE discretized matrix arising in the Performing the resulting sparse-dense matrix products using the conventional approaches at the global level is not ideal on modern supercomputing architectures as they incur high global memory access costs [92]. In DFT-FE , we significantly reduce the memory access costs in the core computational kernel HX by employing FE cell level dense matrix operations instead of global sparse matrix approaches. To elaborate, in the H loc X operation, we recast it as X c i are performed very efficiently on both many-core CPU and hybrid CPU-GPU architectures using batched xGEMM routines. Particularly on GPUs, the FE cell structure naturally exploits the massive fine grained parallelism available on GPUs by simultaneously performing the dense-dense matrix multiplications for all cells using cuBLAS library's xGEMMStridedBatched routine. We further remark that, to reduce the peak memory during the CF procedure, each H loc X evaluation is performed using a block approach. To this end, blocks of B f wavefunction vectors, denoted by X b , are filtered sequentially. Figure 1 shows the schematic of the blocked H loc X implementation, consisting of three key steps:
92, and (iii) the final assembly step into Y b , which also involves accumulation of contributions from MPI partition boundary DoFs via MPI point-to-point communication calls.
93To efficiently perform the memory bound data-movement operations in the extraction and assembly steps above, we structure the memory layout and implementation of data-movement computational kernels (CUDA kernels in case of GPU) such that the multiple wavefunction values are accessed from (written to) the global memory contiguously for each FE degree of freedom. This provides coalesced memory access across GPU threads to maximize the memory bandwidth of reading from the global RAM, as well as improving cache locality on many-core CPU architectures. Such strategies are critical to obtain performance on hybrid CPU-GPU architectures, as will be demonstrated below. The above data-movement aware implementation strategy also extends to MPI point-to-point communication costs in the ASEMB FEM step. In particular, we exploit the fact that all wavefunction components of Y b have identical MPI point-to-point communication pattern across the FE domain decomposition partition boundaries. This allows us to perform the MPI communication for all wavefunction components simultaneously, which incurs minimal network latency compared to communicating the wavefunction vectors one by one.
94Additionally, in the case of pseudopotential calculations, H nl X operation (cf. Algorithm 4) is performed in every Chebyshev recursive iteration. Our implementation strategy for H nl X follows along similar lines as H loc X. We exploit the sparse structure of H nl in real-space to efficiently compute H nl X. To this end, we construct FE cell level pseudopotential projector matrices C c i (cf.
95Algorithm 4 and Eq. 33), which denotes a matrix containing the C a lpm,j values for all M cell (j index in C a lpm,j ) FE shape functions belonging to the c i th FE cell and for all N c i psp = {a, lpm} pseudopotential projectors χ a lpm (x, R a ) which have a non-trivial compact support over the same FE cell. This renders C c i matrices to be of size M cell ×N c i psp . Subsequently, for the first computational step in Algorithm 4,
96we use xGEMMStridedBatched (with zero padding on C † c i due to variable N c i psp ) on GPUs to efficiently perform the FE cell level dense-dense matrix multiplications. Next, we perform the assembly of contributions of the resulting product matrices P c i b from all FE cells within the compact support of the pseudopotential projectors to obtain P b (cf. step 3 in Algorithm 4), using MPI point-to-point communication calls. The implementation of remaining steps in H nl X, follow along similar lines as discussed above. We also note that the efficient memory layout structure for coalesced memory access across GPU threads discussed previously in the context of H loc X also extends here, where we read/write all the B f wavefunction values in a given block contiguously for each pseudopotential projector index. The above implementation innovations lead to a high overall throughput performance for CF in
Rayleigh Ritz procedure
97The Rayleigh-Ritz (RRGEP) step of the ChFES procedure in Algorithm 1 involves the computation of matrix-matrix multiplications of the form A = X † Y (RRGEP-OP), diagonalization We remark that the aspect ratios of X, Y and X ′ are very large M/N ≫ 1, and the computational complexity of these operations scale as O(M N 2 ). This extreme aspect ratio presents unique challenges to develop a computationally efficient and a scalable implementation for these operations. Furthermore, scaling DFT-FE calculations to large-size problems ( N > 20, 000) requires strategies to address the N × N matrix memory footprint of A and Z owing to limited memory available on each GPU. We now present approaches that address these challenges in the present work.
98We first discuss the scalable strategies employed in the matrix-matrix multiplication of the type A = X † Y arising in the computation of the overlap matrix S in RRGEP-O and the projected HamiltonianĤ in RRGEP-P. Due to the large aspect ratios of X and Y, the traditional ways of storing these matrices in block-cyclic layout are not well suited as this would make the receiving processors (holding A) to perform all the computations, leading to a communication bottleneck with a cost scaling as O(N 2 M ). Instead, the optimal data distribution we employ divides X and Y equally among available processors P , into equi-partitioned matrices X p and Y p of size M loc × N with M loc ≈ M/P . This is achieved via the domain decomposition of the FE mesh. Since the computation of X † Y is similar to a vector dot product, we compute on GPUs a N × N matrix A p = X p † Y p associated with each processor locally and then sum these matrices in log P steps by making use of MPI collectives. This results in a communication cost of O(N 2 log(M )), as P is chosen to be proportional to M .
99Furthermore, for large-scale problems on GPUs, to avoid the huge memory footprint in storing A p , and thereby the matrix A, we employ a blocked approach as shown in Fig. 3(a) with block size N × B v . Each block of A is computed successively by the accumulation of the local contributions (corresponding block of A p ) using the MPI Allreduce collective. Moreover, we exploit the Hermiticity of S andĤ to compute only their lower triangular portion. Subsequently, for efficient matrix computations on A (Cholesky factorization and subspace diagonalization in RRGEP-D), we distribute it using a 2D block-cyclic grid format. In the case of operations of type X ′ = XZ arising in RRGEP-ST, we employ the optimal data distribution of X as discussed before, and compute X ′ using the local matrix multiplications X ′ p = X p Z (X ′ p and X p denote the local spatial partitions of the global matrices X ′ and X, respectively). Further, as shown in Fig. 3(b), a blocked approach similar to the computation of A is employed to handle the memory footprint of Z. A further exploitation of these blocked approaches is used to develop asynchronous compute-data movement strategies as discussed below.
Asynchronous compute and communication using mixed precision arithmetic
100The O(M N 2 ) operations in Algorithm 2 employ the blocked approach as discussed in Sec. 4.4. In the case of computations of the type A = X † Y, we make use of the fact that the GPU computations involving matrix-matrix multiplications A i p = X † p Y i p associated with block-i can be executed asynchronously with the data movement related to A i−1 p , i.e., GPU to CPU copy of A i−1 p followed by the MPI Allreduce collective operation forming the relevant column block A i−1 . The numerical implementation makes use of two different CUDA streams, one dealing with the compute operations while the other handling the data movement. Additionally, CUDA events are used to record the appropriate compute and data-movement events which allow for inter-stream synchronization of compute and copy operations associated with a given block, while asynchronously executing the data-movement operations related to a previous block. Along similar lines, asynchronous compute and data movement has been implemented for computations of the type X ′ = XZ (cf. Fig. 3 (b)). Moreover, GPU direct communication through NVIDIA Collective Communications Library (NCCL) [93] is used to accelerate inter-GPU communication associated with the aforementioned collective operations in RRGEP. We observe a factor of 1.5 − 1.8× reduction in computational times for RRGEP-OP and RRGEP-ST-O steps of Algorithm 2 by using NCCL. This performance gain can be attributed to better synchronization among communicating processors during the collective operations achieved -via-NCCL. Furthermore, mixed precision strategies are devised for the RRGEP step in Algorithm 1 as explained in Section 3. To this end, the diagonal block entries of overlap matrix S in RRGEP-O are evaluated in FP64 arithmetic while the off-diagonal entries are computed in FP32 arithmetic. Similarly in the case of RRGEP-P, the projected HamiltonianĤ has the entries of the lower right diagonal block evaluated in FP64 while the other blocks are evaluated in FP32 arithmetic (cf. section 3.2). These mixed precision strategies reduce the floating point operations cost involved in the matrix-matrix multiplications and further reduce the data movement costs associated with MPI Allreduce collective operations involved in the construction of S andĤ. Figure 4 demonstrates the performance benefits afforded by our mixed precision and asynchronous compute and data-movement strategies on the key kernels involved in RRGEP-O and RRGEP-P of Algorithm 2 in DFT-FE 1.0 on hybrid CPU-GPU architectures. The benchmark calculation on Mo 13×13×13 , containing 61,502 electrons, is parallelized over 160 Summit GPU Nodes (960 GPUs) with ∼ 17, 000 DoFs per GPU. As evident from the Fig. 4, mixed precision strategies provide a substantial improvement of 1.7 − 1.8× in comparison to FP64 baseline performance of these compute intensive kernels. Moreover, our asynchronous programming strategies further boosted the performance by an additional 1.4 − 1.7×. We also remark that reduction in floating point operation costs and data movement costs is achieved in the case of orthonormal basis construction
Results and discussion
101In this section, we demonstrate the accuracy, computational efficiency and parallel scalability of DFT-FE 1.0 on various benchmark systems on both CPU and hybrid CPU-GPU architectures. The benchmark calculations involve both pseudopotential and all-electron DFT calculations. GGA [72] exchange correlation of the PBE form [94] is employed in all the calculations, and ONCV [75] pseudopotentials from the SG15 [95] and PseudoDojo [96] databases are employed in all the pseudopotential DFT calculations. Further, we use Fermi-Dirac smearing with temperature T = 500 K. Additionally, for mixing the electron density in the SCF iteration, we use n-stage Anderson mixing scheme [83] and Kerker preconditioner [85] for non-periodic and bulk metallic benchmark systems, respectively.
102We consider various periodic and non-periodic pseudopotential and all-electron benchmark systems with different sizes to demonstrate the accuracy and performance of DFT-FE 1.0. The pseudopotential benchmark systems are validated using plane-wave code Quantum Espresso (QE ) [2; 97], while all-electron benchmark systems are validated with the NWChem code [10], which uses Gaussian basis. Specifically, we consider the following pseudopotential benchmark systems: (i) body centered cubic (BCC) Mo periodic supercells with a monovacancy, (ii) non-periodic Icosahedron Al nano-particles, (iii) InP-water interface system. In addition, we consider a non-periodic all-electron benchmark system: (iv) Benzamide molecule. For benchmark systems (i), we use norm-conserving ONCV pseudpotential for Mo from the SG15 database [95] (version 1.0), and for (ii) and (iii) we use ONCV pseudopotentials from the PseudoDojo database [96]. While performance studies are performed on benchmark systems (i) and (ii), the validation studies are performed on the smallest system size among the benchmark systems (i) and (ii), and further for the benchmark systems (iii) and (iv). All validation studies are conducted using a Γ-point calculation. In each of the above benchmark systems, we solve DFT-FE to two levels of discretization errors-medium and high accuracy-and compare against reference values obtained at similar accuracy using QE /NWChem. The medium accuracy standard corresponds to O 10 −4 Ha/atom in ground-state energy, O 10 −4 Ha/Bohr in ionic forces, and O 10 −6 Ha/Bohr 3 in cell stress (in periodic benchmark systems). The high accuracy standard corresponds to O 10 −5 Ha/atom in ground-state energy, O 10 −5 Ha/Bohr in ionic forces, and O 10 −7 Ha/Bohr 3 in cell stress. In the remainder of this paper, we define chemical accuracy as satisfying the medium accuracy standard. Further, we note that all simulations using DFT-FE are ran with mixed precision algorithms enabled in the RRGEP computational step and also employing FP32 communication in the CF computational step (cf. Sections 3 and 4). We remark that although similar performance and validation studies were undertaken in previous work [28] (DFT-FE 0.6) on many-core CPU architectures, these aspects are revisited here for DFT-FE 1.0 due to the modified treatment of electrostatics and configurational forces in the computational methodology and the new hybrid CPU-GPU implementation.
103Most of the simulations reported in this work were executed on the Summit supercomputer, which is currently the second fastest supercomputer in the world, with 200.79 PFLOPS FP64 peak. Summit comprises of 4,608 IBM Power System AC922 nodes with two IBM POWER9 processors (42 physical cores) and six NVIDIA Volta V100 GPUs in each node. Each node contains 512 GB of DDR4 memory for use by the POWER9 processors and 16 GB of HBM2 for each V100 GPU. Summit nodes are connected to a dual-rail EDR InfiniBand network providing a node injection bandwidth of 23 GB/s. On Summit, we have compiled DFT-FE using NVIDIA CUDA/10. Some of the numerical simulations using CPUs reported in this work were also executed on the Cori supercomputer at the National Energy Research Scientific Computing (NERSC) center. In particular, we used Cori's Phase II partition containing 9,688 compute nodes based on Intel Xeon Phi processors. Each compute node has the following specifications: single-socket Intel Xeon Phi 7250 ("Knights Landing") processor with 68 physical cores per node @ 1.4 GHz and 96 GB of memory per node. Cori uses a Cray Aries with Dragonfly topology for inter-node communication with 45.0 TB/s global peak bidirectional bandwidth. The DFT-FE simulations using the Summit GPU nodes reported in this section used all 6 V100 GPUs in each node with multiple MPI tasks (1-3) per GPU via NVIDIA multi-process service (MPS) depending on the system size. DFT-FE simulations using only the CPU cores of the Summit nodes used 42 MPI tasks per node with each MPI task bound to one physical core. Finally, the DFT-FE simulations using the CPU-only Cori supercomputer were run using 32 MPI tasks per node and 2 OpenMP threads (for BLAS operations).
Accuracy validation of DFT-FE 1.0
104In the benchmark systems involving Mo, we consider a periodic supercell constructed from bcc Mo unit cells containing 2 atoms with lattice constant of 5.95 Bohr. Next, we introduce a monovacancy by removing a Mo atom from the supercell. We consider a supercell size of 6×6×6 Mo unit cells, denoted by Mo 6x6x6 , containing 431 atoms (6, 034 electrons). Tables 1a and 1b shows the comparison of ground-state energy, ionic forces and hydrostatic cell stress between DFT-FE 1.0 and QE for medium and high accuracy comparisons respectively, which demonstrates excellent agreement between the two codes for a periodic system. We remark that taking advantage of the modified electrostatics methodology and efficient numerical implementation strategies in this work, we find the most computationally efficient strategy for pseudopotential DFT calculations is to use relatively higher order finite-elements, FE ord = 6/7 (HEX343SPECTRAL/HEX512SPECTRAL) with coarser element sizes compared to DFT-FE 0.6 [28]. Importantly, this provides significant computational efficiency improvements in comparison to DFT-FE 0.6, as will be discussed in Section 5.2.1.
105Next, in the non-periodic benchmark system involving Al, we consider a three-dimensional nonperiodic Icosahedron Al nano-particle [98]. The Icosahedron nano-particles are constructed with nearest neighbour bond length of 6.8 Bohr and varying the number of shells. We consider a Al nano-particle of size: Al 3-Shell containing 147 atoms (441 electrons). For the DFT-FE simulations, we employ non-periodic boundary conditions on a domain with a large vacuum surrounding the Al nano-particle. On the other hand, for the QE simulations, we choose an artificial periodic domain containing the Al nano-particle. The ground-state energy and ionic forces are converged with respect to the domain size in both DFT-FE and QE simulations. Tables 1a and 1b shows the comparison between DFT-FE and QE for the Al 3-Shell benchmark system, which demonstrates excellent agreement between the two codes in a non-periodic setting.
106The final pseudopotential benchmark system we consider is the InP-water semiconductor-insulator interface system, which consists of a semiconducting InP slab of 22.178 × 22.178 × 44 Bohr and an insulating water column of 35 Bohr in the Z direction containing 47 water molecules. In total, the system contains 277 atoms (1, 632 electrons). For both the DFT-FE and QE simulations, we use periodic boundary conditions on the domain. Tables 1a and 1b shows the comparison between DFT-FE 1.0 and QE, which demonstrates excellent agreement in ground-sate energy and ionic forces, similar to Mo and Al benchmark systems.
107We now validate DFT-FE 1.0 for all-electron ground-state calculations by considering the Benzamide (C 7 H 7 NO) molecule. In both NWChem and DFT-FE simulations we conduct non-periodic calculations with a domain size large enough for the boundary effects to be negligible. The appropriate mesh parameters for DFT-FE and choice of Gaussian basis for NWChem are shown in Table 2.
108The results demonstrate good agreement between DFT-FE and NWChem in the ground-state energy.
109Overall, from Tables 1 and 2, we observe excellent agreement between DFT-FE 1.0 and QE on pseudopotential DFT benchmark systems, and with NWChem for all-electron benchmark systems.
Performance of DFT-FE 1.0
110The computational efficiency and parallel scalability of DFT-FE 1.0 is discussed in this section on benchmark systems involving periodic Mo supercells and non-periodic Al nanoparticles of various system sizes. We employ finite-element meshes with discretization errors commensurate with chemical accuracy for all the benchmarks considered here.
Computational efficiency
111We first discuss about the number of FE basis functions required and the CPU computational times obtained in the current work (DFT-FE 1.0) on varying system sizes of BCC Mo periodic supercells with a monvacancy and compare with that obtained by using DFT-FE 0.6 [28]. These comparisons tabulated in Table 3 show ∼ 3× reduction in the number of FE basis functions using DFT-FE 1.0, and is accompanied by reduction in CPU computational time by 2−3×. This reduction in basis functions is due to the modified treatment of electrostatics using the smeared nuclear charges approach where the atomic positions are no longer constrained to coincide with FE nodes (for pseudopotential calculations), which in turn allowed consideration of coarser FE meshes with higher polynomial orders for a similar accuracy. We now demonstrate the computational efficiency in terms of CPU-GPU speedups obtained by DFT-FE 1.0 using benchmark systems of different sizes on Summit supercomputer, a hybrid CPU-GPU architecture. The CPU-GPU speedups are measured by computing the ratio of the node-hours obtained by running most optimized CPU-only calculation and that obtained by the hybrid CPU-GPU run. To this end, we first consider periodic Γ-point calculations on MoVac 6x6x6 (6,034 electrons), MoVac 8x8x8 (14,322 electrons) and MoVac 10x10x10 (27,986 electrons). It is evident from Table 4 and Figure 5 that the dominant computational cost of a single SCF iteration on GPUs in this regime (5, 000 − 30, 000 electrons) is the Chebyshev polynomial filtering (CF) (∼ 50% of the single SCF iteration cost) followed by the Rayleigh Ritz step (RRGEP) (∼ 30 − 40% of the single SCF iteration cost). We note from Table 4 that the CPU-GPU speedups of CF step stay nearly constant for different Mo supercell sizes, and is around 21 − 23×. Recall that the CF step is dominated by dense matrix-matrix multiplications-involving FE discretized cell level Hamiltonian matrices with wavefunction blocks of fixed sizes-and the FP32 processor boundary communication during the assembly operations. Hence, the arithmetic intensity of CF remains more or less independent of system size leading to similar CPU-GPU speedups. In the case of RRGEP step, the computational times for RRGEP-OP and RRGEP-ST show an increasing trend of CPU-GPU speedups with system size ranging from 13× for MoVac 6x6x6 to 24× for MoVac 10x10x10 (cf. Table 4 operations per byte of data accessed (arithmetic intensity) with increasing system size, thus leading to greater CPU-GPU speedups for larger systems. In the case of MoVac 6x6x6 , we further note that the CPU-GPU speedups for a single SCF iteration is almost the same as the total ground-state run time, and is around 14− 15×. This was possible as the majority of non-SCF computational steps involving initializations of pseudopotentials and electron density, ionic force computation, multivector Poisson problem solution for self-potential evaluations have all been either significantly optimized, or have been GPU ported wherever amenable. We now examine the CPU-GPU speedups in the case of periodic calculations on MoVac 6x6x6 supercell with a vacancy employing four irreducible k-points for Brillouin zone sampling. This involves the use of complex datatypes to handle complex wavefunctions on GPUs. To this end, we note from the Table 5 that the CPU-GPU speedups for the dominant computational steps involving CF, RRGEP-OP, RRGEP-ST are higher than Γ-point calculations employing real data types as reported in Table 4. The CPU-GPU speedup for a single SCF iteration was found to be 22× in contrast to 15.5× while employing real datatypes (c.f Table 4). This increase can be attributed to the use of complex datatypes leading to an increased arithmetic intensity (∼ 2×) for various computational steps in comparison to real datatypes. We next present in Table 6 the CPU-GPU speedups for non-periodic calculations involving icosahedron Al nanoparticles, namely Al 7Shell (4245 electrons) and Al 12Shell (19575 electrons). Similar to the Γ-point calculations on BCC Mo supercells, the CPU-GPU speedup of CF step is similar for both systems, while the speedup for RRGEP-OP and RRGEP-ST increases with system size. The CPU-GPU speedup for single SCF iteration is observed to be 17× for Al 7Shell and increased to 20× in the case of Al 12Shell . We finally report computational times for two large Mo supercells, namely MoVac 13x13x13 (61,502 electrons) and MoVac 16x16x16 (114,674 electrons), in Table 7. We note that even for such large systems, the ground-state calculations, computed to chemical accuracy, are completed in wall-times of < 1hr. However, we note that the dominant computational cost for both these system sizes is the diagonalization cost (RRGEP-D) and accounts for around 34% and 56% of the total SCF cost for MoVac 13x13x13 and MoVac 16x16x16 systems, respectively. Computationally efficient and scalable approaches to reduce the diagonalization costs will be a subject of our future investigations. Finally, the studies in this section also throw some light on the computational complexity of our numerical implementation on hybrid CPU-GPU architectures with respect to number of electrons (N e ). As can be seen from Figure 5 and Tables 4 and 7, the range of close to quadratic scaling in computational complexity with respect to N e is observed for much larger systems-O N 2.28 e up to N e = 27, 986-and only approach cubic scaling at N e = 61, 502 and N e = 114, 674 electrons.
Parallel scalability
112The primary parallelization route in DFT-FE is based on domain decomposition parallelization of the adaptive FE mesh into partitions distributed across different MPI tasks. The domain decomposition parallelization in DFT-FE is implemented through the deal.II finite element library [81] with p4est [99]. Unlike the all-to-all communication in global basis sets like plane-wave basis, only the FE nodes on the MPI domain partition boundaries are communicated. This has enabled massive parallel scalability of DFT-FE , as has been previously demonstrated on many-core CPU architectures [28]. Notably, for a ∼60,000 electrons system, DFT-FE was demonstrated to scale up to 192,000 MPI tasks (6,000 nodes) of the NERSC Cori KNL supercomputer. The parallel scaling advantages of FE basis naturally translates to the hybrid CPU-GPU architectures, although with the additional challenge of compute being significantly faster than communication on these architectures. In this work, our scalable numerical implementation, in conjunction with strategies such as mixed precision algorithms, asynchronous compute and communication, as well as GPU direct communication (cf. Section 4) has enabled excellent parallel scalability on hybrid CPU-GPU architectures, which we Table 4: Comparison of computational cost, measured in node-hrs, between CPU-only and hybrid CPU-GPU runs on OLCF Summit nodes using DFT-FE . Breakdown of total computational cost into the following computational steps: a) initialization & nuclear potential solve (INIT), electron density mixing (DM), total electrostatic potential solve (TEP), discrete Hamiltonian matrix construction (DHM), Chebyshev filtering (CF), Rayleigh-Ritz generalized eigenvalue problem (RRGEP), density computation (DC), and ionic forces (IF). RRGEP is further dividied into the following sub-steps: overlap matrix & subspace projected Hamiltonian (RRGEP-OP), subspace diagonalization (RRGEP-D) and subspace transformation to FE basis (RRGEP-ST). N at denotes total number of atoms, N e denotes total number of electrons, and E g denotes the ground-state energy per atom (Hartree). Case study: Pseudopotential DFT calculations on periodic BCC Mo supercells with a monovacancy using Γ-point.
Material
113MoVac demonstrate subsequently. We now demonstrate the parallel scalability of DFT-FE 1.0 on the Summit supercomputer, a hybrid CPU-GPU architecture, using benchmarks systems of different sizes. In particular, we reconsider the BCC Mo periodic benchmark systems containing a monovacancy (Γ-point calculations)-MoVac 6x6x6 and MoVac 8x8x8 (cf. Section 5.1)-which consist of 6,034 and 14,322 electrons, respectively, and conduct a strong-scaling study. The FE discretization parameters used are commensurate with chemical accuracy in energy per atom and ionic forces (cf. Section 5.1). The speedup in the strong-scaling study is measured relative to the wall-time taken on 12 and 42 GPUs for MoVac 6x6x6 and MoVac 8x8x8 , respectively, which are the smallest accessible number of GPUs based on memory requirements. We note that only domain decomposition parallelization is considered in these strongscaling studies. Although DFT-FE implements a second level of parallelization over wavefunctions (band parallelization), which has been demonstrated to extend parallel scalability on many-core architectures [28], we find the combined domain decomposition and band parallelization route to only marginally extend the parallel scalability of DFT-FE on hybrid CPU-GPU architectures.
114We first consider the strong-scaling of MoVac 6x6x6 containing 6,034 electrons. Figure 6a demonstrates the parallel scalability of the SCF iteration step and its breakdown into various constituent steps. Using 2 MPI tasks per GPU, via MPS, the domain decomposition parallelization is scaled from 12 GPUs to 192 GPUs. The per SCF wall-time reduced from 29.6 sec at 12 GPUs to 3.5 sec at 192 GPUs, where the average number of FE DoFs per GPU are ∼ 9, 000. This amounts to relative speedup of 8.5× at a parallel scaling efficiency of 53%. We further note that 70% parallel scaling efficiency is obtained at 96 GPUs, with an average of ∼ 18, 000 FE DoFs per GPU. This excellent parallel scalability is attributed to the scaling of the dominant CF step, where the key computational kernel, involving matrix-vector products of the FE discretized sparse Hamiltonian matrix and the wavefunction vectors, requires only the partition boundary nodes to be communicated. Furthermore, as discussed in Section 4.3, the boundary communication has been further reduced by using strategies such as single precision communication, overlapping compute and communication, along with optimization of data access overheads. Next, we consider the parallel scalability of the larger system size, MoVac 8x8x8 containing 14,322 electrons, which is shown in Figure 6b. Using, 1 MPI task per GPU, the domain decomposition parallelization is scaled from 42 GPUs to 672 GPUs, where the average FE DoFs per GPU are ∼ 6, 300. The per SCF wall-time reduced from 53.6 sec on 42 GPUs to 6.4 sec on 672 GPUs, which amounts to a relative speedup of 8.4× at a parallel scaling efficiency of 52%. As evident from the computational cost breakdown, at such system sizes and beyond, the dominant drivers of the scalability are the quadratic scaling CF step and the cubic scaling RRGEP steps. In this regard, the excellent parallel scalability of the RRGEP step is possible due to the implementation advances such as mixed precision algorithms, overlap of compute and communication, and hardware aware communication as discussed in Section 4.4. Overall, DFT-FE 's excellent parallel scalability on hybrid CPU-GPU architectures is primarily a result of the locality of the FE basis, and the scalable numerical implementation of the CF and RRGEP steps that reduces communication costs. Table 8 reports the minimum wall-times achieved by DFT-FE 1.0 on the same benchmark systems, with a parallel scaling efficiency of ∼ 40%. We observe that the minimum wall-time for the MoVac 6x6x6 benchmark system containing 6,034 electrons is ∼ 80 sec for the complete calculation including initialization and ionic force computation, with the SCF iteration part of the calculation taking ∼ 60 sec. Notably, for the larger MoVac 8x8x8 benchmark system containing 14,322 electrons, the wall-time for the complete calculations is ∼ 140 sec on 1,344 GPUs, with the SCF iteration part of the calculation taking ∼ 100 sec. Such low wall-times of ∼ 1 − 2 minutes for medium to large system sizes at chemical accuracy are possible both due to the excellent parallel scaling of the SCF iteration procedure discussed earlier, as well as the GPU porting of ionic force computation and optimization of initialization steps. These studies underline the practical capability of DFT-FE to use the pre-exascale supercomputers for conducting fast and accurate DFT simulations of generic materials systems involving structural relaxation, molecular-dynamics, and high-throughput calculations as required in many application areas.
Molecular dynamics
115We demonstrate the capability of DFT-FE to conduct Born-Oppenheimer molecular dynamics (MD) calculations [100]. In particular, we consider the InP-water interface system from Section 5.1, which consists of 277 atoms (1,632 electrons) and conduct a NVE molecular dynamics simulation. We use an initial ionic temperature of T = 600 K and employ a time step of 1.0 fs using a velocity Verlet time integration algorithm. This simulation is conducted using norm-conserving ONCV pseudopotentials and GGA exchange correlation. We use the FE discretization parameters from Table 1, which has been demonstrated to achieve chemical accuracy in ground-state energy and ionic forces with respect to QE . We assign initial velocities using a Maxwell-Boltzmann distribution corresponding to the initial temperature of 600 K. Figure 7 shows the variation of the total energy of the system up to 410 fs. The mean and the standard deviation of the total energy is computed to be −21.8812448 Ha/atom and 4 × 10 −6 Ha/atom, respectively. We also compute the drift in the total energy by evaluating the slope of linear fit, which is found to be 1 × 10 −6 Ha/atom-ps. The average ionic temperature is around 300 K.
Conclusions
116In this work, we have developed DFT-FE 1.0, which incorporates significant methodology and implementation improvements over the previous version, DFT-FE 0.6 [28]. The key methodology improvement in DFT-FE 1.0 is the use of a smeared nuclear charges approach in the electrostatics formulation unlike the regularized Dirac distributions used in DFT-FE 0.6. Importantly, in the case of pseudopotential calculations, the use of smeared nuclear charges allows to decouple the atoms from the FE triangulation nodes. This enables usage of coarser finite-elements with a higher interpolating polynomial order compared to DFT-FE 0.6 for pseudopotential calculations, leading to a substantial reduction in FE basis functions required to achieve chemical accuracy. The other substantial methodology change in DFT-FE 1.0 is the modification of the configurational forces formulation to account for the smeared nuclear charges. Aside from the above formulation improvements, DFT-FE 1.0 employs a similar numerical solution procedure as DFT-FE 0.6 using FE discretization in conjunction with an efficient and scalable Chebyshev filtered eigensolver (ChFES) based SCF iteration procedure. Each SCF iteration involves the following steps: (i) computation of the FE cell level Hamiltonian matrix contributions, (ii) Chebyshev polynomial filtering (CF) to compute lowest occupied eigensubspace, (iii) Rayleigh-Ritz (RRGEP) procedure which involves projection of the Kohn-Sham problem onto the filtered subspace and solving the resulting small GHEP problem, and (iv) computation of the electron density (DC). Although the RRGEP procedure implemented in DFT-FE 1.0 is slightly different from the orthogonalization and Rayleigh-Ritz approach implemented in DFT-FE 0.6, the accuracy and robustness of the solver is not affected.
117The major implementation improvement in DFT-FE 1.0 is the efficient GPU porting of all the key computational kernels in the SCF iteration, namely CF, RRGEP and DC. Our GPU porting strategy hinges on reducing data-access and communication costs while effectively utilizing the massive fine grained parallelism of GPUs. In the case of the CF step, which involves sparse-dense matrix products, we achieved a high GPU throughput performance of 54% of the V100 GPU FP64 peak in a multi-node job with a total of 24 GPUs for a ∼6,000 electrons metallic benchmark system. Further, on 96 GPUs, the throughput performance was observed to be 43% of the FP64 peak. This high GPU throughput performance was achieved by leveraging the FE cell structure to recast the sparse-dense matrix products into a batch of small dense-dense matrix products that have higher arithmetic intensity and naturally exploiting the massive parallelism of GPUs. Further, we efficiently utilize the high memory bandwidth of the GPUs by performing blocked operations over the wavefunctions in the various data movement steps in CF. Additionally, the low boundary communication cost due to the locality of the FE basis and reduction of communication latencies in CF by performing simultaneous point-to-point communications across multiple wavefunctions are also crucial in realizing this performance. We further reduced the communication costs by combining implementation strategies such as asynchronous compute and communication and FP32 boundary communication, the latter being motivated from the small percentage of FE boundary nodes in a given MPI partition. Next, in the case of the O M N 2 RRGEP procedure, which is the dominant cost for larger systems, we implemented a scalable approach specifically designed to overcome the communication and peak memory bottlenecks associated with performing parallel dense matrix-matrix multiplications involving matrices with extreme aspect ratios (M/N ≫ 1). Our implementation reduces the dominant communication cost to O(N 2 log(M )) through optimal distribution of compute costs across FE domain decomposition MPI partitions and efficient data movement strategies involving the intermediate N × N matrices that are stored in a parallel block-cyclic format. Further, we implemented a blocked approach to reduce the peak memory footprint in the intermediate steps. The blocked approach is also exploited to further enhance the performance of the parallel dense matrix-matrix multiplications on GPUs by implementing mixed precision arithmetic, asynchronous compute and communication and GPU-direct communication strategies. To assess the computational efficiency of our RRGEP implementation, we studied the throughput performance of the dominant RRGEP steps on a ∼60,000 electrons metallic benchmark system using 960 GPUs. We achieved 30-40% throughput performance of the FP64 peak, which was significantly boosted to 70-110% when the mixed precision arithmetic and asynchronous compute and communication strategies are employed.
118In order to assess the accuracy of the improved electrostatics methodology as well as the new GPU implementation, we conducted a validation study of DFT-FE 1.0 using QE (pseudopotential calculations) and NWChem (all-electron calculations). Our pseudopotenial benchmark systems included a periodic bulk metallic system, non-periodic nanoparticle, and a semiconductor-insulator interface system. On all the benchmark systems, we demonstrate excellent agreement between DFT-FE 1.0 and QE on ground-state energies, ionic forces and stresses, when both codes are solved to chemical accuracy. Similarly, in the case of the all-electron validation study, we demonstrate excellent agreement of DFT-FE 1.0 with NWChem on the ground-state energy of a non-periodic aromatic compound.
119We demonstrated the computational efficiency and parallel scalability of DFT-FE 1.0 for pseudopotential DFT calculations on a subset of the benchmark problems with varying system sizes (∼ 4,000-120,000 electrons), all calculations being solved to chemical accuracy. First, to assess the computational efficiency afforded for pseudopotential DFT calculations by the improved electrostatics methodology, we compared the CPU computational time per SCF iteration step between DFT-FE 0.6 and DFT-FE 1.0 on periodic BCC Mo benchmark systems of various sizes. These studies performed on a many-core CPU machine indicated ∼ 3× reduction both in the CPU time and the number of FE basis functions compared to DFT-FE 0.6 . Next, we evaluated the performance of DFT-FE 1.0 on the Summit hybrid CPU-GPU supercomputer considering both periodic and non-periodic metallic benchmark systems. We find DFT-FE 1.0 to achieve ∼16-20× CPU-GPU speedups for system sizes ranging from ∼ 4,000-30,000 electrons, where the speedup is measured by comparing the node-hrs per SCF iteration step consumed by a hybrid CPU-GPU run against a CPU-only run on the Summit machine, while using all the available compute resources on the compute nodes. An analysis of the computational cost breakdown showed that the efficient GPU performance of DFT-FE for both the O(M N ) CF step and the O M N 2 RRGEP steps is crucial to realize these CPU-GPU speedups for both medium and large system sizes. Furthermore, DFT-FE 1.0 demonstrated excellent parallel scalability on the hybrid CPU-GPU architectures, with an observed strong scaling of a 14,322 electrons system from 42 to 672 GPUs at a relative speedup of 8.5×. This enabled very low wall-times for the full ground-state calculation, which includes initialization costs and computation of ionic forces. In particular, DFT-FE 1.0 achieved minimum wall-times of ∼1-2 minutes for system sizes of ∼6,000-14,000 electrons. Finally, we studied the performance of DFT-FE 1.0 on large systems with 61,502 and 114,674 electrons, using 960 and 3,600 GPUs respectively. Notably, DFT-FE 1.0 wall-times for the full ground-state calculation of the 61,502 and 114,674 electrons systems were 32 and 54 minutes, respectively.
120In summary, DFT-FE 1.0 combines improved computational efficiency and the ability to achieve significant acceleration and parallel scalability on hybrid CPU-GPU architectures to enable fast and accurate pseudopotential DFT calculations at larger length-scales than possible heretofore. Furthermore, the high throughput performance and parallel scalability achieved by DFT-FE on preexascale hybrid CPU-GPU supercomputers, as demonstrated in this work, makes it well placed to leverage the upcoming exascale supercomputers. In this regard, our future implementation efforts will focus on ensuring performance portability of DFT-FE on a diverse array of accelerators from different vendors requiring different programming languages such as CUDA and HIP. Our ongoing and future efforts will also involve implementation of softer projector augmented-wave pseudopotentials [101] in DFT-FE for more efficient pseudopotential DFT calculations, and implementation of enriched finite-element basis [26; 35], which can enable large-scale efficient all-electron DFT calculations. Another important area of focus for further development of DFT-FE is the implementation of advanced exchange-correlation functionals, where the authors are currently pursuing development of numerical strategies for fast and accurate hybrid exchange-correlation functional calculations. Also related to exchange-correlation functional development is the ongoing effort of implementing systematically convergent inverse DFT approaches [102] into DFT-FE to compute exact exchange-correlation potentials from many-body ground-state electron densities [103], and subsequently improve the exchange-correlation models from this data. Finally, implementation of real-time time-dependent DFT [27] and its GPU porting is also being pursued.
121Technology India (Grant Number: SRG/2020/002194) for the purchase of a GPU cluster, which also provided computational resources for this work.
122Appendix A. Efficient evaluation of terms related to the external potential correction in the configurational force expression
123We describe here the procedure for the combined evaluation of the terms´Ω p E ext,corr : ∇Υ(x) dx+ F ext,corr in the configurational force expression (cf. Eq. 28 in Section 2.2) implemented in DFT-FE 1.0. The notations followed here are consistent with that of Section 2. Considering the expression forΩ p E ext,corr : ∇Υ(x) dx + F ext,corr =Ω p a r V a ext,loc (|x − (R a + L r )|) − V a sm (x, (R a + L r )) ρ(x) I :
124presents two challenges for its computationally efficient and accurate evaluation. The first challenge is that the direct evaluation of integrals containing ∇V a ext,loc (|x−(R a +L r )|) would be inefficient due to requirement of denser quadrature grids owing to their potentially non-smooth nature. However, employing integration by parts to transfer the gradient on to smoother fields, as done in other places in Section 2.2, needs to be carefully employed here to ensure that the terms in the final expression have cancellation of the tails of V a ext,loc (|x−(R a +L r )|) and V a sm (x, R a +L r ) for convergent evaluation of their combined sums over the periodic lattice sites r. The second challenge in evaluation of Eq. A.1 is the accurate and efficient computation of ∂V a smε (x,bsm(| τ ε (y)− τ ε (Ra)|) ∂ε ε=0
125. First, we discuss our methodology to address the first challenge. To begin with, we take integration by parts of terms involving ∇V a ext,loc (|x − (R a + L r )|) and ∇V a sm (x, R a + L r ) to rewrite Eq. A.1 as followŝ Ωp a r V a sm (x, R a + L r ) − V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(x)) dx +Ω p a r V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(R a + L r )) dx Next, considering the last term in the above, we further facilitate transfer of derivatives by splitting the integration over Ω p for each (a, r) pair into two regions inside the unit cell: (i) Ω a,r ∩ Ω p , which is the intersection of a bounded domain Ω a,r surrounding the atom at (R a + L r ) with the unit cell periodic domain Ω p , and (ii) Ω p − Ω a,r , which is the remainder region inside Ω p excluding the intersection with Ω a,r . Thus, Eq. A.2 is rewritten aŝ Ωp a r V a sm (x, R a + L r ) − V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(x)) dx +Ω p a r V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(R a + L r )) dx − a rΩ a,r ∩ Ωpρ
1263)
127The choice of Ω a,r in the above is such that outside Ω a,r , V a sm (x, R a + L r ) can be assumed to be a smooth radially symmetric function, given by V a sm (|x − (R a + L r )|. We use this assumption to rewrite the last term in Eq. A.3 as Further, noting that form of Eq. A.4 is now amenable to apply integration by parts, we transform it using integration by parts into a sum of a surface integral term and a volume integral term which subsequently do not have ∇V a sm (|x − (R a + L r )|. This is desired to ensure cancellation of the asymptotic tail of V a sm (|x − (R a + L r )| with that of V a ext,loc (|x − (R a + L r )|) in Eq. A.3. We perform this step as follows Next, we discuss our methodology for addressing the second challenge, which is the evaluation of ∂V a smε (x, b sm (| τ ε (y) − τ ε (R a + L r )|)) ∂ε present in the third term in Eq. A.6. We consider the following three different cases: (a) allelectron ionic forces-configurational force is evaluated with respect to a generator perturbing the atom and the underlying space in a compact support around the atom. This is required in allelectron calculations where the ionic positions are coupled to the corner nodes of FE triangulation elements to capture the cusp in the electronic wavefunctions; (b) pseudopotential ionic forcesconfigurational force is evaluated by perturbing the atoms without perturbing the underlying space i.e. floating nuclear charges with Υ(x) = 0 and Υ(R a + L r ) = 0. This approach is used in the case of pseudopotential calculations with smooth electronic fields; and (c) periodic unit-cell stress computation-configurational force is computed with respect to a affine deformation generator (Υ i = C ij x j ). First, in the case of all-electron ionic forces (case (a)), we assume V a sm (x, R a + L r ) to be a radially symmetric field, V a sm (|x − R a + L r |), which is a reasonable assumption as refined FE triangulations with much smaller element sizes near the ionic positions are employed in the case of all-electron calculations in DFT-FE. Thus, Eq. A.7 now simplifies to ∂V a smε (|x − τ ε (R a + L r )|) ∂ε ε=0 = −∇V a sm (|x − (R a + L r )|) · Υ(R a + L r ) . (A.8)
128Second, in the case of pseudopotential ionic forces (case (b)), the assumption of floating nuclear charges (Υ(x) = 0 and Υ(R a + L r ) = 0) simplifies Eq. A.7 to ∂V a smε (x, b sm (|y − τ ε (R a + L r )|)) ∂ε ε=0 = R 3 −∇b a sm (|y − (R a + L r )|) |x − y| dy ·Υ(R a +L r ) , (A. 9) where the integral over the Coulomb kernel is obtained by solutions of Poisson problems to compute the potential associated with the gradient of the smeared charge distribution. The Poisson problems are solved on bounded domains Ω a,r with Dirichlet boundary conditions set to the gradient of the exact nuclear potential, ∇V a nuc |x − (R a + L r )|. We note that only the Poisson problems corresponding to a finite number of bounded domains Ω a,r having non-trivial intersection with the periodic unit cell (Ω a,r ∩ Ω p = ∅) need to be considered. Finally, for the case of periodic unit-cell stress computation (case (c)), we employ central finite difference scheme to evaluate Eq. A.7 corresponding to the six unique affine strain components. We remark that a similar approach would be impractical for all-electron ionic forces (case (a)) as it would incur a large cost to evaluate Eq. A.7 by finite difference for all the different τ ε corresponding to individual force components over all the atoms.
Introduction
129Electronic structure calculations based on Kohn-Sham density functional theory (DFT) have played a very important role in providing key insights into a wide variety of materials properties, including mechanical, electronic, magnetic and optical properties of materials. A significant fraction of the world's computational resources are being utilized for these calculations, and these have provided predictive capability for material modeling, especially qualitative trends, leading to accelerated materials design and discovery. There are about hundred electronic structure codes available, with the plane-wave (PW) basis [1; 2; 3; 4; 5] and the atomic-orbital type basis [6; 7; 8; 9; 10] being the most commonly employed basis sets. Though these basis sets enjoy many advantages, the inherent limitations of PW basis sets of restricting the simulations domains to periodic geometries and boundary conditions, the lack of systematic convergence for AO basis sets, compounded by the limited parallel scalability for both PW and AO basis sets have resulted in the development of systematically improvable and scalable real-space discretization techniques like finite-difference [11; 12; 13; 14; 15], finite-elements [16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29], and other reduced order basis techniques [30; 31; 32; 33; 34]. We note that finite-element (FE) basis employed in this work is a relatively new entrant to real-space methods for DFT and offers several key advantages in comparison to the other widely discretization schemes. In particular, FE basis provides systematic convergence for any materials system [22], can accommodate periodic, non-periodic and semi-periodic boundary conditions, and can offer excellent parallel scalability owing to the locality of the FE basis functions [28]. Furthermore, the FE basis sets are amenable to adaptive spatial resolution, not only allowing the possibility of large-scale all-electron calculations [26; 35] by combining with enrichment functions, but also mixed all-electron and pseudopotential calculations [36].
130A variety of application areas demand large-scale DFT calculations involving tens of thousands of electrons, which include ab initio modeling of dislocation cores [37; 38; 39; 40; 41; 42; 43; 44; 45; 46] in metals and semiconductors, ion diffusivity and migration barrier predictions in solid-state electrolytes [47; 48; 49], large-scale bio-molecular simulations [50; 51; 52; 53], spin-spin interactions in defects in solids for applications in quantum computing [54; 55; 36], and many others. Accurate simulations of these large-scale materials systems with DFT usually involve geometry optimizations, or nudged-elastic band calculations, or long time-scale ab-initio molecular dynamics simulations, all of which require a large number of DFT ground-state calculations. Conducting systematically convergent DFT calculations on such large-scale systems has been challenging owing to the cubic scaling computational complexity of DFT calculations with system size and the limited parallel scalability of state-of-the-art DFT codes. To this end, accurate computational methods that are robust, computationally efficient and scalable on evolving heterogeneous parallel computing architectures are crucial to enable large-scale ab-intio simulations on realistic materials systems involving many tens of thousands of electrons.
131Paving the way for large-scale DFT calculations, numerous efforts have focused on reducing the cubic scaling computational complexity [56; 57; 58; 59; 60; 61] for both metallic and insulating systems over the past few decades. Alternate approaches to enable large-scale DFT calculations include developing efficient methodologies to reduce the computational pre-factor associated with the cubic scaling computational complexity, and massively scalable numerical implementations taking advantage of the evolving computing architectures. Our recent work on DFT-FE 0.6 [28] is along this direction and presents an accurate, efficient and massively parallel finite-element framework for large-scale DFT calculations on many core CPU architectures. The numerical implementation in the work employed computationally efficient strategies which were instrumental in reducing data movement costs and latency on many core CPU architectures. To this end, DFT-FE 0.6 exhibited close to quadratic scaling till 30, 000 − 40, 000 electrons, thereby delaying the onset of cubic scaling com-plexity. Additionally, excellent parallel scaling performance has been demonstrated up to 192,000 MPI tasks, with significant speedups of up to 10× observed in computational times in comparison to widely used plane-wave codes for material systems with more than 10,000 electrons. The capability of DFT-FE 0.6 to simulate very large systems reaching up to ∼ 60, 000 electrons has been demonstrated, which remains computationally prohibitive using plane-wave codes. However, despite the demonstrated performance, many inefficiencies remain in DFT-FE 0.6, which are addressed as a part of this work. In particular, DFT-FE 0.6 restricts the nuclear charges to be coincident with corner finite-element nodes in the finite-element mesh. This, in turn, requires refined FE discretizations, even in the case of pseudopotential calculations yielding smooth solutions. In addition to increased computational cost, this approach would incur additional overheads during geometry optimization and molecular dynamics simulations due to the requirement of frequent remeshing during the course of geometry updates. Furthermore, the implementation procedures in DFT-FE 0.6 does not take advantage of the recent advances in heterogeneous computing architectures, and can execute only on massively parallel many-core CPU architectures.
132We present here DFT-FE 1.0, a massively parallel hybrid CPU-GPU DFT code using finiteelement discretization for large-scale density functional theory calculations. The current effort builds on DFT-FE 0.6 [28], addresses the aforementioned limitations of DFT-FE 0.6, and presents a computationally efficient implementation of DFT-FE on hybrid CPU-GPU architectures. In particular, electrostatic energy and the relevant configurational force expressions (for geometry relaxation) associated with the Kohn-Sham DFT functional are reformulated in terms of smeared nuclear charges, allowing the flexibility for the atoms to float in pseudopotential calculations, in contrast to the use of point charges coincident with finite-element nodes in DFT-FE 0.6. This enables the use of coarser finite-element meshes with higher-order FE interpolating polynomial up to degree 7, thereby reducing the number of basis functions required to achieve the desired accuracy-by a factor of ∼ 3× for the benchmark systems studied in this work-which, in turn, translates to a similar improvement in the computational efficiency. Furthermore, DFT-FE 1.0 focuses on efficient GPU porting of key computational kernels in Chebyshev filtered subspace iteration procedure (ChFES) [28; 29]-the solver employed in DFT-FE for the solution of the Kohn-Sham equations-by utilizing the massive fine grained parallelism of GPUs in both double and complex double datatypes. We note that a good GPU porting efficiency is strongly coupled to the ratio of compute to the data movement associated with the underlying numerical implementation, which in turn is dependent on the algorithms and the basis sets employed. This aspect was also demonstrated in our prior work [29], which described a proof of concept GPU implementation for DFT calculations on hybrid CPU-GPU architectures employing the finite-element basis. To this end, our GPU implementation strategies in the current work hinges on exploiting the following HPC-centric ideas: (i) finite-element level matrix-multi vector products in the Chebyshev filtering step of ChFES, (ii) mixed precision arithmetic based processor-boundary communication in the assembly of domain-decomposed finite-element level vectors, (iii) mixed precision based floating point operations and communications in the computation of overlap matrix and projected Hamiltonian, (iv) employing GPU direct communication, and overlapping compute and data movement -via-asynchronous programming paradigms in the Chebyshev filtering step, as well as the computation of overlap matrix and projected Hamiltonian.
133The accuracy and performance of the aforementioned methodology improvements and implementation innovations in DFT-FE 1.0 are studied using a wide a range of benchmark systems. To this end, the accuracy is validated on representative benchmark systems using state-of-the art codes like Quantum Espresso (QE ) and NWChem for pseudopotential and all-electron DFT calculations, respectively. DFT-FE 1.0 provided excellent agreement on ground-state energies, ionic forces and stresses with QE and NWChem . Furthermore, the aforementioned implementation advances on hybrid CPU-GPU architectures resulted in high throughput performances leading to ∼ 16 − 20× CPU-GPU speedups for a wide range of material system sizes, ranging from ∼ 4, 000 − 30, 000 electrons. We note that the speedups obtained in the present work are found to be much higher than the reported CPU-GPU speedups from state-of-the-art DFT codes where a GPU implementation is available [62; 63; 64; 65; 66; 67]. Furthermore, excellent parallel scalability has been demonstrated using DFT-FE 1.0 on hybrid CPU-GPU architectures over a range of system sizes. In particular, the strong scaling aspect of the current implementation has been instrumental in reducing the walltime to around ∼ 1 − 2 minutes for system sizes of ∼ 6, 000 − 14, 000 electrons for the ground-state DFT calculation. The performance of DFT-FE 1.0 was also demonstrated on a very large system comprising of 114,674 electrons, where the ground-state calculation took around ∼ 54 minutes on 3600 GPUs (600 nodes of the Summit supercomputer).
134The remainder of the paper is organized as follows. Section 2 starts with a discussion on the governing equations in DFT, and presents the local real space formulation implemented in DFT-FE 1.0 with an improved electrostatics treatment by employing smeared floating charges to describe the ions. Subsequently, the configurational forces-used to evaluate ionic forces and cell stresses for geometry optimization-in the framework of smeared floating charges is presented, followed by the finite-element discretization of the Kohn-Sham DFT problem. Section 3 describes the numerical methodologies employed in DFT-FE 1.0 , and Section 4 discusses the various aspects of the numerical implementation on hybrid CPU-GPU architectures. Section 5 presents the results on benchmark systems, demonstrating the accuracy, computational efficiency and parallel scaling performance of DFT-FE 1.0 on hybrid CPU-GPU architectures. We finally conclude along with an outlook in Section 6.
1352. Real-space Kohn-Sham DFT formulation and finite-element discretization 2.1. Kohn-Sham DFT governing equations with improved electrostatics treatment For a materials system with N at nuclei and N e electrons, the ground-state properties in Kohn-Sham density functional theory are given by solving the N lowest eigenvalues of the following non-linear eigenvalue problem [68]:
136where R = {R 1 , R 2 , · · · R Nat } denotes the positions of the N at nuclei, ρ denotes the electron density, V eff (ρ, R) denotes the effective single electron Kohn-Sham potential, and ǫ i and ψ i denote the eigenvalues and eigenfunctions of the Kohn-Sham Hamiltonian, respectively. We discuss below the formulation in the context of spin-independent Kohn-Sham Hamiltonian. However, extension to spin-dependent case is straightforward [69], and is implemented in DFT-FE . Further, we discuss the formulation in an infinite periodic crystal, and obtain the formulation for the non-periodic system as a special case of the periodic formulation with appropriate changes to the boundary conditions. In the periodic case where V eff (ρ, R) is periodic on the unit cell, instead of solving the Kohn-Sham problem on a large periodic supercell, it is computationally efficient to invoke the Bloch theorem [69; 70], which entails solving the reduced Kohn-Sham equations on a much smaller periodic unit cell with periodic boundary conditions on the electronic fields. In particular, the Kohn-Sham eigenfunctions ψ n,k (x) using the Bloch theorem are expressed as
137where i = √ −1 and u n,k (x) is a complex-valued function that is periodic on the unit cell satisfying u n,k (x + L r ) = u n,k (x) for all lattice vectors L r , and k denotes a point in the first Brillouin zone of the reciprocal space. Substituting the above in Eq. 1, the reduced Kohn-Sham equations on the unit cell are given by
138where V loc eff (ρ, R) and V nl eff (x, y, R) are the local and non-local contributions to V eff (ρ, R), with the non-local contribution arising from the consideration of pseudopotentials. We note that the governing equations for the non-periodic case are recovered from Eq. 3 by replacing the periodic geometry with a non-periodic simulation domain along with appropriate boundary conditions, and considering only the Γ-point (k = 0). In the above, the electron density ρ is given in terms of the orbital occupancy function f n,k = f (ǫ n,k , µ) ∈ [0, 1] and the canonical wavefunctions as
139where ffl BZ denotes the volume average of the integral over the Brillouin zone corresponding to the periodic unit cell Ω p , and µ represents the Fermi-energy, determined by the constraint on the total number of electrons in the system (N e ) given bŷ
140To avoid numerical instabilities, particularly in metallic systems with large number of eigenstates around the Fermi energy, we use a smooth Fermi-Dirac distribution [1; 56] for f given by
141where σ = k B T denotes the regularization parameter with k B denoting the Boltzmann constant and T representing the finite electronic temperature. We note that f (ǫ i , µ) is denoted as f i in the remainder of the manuscript. The effective single electron potential, V eff (ρ, R), is composed of:
142where V xc (ρ) is the functional derivative of the exchange-correlation energy functional E xc (ρ), which accounts for the many-body quantum-mechanical interactions between electrons [71]. We adopt the generalized gradient approximation (GGA) [69; 72] for the exchange correlation functional description throughout the manuscript, which is given by the following semi-local form:
143We remark that DFT-FE also implements other local and semi-local functional forms (LDA, LSDA, SGGA). The term V el (ρ, R), in the effective potential (Eq. 7), is the variational derivative of the total classical electrostatic interaction energy inside the periodic unit cell, which is composed of
144where, E H , E ext and E zz denote the electrostatic interaction energy between electrons (Hartree energy), interaction energy between nuclei and electrons, and repulsive energy between nuclei, respectively. These are given by
145where Z a denotes the charge on the a th nucleus in the periodic unit cell, and the summation over r extends over all the lattice sites in the infinite periodic crystal. Further, all integrals involving x in Eqs. 10 are over the periodic domain represented by the unit cell, whereas the integrals involving y are over R 3 . Henceforth, unless otherwise specified, we will adopt this convention. In the case of pseudopotential treatment, where only the valence electronic wavefunctions are computed in an effective potential generated by the the nucleus and the core electrons, E ext in Eq. 10 is defined as
146In the above, V a psp,loc denotes the local part of the pseudopotential operator, and E psp,nl is the non-local pseudopotential energy given by
147where V nl eff (x, y, R) := a r V a psp,nl (x, y, R a +L r ) denotes the non-local part of the pseudopotential operator. In DFT-FE , we employ norm-conserving pseudopotentials, and the action of V nl eff (x, y, R) on a wavefunction is given by the following separable operator form [69; 73]:
148with C a,nk lpm =Ω p r ′ χ a lpm (y, R a + L r ′ )e ik·(y−L r ′ ) u n,k (y) dy,
149where l denotes the azimuthal quantum number, m denotes the magnetic quantum number, |χ lpm denotes the pseudopotential projector with p denoting the index corresponding to the projector component for a given l, h lp denotes the pseudopotential constant, and |ξ a lm denotes the single atom pseudo-wavefunction. The above form applies to both Troullier-Martins (TM) pseudopotential [74] and optimized norm conserving Vanderbilt pseudopotential (ONCV) [75], both of which are implemented in DFT-FE [28]. We note that the all-electron treatment in E ext is recovered from Eq. 11 by setting V psp,nl = 0 and V a psp,loc (|x − (R a + L r )|) = − Za |x−(Ra+Lr)| . Next, we discuss the reformulation of electrostatics as local variational problems, which is based on our previous works [28; 76; 22], while highlighting the key difference in this work in the efficient treatment of nuclear charges. First, we briefly discuss the local reformulation using the conventional approach of regularized Dirac distributions, where we begin by defining a nuclear charge
150denoting a regularized Dirac distribution centered at R a . Using the regularized Dirac distribution and rearranging the electrostatic energy terms into charge neutral groups, the total electrostatic interaction energy in Eqs. 10-11 is reformulated as
151We note that the last two terms are not present in the case of an all-electron treatment. Subsequently, to efficiently compute terms with extended interactions in the electrostatic interaction energy in Eq. 14, we reformulate them by defining auxiliary electrostatic potentials as discussed in [77; 22; 78], and rewrite the electrostatic energy in Eq. 14 as the following local form:
152where ϕ(x, R) and V a δ (x, R a ) are the auxiliary electrostatic potentials corresponding to the total charge distribution (ρ + b) and the a th nuclear charge b a δ , respectively, given by:
153The above potentials can be efficiently computed by taking recourse to the solution of a Poisson problem, as the kernel of the extended interaction corresponds to the Green's function of the Laplace operator.
154The above local formulation of electrostatics has been efficiently implemented in DFT-FE 0.6 [28] using finite-element (FE) discretization, where the point nuclear charges are enforced to be coincident with the corner nodes of the FE triangulation. The FE discretization provides the regularization of the solution of V a δ and ϕ, and we refer to [22] for a detailed discussion and systematic convergence studies. However, this approach requires a more refined discretization around the nuclei for an accurate solution of the Kohn-Sham ground-state problem, even in the case of pseudopotential calculations with a smooth external potential, V a psp,loc (|x − R a |). To alleviate these issues, in this work, we consider fictitious non-overlapping smeared nuclear charges,
155, in the spirit of [79]. This results in significantly smoother auxiliary electrostatic potentials, which are free of the Coulomb singularities, and are denoted by:
156where V a sm (x, R a ) matches the exact nuclear potential (− Za |x−Ra| ) beyond a certain cutoff radius, denoted by r a c . The modified local reformulation of electrostatics incorporating the above auxiliary potentials is obtained as
157where the all-electron treatment is obtained by setting V a ext,loc (|x−R a |) = V a nuc (|x−R a |) := − Za |x−Ra| , and the pseudopotential treatment is given by setting V a ext,loc (|x − R a |) = V a psp,loc (|x − R a |). Next, following [79], we define b a sm to be b a sm (r) = − Z a g(r, r a c ) ,
158where g(r, r a c ) denotes a smooth radial smeared charge distribution for a unit charge, which is strictly local within r ≤ r c and integrates to unity. Further, the value of r a c for each atom is chosen to be smaller than half the nearest neighbour distance. Here, we use the following second-derivative continuous form for g(r, r c ) [79]:
159We remark that a similar smeared nuclear charges strategy has also been adopted in a recent work [35], involving enriched finite-elements for solution of all-electron Kohn-Sham DFT equations. Finally, incorporating the functional derivative of the local reformulation of the electrostatic energy with smeared nuclear charges in Eq. 18 into Eq. 3, the governing equations of Kohn-Sham DFT for the periodic unit cell are:
160V a psp,nl (x, y, R a + L r )e ik·y u n,k (y) dy = ǫ n,k u n,k on Ω p , ; ∀ k ∈ BZ
161where the action of the non-local pseudopotential operator, V a psp,nl , is given in Eq. 13. We note that the above equations can be easily modified to the non-periodic setting by considering (k = 0, L r = 0) and replacing Ω p with Ω 0 , which denotes a large non-periodic domain with a vacuum layer surrounding the material system with appropriate Dirichlet boundary conditions on ϕ.
Configurational forces with smeared nuclear charges
162Evaluation of ionic forces and periodic unit cell stresses in DFT are required for structural optimization and molecular dynamics. In DFT-FE, we employ the configurational forces approach [76] to evaluate them in an unified and variationally consistent manner. The formulation naturally accounts for the dependence of the basis functions on the ionic positions (Pulay force corrections), in this case the FE basis functions. The configurational forces are evaluated as the generalized directional derivative of the Kohn-Sham free energy functional with respect to the position of the material point x. The Kohn-Sham free energy for a given position of atoms is formulated as a local variational problem, whose Euler-Lagrange equations correspond to the Kohn-Sham governing equations (cf. Eq. 21). We refer to [76] for a detailed discussion on the derivation of configurational forces, and to [28] for the configurational force expression used in DFT-FE 0.6, which includes the expressions involving GGA type exchange correlation functionals.
163The expression for the configurational forces, which we derive below, differs from our previous works in several key aspects of the derivation. First, is the use of non-overlapping smeared nuclear charges, b a sm (|x − R a |), in the local reformulation of the electrostatics in this work (cf. Eq. 18) instead of the regularized Dirac distributions, b a δ (|x − R a |), used in our previous works. In our previous formulation [76], we impose rigid body constraints to the perturbation of the material point x in the compact support of the regularized Dirac distribution nuclear charge in order to preserve the integral constraint´b a δ (|x − R a |)dx = 1. We note that the above regularization and rigid body perturbation constraints are naturally realized in the previous formulation by considering the charge distribution as point charges coincident with the nodes of the FE triangulation. However, in the current formulation, the smeared nuclear charges are independent of the underlying FE discretization. Thus we relax the aforementioned constraints leading to additional terms in the configurational force expression. The second key difference from the previous formulation is in the treatment of the smeared charge self potential, V a sm (x, R a ), where we no longer assume that this is a radial function dependent only on |x − R a |, which may not hold for the FE discretized potential due to discretization errors. In order to compute the relevant response of V a sm (x, R a ) with respect to perturbation of the material point x, we separately consider the response of perturbations with respect to x, y and R a in the non-local expression for V a sm (x, R a ) =´R 3 b a sm (|y−Ra|) |x−y| dy (cf.
164Eq. 17.). We develop strategies to evaluate the resulting terms in an accurate and efficient manner. Finally, the other remaining consideration in this work is the use of integration by parts to transfer the gradient operators away from potentially non-smooth fields (e.g. non-local pseudopotential projectors) on to the solution fields (u n,k (x), ϕ(x), V a sm (x, R a )), which are relatively smoother in case of pseudopotential calculations. This results in a drastic reduction in the number of quadrature points required to accurately integrate the terms involving the smeared nuclear charges, local part of the pseudopotential, and non-local pseudopotential projectors.
165The starting point for deriving the configurational forces is the local variational problem of the Kohn-Sham free energy F 0 (R). Based on prior work [76; 28], the local variational problem can be formulated in terms of wavefunctions, fractional occupancies and the electrostatic potentials as:
166where
167where Y and H 1 (R 3 ) denote suitable function spaces. In the above, we note that
168The energy functional corresponding to electrostatic energy, L el using the local reformulation of the electrostatics with smeared nuclear charges (cf. Eq. 18) is expressed as:
169where V a sm denotes the electrostatic potential corresponding to the a th nuclear charge. Let τ ε : Ω p → Ω p ′ represent the infinitesimal perturbation of the underlying space that preserves the periodic geometry. The mapping of a material point x to a new point x ′ , given by
170where Υ denotes the generator of this mapping. Further, the reciprocal space also gets perturbed by the mapping κ ′ = κ ε (k) due to the perturbation of the real-space. Denoting F 0 ( τ ε ) to be the ground-state free energy in the perturbed space, the configurational force with respect to this perturbation along the generator Υ is evaluated by computing the Gâteaux derivative of F 0 ( τ ε ) given by
171where E, E ext,corr and E ′a denote the Eshelby tensors whose expressions in terms of the solutions of the saddle point problem (22) on the unperturbed space (x) are provided below. If U = {ū 1,k ,ū 2,k ,ū 3,k · · ·ū N,k } denote the Kohn-Sham eigenfunctions corresponding to the lowest N eigenvaluesǭ = {ǭ 1,k ,ǭ 2,k , · · · ,ǭ N,k } with occupanciesf = {f 1,k ,f 2,k · · ·f N,k }, andφ denotes the electrostatic potential-all solutions of the saddle point problem (22))-the expressions for the Eshelby tensors: E, E ext,corr , E ′a , and force terms: F sm , F ext,corr , F psp,nl in Eq. 28 are given by
172Further,
173and finally, F psp,nl = F nl + F nl * , with
174In the above, the terms F sm and F ext,corr , which capture the electrostatic contributions related to smeared nuclear charges and external potential correction, are the significant changes compared to previous versions of DFT-FE [28; 76]. We refer to Appendix A for details regarding the combined evaluation ofΩ p E ext,corr : ∇Υ(x) dx + F ext,corr , requiring additional consideration for accurate and efficient evaluation of
175Further, we refer to [76] for the detailed expression and derivation of F
176. Additionally, we refer to [78; 76] for details on recasting the integral over R 3 in the third term in Eq. 28, as sum of integrals over bounded domains and surface integrals on the bounded domains. We remark that using Eq. 28, the i th component of the ionic force on any given atom is computed by choosing the compact support of the generator, Υ i (x), to contain only the atom of interest. Along similar lines, the periodic unit cell stress tensor is evaluated by choosing the generator to be an appropriate affine transformation: Υ i = C ij x j , as explained in [76]. In the context of ionic forces for the pseudopotential case, we employ a further simplification in the evaluation of the configurational forces by taking advantage of the smooth electronic fields to allow the atom positions to float independent of the underlying space. The ionic forces are computed in this case by setting Υ(R a +L r ) to be an unit vector along the desired force component and setting Υ(x) = 0. The ionic force expression thus obtained can be shown to be equivalent to the Hellman-Feynman force [69], as would be expected.
Discrete Kohn-Sham DFT equations
177We now present the discretization of the Kohn-Sham DFT problem using a finite-element (FE) basis, which is a piecewise polynomial and strictly local basis set [80]. In particular, we employ C 0 continuous Lagrange polynomials generated using Gauss-Lobatto-Legendre (GLL) nodal points, also known as spectral finite-elements (FE). We refer to our prior work [22] for details on the adaptive higher order spectral FE based discretization of the Kohn-Sham equations. We briefly discuss these aspects, and also present those aspects that differ in this work compared to the previous implementation, DFT-FE 0.6 [28]. We begin by discretization of the electronic fields in the Kohn-Sham problem Eq. 21-the wavefunctions and the electrostatic potentials-in the FE basis given by
178where N h j : 1 ≤ j ≤ M denotes the strictly local Lagrange polynomials generated using the nodes of the FE triangulation, T h , with the characteristic mesh size denoted by h. Further, the order of the interpolating polynomials is denoted by p. u h n,k , ϕ h and V a h sm denote the FE discretized fields, with u j n,k , ϕ j and V a j sm denoting the coefficients in the expansion of the n th discretized wavefunction and the electrostatic potentials. The coefficients are also referred to as the nodal values of the discretized fields represented using the FE triangulation. Systematic reduction of the discretization error using the above FE basis is achieved through reducing h, or increasing p. We refer to [22] for derivation of a priori error estimates for the discrete ground-state energy of the Kohn-Sham problem, with respect to h and p.
179Applying the above FE discretization to the Kohn-Sham eigenvalue problem in Eq. 21 results in a generalized hermitian eigenvalue problem (GHEP) given by H kû n,k = ǫ h n,k Mû n,k where H k denotes the discrete Hamiltonian matrix, M denotes the overlap matrix (or commonly referred to as the mass matrix in finite element literature), and ǫ h n,k denotes the n th eigenvalue corresponding to the discrete eigenvectorû n,k . The discrete Hamiltonian matrix is further decomposed as H k = H loc,k + H nl,k , where
180In the above, V h eff,loc (ρ h , R) is given by:
181where V a h sm (x, R a + L r ) is obtained by solving the following discretized Poisson equations:
182Here, Ω a denotes a bounded domain enclosing the atom a with Dirchlet boundary conditions set to the exact nuclear potential, V a nuc (|x − R a |). The distance of the Dirchlet boundary of Ω a from R a must be much larger than the smeared charge cut-off, r a c , for an accurate solution of V a h sm . We note that, in the case of all-electron calculations, V a ext,loc (|x − (R a + L r )|) = V a nuc (|x − (R a + L r )|) and H nl,k is zero. In the case of pseudopotential calculations, V a ext,loc (|x − (R a + L r )|) = V a psp,loc (|x − (R a + L r )|) and additionally, H nl,k is given by
183(33) Finally, the matrix elements of the overlap matrix M in the GHEP are given by M jk =
184We note that the matrices H loc,k and M are sparse as the FE basis functions are strictly local in real space with a compact support over elements sharing a given FE node. Further, the vectors C a,k lpm,j in H nl,k are also sparse since the projectors χ a lpm (x, R a + L r ) have a compact support, thus rendering a sparse structure to the discrete Hamiltonian H k .
185We transform the GHEP into a standard Hermitian eigenvalue problem (SHEP), which can be solved more efficiently. Using the fact that there exists an unique positive definite symmetric square root of M, the GHEP-H kû n,k = ǫ h n,k Mû n,k -is transformed to the following SHEP:
186However, the evaluation and application of M −1/2 is computationally expensive. To this end, we employ Gauss-Lobatto-Legendre (GLL) quadrature rules-with quadrature points coincident with the nodes of the spectral FE basis-to evaluate the integrals in the overlap matrix, which renders the overlap matrix diagonal [22]. Furthermore, H k , the Hermitian matrix in the SHEP, retains the sparsity of H k in the GHEP. Finally, the discrete Kohn-Sham eigenvalue problem along with the discretized Poisson equation for the total electrostatic potential ϕ h are given by:
187which are solved self-consistently to obtain the electronic ground-state. Subsequently, we compute the discrete total ground-state energy E h in terms of the discrete ground-state solution fields (ǭ h n,k ,ρ h ,φ h ) as follows:
188We note that the use of smooth smeared nuclear charges, b a sm allows the nuclear positions to float independent of the FE triangulation, leading to generation of more efficient FE triangulations with relatively coarser h values and higher values of p (p = 6 or 7). Our earlier implementations with the nuclear positions restricted to corner nodes of FE elements typically used p = 4 or 5 with smaller h values, to maintain an appropriate mesh quality around the atom. In the case of all-electron calculations, we still require the nuclear positions to be located on the corner nodes of FE elements, to capture the cusp in the all-electron wavefunctions.
Numerical methodology
189In this section, we discuss the solution procedure for the spectral finite-element discretized Kohn-Sham equations (cf. Eq. (35)), implemented in DFT-FE . DFT-FE is built over the deal.II open-source FE library [81], and uses its infrastructure for adaptive mesh refinement, FE grid handling, and efficient parallel objects. DFT-FE accommodates FE basis with adaptive spatial resolution, which is constructed using an octree-based hexahedral mesh generator based on the p4est library [82] through deal.II. We refer to [28] for a detailed discussion on the adaptive refinement strategies implemented in DFT-FE in the context of both pseudopotenial and all-electron problems.
190Starting from an initial guess for Kohn-Sham electron density and eigenfunctions, the discrete nonlinear SHEP is solved self-consistently along with Poisson equations (cf. Eq. (35)) to compute the Kohn-Sham ground-state solution. In particular, the nonlinear SHEP problem is treated as a fixed point iteration-also referred to as the self-consistent field (SCF) iteration-in terms of electron density: ρ h = F (ρ h ), where F (ρ h ) involves computing the occupied eigenspace for a given ρ h . We employ Anderson and Broyden electron density mixing schemes [83; 84] to accelerate the fixed point iteration. Additionally, we have implemented the Kerker preconditioner [85], which provides an improved SCF convergence rate that is expected to be independent of system size for homogeneous metallic systems. In each SCF iteration step, we use a computationally efficient and scalable Chebyshev polynomial filtered eigensolver (ChFES) [86; 22; 28] to evaluate the occupied eigenspace of the discrete Kohn-Sham Hamiltonian. Furthermore, in each SCF iteration step, the total electrostatic potential is computed by solving a Poisson problem, using a Jacobi preconditioned conjugate gradient solver. Algorithm 1 lists all the steps in the SCF procedure followed in DFT-FE . We remark that although the formulation in Section 2 is presented in the context of multiple kpoints sampling the first BZ zone, going forward we drop the dependence on k-points for notational convenience and clarity. All the numerical methods discussed below easily extend to multiple kpoints.
191The most dominant computational step in each SCF iteration (Algorithm 1) is the ChFES procedure, which involves the Chebyshev polynomial filtering (CF) and the Rayleigh-Ritz (RRGEP) steps. CF scales quadratically with system size, and is observed to be the dominant computational cost for small and medium system sizes. However, for large system sizes the cubic-scaling computational cost of RRGEP dominates. The numerical implementation of ChFES in DFT-FE 0.6 [28] enabled fast and large-scale DFT calculations by using scalable numerical algorithms and reduction of the computational prefactor of the cubic-scaling Rayleigh-Ritz procedure through development of mixed-precision strategies combined with a spectrum splitting approach. The numerical algorithm of ChFES in this work is along similar lines as DFT-FE 0.6. For the sake of completeness, we will briefly review the numerical methodology of ChFES, and also discuss the modified Rayleigh-Ritz procedure employed in the present work. [RRGEP] Rayleigh-Ritz generalized eigenvalue problem in the subspace spanned by Ψ f :
192using a mixing scheme, and go to step 3.
Chebyshev filtered eigensolver
193In order to solve the SHEP problem-H Ψ i = ǫ h i Ψ i -we use the Chebyshev filtering procedure [86; 22], which exploits the fact that the eigenstates of interest correspond to the lowest occupied states (wanted eigenspectrum). The main idea behind the Chebyshev filtering approach is to construct a scaled-and-shifted Hamiltonian (H = c 1 H + c 2 ) such that the desired (wanted) eigenspectrum of the discrete Kohn-Sham Hamiltonian ( H) is mapped to (-∞, -1) and the remainder of the eigenspectrum is mapped to (-1,1). Subsequently, exploiting the property of Chebyshev polynomials, which have a fast growth in (-∞, -1) and (1,∞) but take small values in [-1,1], a subspace that is a close approximation to the desired eigensubspace can be computed. To elaborate, the Chebyshev filtered eigensolver (ChFES) is based on the action of a degree m Chebyshev polynomial filter acting on an input subspace Ψ in given by the following recursive iteration:
194where the choice of m is based on the upper bound of H, which is related to the smallest mesh size [28]. The resulting subspace of Chebyshev filtered vectors, Ψ f , is a good approximation to the desired eigenspace, with the approximation error decreasing systematically with the degree of the polynomial. Further, the Chebyshev filter operations are applied to all wavefunction vectors simultaneously which lends to efficient implementation on modern computing architectures, as will be discussed later in Section 4. Upon computing Ψ f , the desired eigenstates of H required for computing the electron density are obtained by a Rayleigh Ritz procedure (step 5.b in Algorithm 1), which involves projecting the SHEP onto the subspace spanned by Ψ f and subsequently solving a much smaller generalized Hermitian eigenvalue problem (GHEP). We next discuss the numerical algorithm of the RRGEP procedure.
1953.2. Rayleigh-Ritz step with spectrum-splitting and mixed precision algorithms, and electron density computation
196The cubic scaling RRGEP procedure in our ChFES solver employs two key ideas-spectrumsplitting approach and mixed precision algorithms-to reduce the computational prefactor. First, considering the spectrum-splitting approach, the key idea is that the lowest N oc eigenstates of the Kohn-Sham eigenvalue problem H Ψ i = ǫ h i Ψ i with orbital occupancy f i = 1 are not explicitly necessary for the computation of the electron density. This allows us to reformulate the density computation as only requiring the top N fr = N − N oc fractionally occupied eigenstates ( Ψ R fr ofĤ) and the orthonormalized Chebyshev filtered wavefunctions ( Ψ o ) (cf. Algorithm 3). For typically used Fermi-Dirac smearing temperatures ∼ 500 K, N fr is 10-15% of N even for metallic systems, which can provide significant computational prefactor reduction in the RRGEP procedure. We remark that the computational advantages of using spectrum-splitting approach have been demonstrated in DFT-FE 0.6 [28], with the algorithm being adapted from developments in previous works [12; 87; 88].
197where Q fr and D fr denote the top N fr fractionally occupied eigenstates of the projected Hamiltonian with D fr containing the corresponding eigenvalues in ascending order, and (iii) (RRGEP-ST) Transform the fractionally occupied eigenstates to the FE basis ( Ψ R fr = Ψ f Q fr ) as well as compute the orthonormalized Chebyshev filtered wavefunctions ( Ψ o = Ψ f L −1 † ). Subsequently, Ψ R fr , Ψ o , and D fr are used to compute the output electron density, ρ h out (x) at quadrature points inside each FE cell (cf. Algorithm 3). In the above, the use of spectrum-splitting approach reduces the computational cost scaling of Ψ R fr in RRGEP-ST-F step to O(M N N fr ) from O(M N 2 ). Furthermore, in the RRGEP-D step, the resulting SHEP solve (after recasting the GHEP) now entails a partial diagonalization problem, which can also be performed with a reduced prefactor. In DFT-FE, we perform partial diagonalization using ELPA library's [89; 90] direct eigensolver.
198To further enable computational prefactor reduction of our RRGEP algorithm, we employ mixed precision arithmetic. Mixed precision computing strategies provide significant reductions in computational and data movement costs on modern computing architectures, and thus are being increasingly adopted in scientific computing. However, due to the stringent accuracy requirements in DFT solvers, there has only been a limited exploration of mixed precision strategies in DFT solvers [16; 28; 29]. In the context of the ChFES procedure, a FP64-FP32 mixed precision algorithm has been developed in DFT-FE 0.6 [28] for the orthogonalization and Rayleigh-Ritz steps. Similar mixed precision strategies are used in this work in the context of the generalized eigenvalue problem based RRGEP procedure. The key idea exploited here is that the Chebyshev filtered vectors, Ψ f , adaptively approach the eigenvectors corresponding to the lowest N states of H. Accordingly, the overlap matrix S = Ψ † f Ψ f and the projected Hamiltonian matrixĤ = Ψ † f H Ψ f approach diagonal matrices as the SCF approaches convergence. We take advantage of this to use mixed precision strategies for the dominant O(M N 2 ) steps in steps 1 and 3 of Algorithm 2. In particular, for the computation of S = Ψ † f Ψ f and Ψ o = Ψ f L −1 † , the diagonal entries are computed in FP64 while the off-diagonal entries are computed in FP32 as their contribution tends to zero as the Algorithm 2 Generalized eigenvalue problem based Rayleigh-Ritz step with spectrum-splitting procedure:
199Compute matrices for projection of Kohn-Sham eigenvalue problem onto the subspace spanned by Ψ f :
200Solve for N fr highest eigenstates of the generalized hermitian eigenvalue problem (GHEP) :
2011: Compute Fermi-energy (µ) using the constraint:
202Compute electron density at any point x belonging to a FE cell e: SCF approaches convergence. Next, in the case of the projected Hamiltonian matrixĤ = Ψ † f H Ψ f , we use a mixed strategy which takes advantage of bothĤ approaching diagonal matrix as well as the spectrum-splitting method in RRGEP. In this approach, we consider the following split of the Chebyshev filtered wavefunctions
203where the columns Ψ oc f and Ψ fr f contain the first N oc and the remaining N fr wavefunctions, respectively. Subsequently, we computeĤ in mixed precision as
204where we exploit the fact that as the SCF approaches convergence, the diagonalization step in RRGEP (step 2 of Algorithm 2) to compute the N fr highest eigenstates of the GHEP:ĤQ fr = SQ fr D fr , tends to be solely determined by the smallĤ fr−fr block ofĤ [28].
205The accuracy and robustness of the above mixed precision strategies have been demonstrated in DFT-FE 0.6 [28] on various pseudopotential benchmark problems. In particular, the number of SCF iterations remains unchanged between double precision and mixed precision simulations, and the error in the energy and ionic forces due to mixed precision is more than two orders of magnitude lower than the discretization errors. In this work, we further demonstrate accuracy and robustness of our mixed precision RRGEP implementation by comparing the energy, ionic forces and cell stresses against QE for benchmark problems, as will be discussed in Section 5.1. Finally, the performance benefits of using the above mixed precision strategies on hybrid CPU-GPU architectures are demonstrated in Section 4.4.
General implementation strategy
206The central consideration in DFT-FE 1.0 implementation strategy for the SCF procedure (cf. Algorithm 1) is on reducing data-movement and data-access costs while exposing fine grained parallelism in the computation on modern many-core CPU and hybrid CPU-GPU architectures. Given the heavy penalty associated with data movements, both intra-node as well as inter-node data transfers, relative to the fast compute performance on hybrid CPU-GPU architectures, such considerations are critical to maximize performance and parallel scalability of the key computational kernels in our SCF procedure, as will be demonstrated below. All the key computational kernels in our Chebyshev filtered eigensolver based SCF procedure, namely CF, RRGEP and DC can be First, in the case of CF, the core computational kernel HX (as part of the Chebyshev recursive iteration in Eq. 37, with X being the intermediate wavefunctions vectors), is a FE discretized sparse-matrix times a dense-matrix (sparse-dense) multiplication. Particularly, in the context of FE discretization, this operation is very amenable to GPU acceleration. We recast the above sparse-dense multiplication as small FE cell level dense matrix times dense matrix (dense-dense) multiplications simultaneously across all FE cells in a given processor. These simultaneous densedense multiplications are performed very efficiently by optimized math libraries on either CPUs or GPUs, and combined with our contiguous data access patterns, allows to significantly boost the arithmetic intensity by lowering the data access costs. Section 4.3 discusses more on these aspects and provides the relevant performance benchmarks on hybrid CPU-GPU architectures. Further, efficient construction of these FE cell-level dense matrices ( H) is discussed in Section 4.2 below.
207Next, we consider the O(M N 2 ) steps in RRGEP-OP and RRGEP-ST that constitute large dense-dense multiplications. In general, such operations are able to achieve high performance on many-core CPU architectures and hybrid CPU-GPU architectures. However, in our case they present a unique challenge due to the extreme aspect ratios (M/N ≫ 1) involved. To this end, in Section 4.4, we adopt a scalable approach that boosts the overall performance by reducing the data movement costs significantly. Another important aspect of our implementation is the use of mixed precision strategies and the use of a column-blocked approach to matrix-matrix multiplications in CF, RRGEP-OP and RRGEP-ST. While mixed precision strategies speed up compute as well as reduce data movement costs, the blocked approach to matrix operations provide other benefits-reduction of peak memory, and opportunities to overlap compute and communication. Furthermore, optimal hardware aware data transfer pathways such as GPU direct communication are also used to reduce data movement costs in the RRGEP-OP and RRGEP-ST. Sections 4.3 and 4.4 elaborate on these aspects and demonstrate relevant performance benchmarks on hybrid CPU-GPU architectures.
208Finally, in the case of O(N 3 ) RRGEP-D step, we use the scalable direct eigensolver approaches using the state-of-the-art ELPA library [89], which has been efficiently implemented both for manycore and hybrid CPU-GPU architectures [91; 90]. Upon efficient implementation of the above core computational kernels, the bottlenecks in performance shifted to the remaining O(M N ) scaling steps-density computation (DC) and computation of ionic forces (IF)-which are also optimized for both CPUs and GPUs, using similar strategies as outlined above. We also remark that initialization costs (INIT), total electrostatic potential solve (TEP), and electron-density mixing schemes (DM) are the other remaining costs which are not yet ported to GPUs, but optimizations have been performed to ensure they constitute a small portion of the total run-time.
FE cell-level Hamiltonian matrix construction
209We describe a computationally efficient procedure for the construction of discretized Hamiltonian matrix at the finite-element cell level focusing on increasing the arithmetic intensity and reducing the data-access costs. This is accomplished by recasting the quadrature integrations arising in Eq. 30 in the form of BLAS level 3 matrix-matrix multiplications which can in-turn utilize optimized math kernel libraries in CPUs/GPUs to perform these arithmetic operations. In particular, we focus here on the second and third term of the Eq. 30 which is computed for every self-consistent field iteration. Recall from Eq. 30, the contribution to the discretized Hamiltonian matrix for a given FE cell (e) corresponding to V h eff,loc (ρ h , R) can be written aŝ
210where 1 ≤ j, k ≤ M cell with M cell denoting the number of FE nodes in a given cell (e) and further, I = (j, k) 1≤j,k≤M cell is the composite index. In the above equation, n q denotes the number of quadrature points in the given FE cell (e), q p denotes the p th quadrature point while w p denotes the corresponding quadrature weight. j p denotes the determinant of the finite-element Jacobian matrix evaluated at the p th quadrature point corresponding to the mapping from the reference cell in the natural coordinate system to the real-space cell [80]. We also note in Eq. 40 that P Ip , the Ip th component of the matrix P is given by
211p , the p th component of the vector v (e) ∈ R nq is given by w p j p V h eff,loc (q p , R). Denoting the number of FE cells present in a given MPI task to be M c , we define a matrix V ∈ R nq×Mc with the vector v (e) forming the e th column of V. Subsequently, the quadrature summation in Eq. 40 for all the cells can be recast as a single matrix-matrix multiplication operation between the matrices P and V as:
212We note that for a p th quadrature point, the product P Ip = N h i (q p )N h j (q p ) is symmetric with respect to i and j for a given composite index I, and, consequently, the terms in the product corresponding to i ≥ j are only stored in the matrix P. Hence, the size of the matrix P in Eq. 41 is M sym × n q where M sym = M cell (M cell + 1)/2
213An additional contribution to the discretized Hamiltonian matrix (third term in Eq. 30) arises in the case of GGA exchange-correlation functional and involves the spatial derivatives of FE basis functions. This can be written in terms of σ(x) = |∇ρ(x)| 2 and the derivatives with respect to reference FE cell coordinate directions [ξ = (ξ 1 , ξ 2 , ξ 3 )] as follows:
214where 1 ≤ j, k ≤ M cell and J −1 denotes the inverse of the finite-element Jacobian matrix. The summation over quadrature points and the spatial directions in Eq. 42 for all M c cells in a given MPI task can be recast as a matrix-matrix multiplication operation as shown below:
215where
216In the above, P qp ∈ R Msym×3 is evaluated for every quadrature point q p . As before, with I = (j, k) 1≤j,k≤M cell ; j≤k denoting the composite index and s = {1, 2, 3} denoting the spatial coordinate index, the Is th component of matrix P qp ∈ R mc×3 is given by
217The matrix V qp ∈ R Mc×3 evaluated for every quadrature point q p . Denoting e th row vector of the matrix V qp to be v qp (e) , the s th component v qp (e) is given by v qp s
218Similar ideas as discussed above are also used to recast the FE discretized matrix arising in the Performing the resulting sparse-dense matrix products using the conventional approaches at the global level is not ideal on modern supercomputing architectures as they incur high global memory access costs [92]. In DFT-FE , we significantly reduce the memory access costs in the core computational kernel HX by employing FE cell level dense matrix operations instead of global sparse matrix approaches. To elaborate, in the H loc X operation, we recast it as X c i are performed very efficiently on both many-core CPU and hybrid CPU-GPU architectures using batched xGEMM routines. Particularly on GPUs, the FE cell structure naturally exploits the massive fine grained parallelism available on GPUs by simultaneously performing the dense-dense matrix multiplications for all cells using cuBLAS library's xGEMMStridedBatched routine. We further remark that, to reduce the peak memory during the CF procedure, each H loc X evaluation is performed using a block approach. To this end, blocks of B f wavefunction vectors, denoted by X b , are filtered sequentially. Figure 1 shows the schematic of the blocked H loc X implementation, consisting of three key steps:
219, and (iii) the final assembly step into Y b , which also involves accumulation of contributions from MPI partition boundary DoFs via MPI point-to-point communication calls.
220To efficiently perform the memory bound data-movement operations in the extraction and assembly steps above, we structure the memory layout and implementation of data-movement computational kernels (CUDA kernels in case of GPU) such that the multiple wavefunction values are accessed from (written to) the global memory contiguously for each FE degree of freedom. This provides coalesced memory access across GPU threads to maximize the memory bandwidth of reading from the global RAM, as well as improving cache locality on many-core CPU architectures. Such strategies are critical to obtain performance on hybrid CPU-GPU architectures, as will be demonstrated below. The above data-movement aware implementation strategy also extends to MPI point-to-point communication costs in the ASEMB FEM step. In particular, we exploit the fact that all wavefunction components of Y b have identical MPI point-to-point communication pattern across the FE domain decomposition partition boundaries. This allows us to perform the MPI communication for all wavefunction components simultaneously, which incurs minimal network latency compared to communicating the wavefunction vectors one by one.
221Additionally, in the case of pseudopotential calculations, H nl X operation (cf. Algorithm 4) is performed in every Chebyshev recursive iteration. Our implementation strategy for H nl X follows along similar lines as H loc X. We exploit the sparse structure of H nl in real-space to efficiently compute H nl X. To this end, we construct FE cell level pseudopotential projector matrices C c i (cf.
222Algorithm 4 and Eq. 33), which denotes a matrix containing the C a lpm,j values for all M cell (j index in C a lpm,j ) FE shape functions belonging to the c i th FE cell and for all N c i psp = {a, lpm} pseudopotential projectors χ a lpm (x, R a ) which have a non-trivial compact support over the same FE cell. This renders C c i matrices to be of size M cell ×N c i psp . Subsequently, for the first computational step in Algorithm 4,
223we use xGEMMStridedBatched (with zero padding on C † c i due to variable N c i psp ) on GPUs to efficiently perform the FE cell level dense-dense matrix multiplications. Next, we perform the assembly of contributions of the resulting product matrices P c i b from all FE cells within the compact support of the pseudopotential projectors to obtain P b (cf. step 3 in Algorithm 4), using MPI point-to-point communication calls. The implementation of remaining steps in H nl X, follow along similar lines as discussed above. We also note that the efficient memory layout structure for coalesced memory access across GPU threads discussed previously in the context of H loc X also extends here, where we read/write all the B f wavefunction values in a given block contiguously for each pseudopotential projector index. The above implementation innovations lead to a high overall throughput performance for CF in
Rayleigh Ritz procedure
224The Rayleigh-Ritz (RRGEP) step of the ChFES procedure in Algorithm 1 involves the computation of matrix-matrix multiplications of the form A = X † Y (RRGEP-OP), diagonalization We remark that the aspect ratios of X, Y and X ′ are very large M/N ≫ 1, and the computational complexity of these operations scale as O(M N 2 ). This extreme aspect ratio presents unique challenges to develop a computationally efficient and a scalable implementation for these operations. Furthermore, scaling DFT-FE calculations to large-size problems ( N > 20, 000) requires strategies to address the N × N matrix memory footprint of A and Z owing to limited memory available on each GPU. We now present approaches that address these challenges in the present work.
225We first discuss the scalable strategies employed in the matrix-matrix multiplication of the type A = X † Y arising in the computation of the overlap matrix S in RRGEP-O and the projected HamiltonianĤ in RRGEP-P. Due to the large aspect ratios of X and Y, the traditional ways of storing these matrices in block-cyclic layout are not well suited as this would make the receiving processors (holding A) to perform all the computations, leading to a communication bottleneck with a cost scaling as O(N 2 M ). Instead, the optimal data distribution we employ divides X and Y equally among available processors P , into equi-partitioned matrices X p and Y p of size M loc × N with M loc ≈ M/P . This is achieved via the domain decomposition of the FE mesh. Since the computation of X † Y is similar to a vector dot product, we compute on GPUs a N × N matrix A p = X p † Y p associated with each processor locally and then sum these matrices in log P steps by making use of MPI collectives. This results in a communication cost of O(N 2 log(M )), as P is chosen to be proportional to M .
226Furthermore, for large-scale problems on GPUs, to avoid the huge memory footprint in storing A p , and thereby the matrix A, we employ a blocked approach as shown in Fig. 3(a) with block size N × B v . Each block of A is computed successively by the accumulation of the local contributions (corresponding block of A p ) using the MPI Allreduce collective. Moreover, we exploit the Hermiticity of S andĤ to compute only their lower triangular portion. Subsequently, for efficient matrix computations on A (Cholesky factorization and subspace diagonalization in RRGEP-D), we distribute it using a 2D block-cyclic grid format. In the case of operations of type X ′ = XZ arising in RRGEP-ST, we employ the optimal data distribution of X as discussed before, and compute X ′ using the local matrix multiplications X ′ p = X p Z (X ′ p and X p denote the local spatial partitions of the global matrices X ′ and X, respectively). Further, as shown in Fig. 3(b), a blocked approach similar to the computation of A is employed to handle the memory footprint of Z. A further exploitation of these blocked approaches is used to develop asynchronous compute-data movement strategies as discussed below.
Asynchronous compute and communication using mixed precision arithmetic
227The O(M N 2 ) operations in Algorithm 2 employ the blocked approach as discussed in Sec. 4.4. In the case of computations of the type A = X † Y, we make use of the fact that the GPU computations involving matrix-matrix multiplications A i p = X † p Y i p associated with block-i can be executed asynchronously with the data movement related to A i−1 p , i.e., GPU to CPU copy of A i−1 p followed by the MPI Allreduce collective operation forming the relevant column block A i−1 . The numerical implementation makes use of two different CUDA streams, one dealing with the compute operations while the other handling the data movement. Additionally, CUDA events are used to record the appropriate compute and data-movement events which allow for inter-stream synchronization of compute and copy operations associated with a given block, while asynchronously executing the data-movement operations related to a previous block. Along similar lines, asynchronous compute and data movement has been implemented for computations of the type X ′ = XZ (cf. Fig. 3 (b)). Moreover, GPU direct communication through NVIDIA Collective Communications Library (NCCL) [93] is used to accelerate inter-GPU communication associated with the aforementioned collective operations in RRGEP. We observe a factor of 1.5 − 1.8× reduction in computational times for RRGEP-OP and RRGEP-ST-O steps of Algorithm 2 by using NCCL. This performance gain can be attributed to better synchronization among communicating processors during the collective operations achieved -via-NCCL. Furthermore, mixed precision strategies are devised for the RRGEP step in Algorithm 1 as explained in Section 3. To this end, the diagonal block entries of overlap matrix S in RRGEP-O are evaluated in FP64 arithmetic while the off-diagonal entries are computed in FP32 arithmetic. Similarly in the case of RRGEP-P, the projected HamiltonianĤ has the entries of the lower right diagonal block evaluated in FP64 while the other blocks are evaluated in FP32 arithmetic (cf. section 3.2). These mixed precision strategies reduce the floating point operations cost involved in the matrix-matrix multiplications and further reduce the data movement costs associated with MPI Allreduce collective operations involved in the construction of S andĤ. Figure 4 demonstrates the performance benefits afforded by our mixed precision and asynchronous compute and data-movement strategies on the key kernels involved in RRGEP-O and RRGEP-P of Algorithm 2 in DFT-FE 1.0 on hybrid CPU-GPU architectures. The benchmark calculation on Mo 13×13×13 , containing 61,502 electrons, is parallelized over 160 Summit GPU Nodes (960 GPUs) with ∼ 17, 000 DoFs per GPU. As evident from the Fig. 4, mixed precision strategies provide a substantial improvement of 1.7 − 1.8× in comparison to FP64 baseline performance of these compute intensive kernels. Moreover, our asynchronous programming strategies further boosted the performance by an additional 1.4 − 1.7×. We also remark that reduction in floating point operation costs and data movement costs is achieved in the case of orthonormal basis construction
Results and discussion
228In this section, we demonstrate the accuracy, computational efficiency and parallel scalability of DFT-FE 1.0 on various benchmark systems on both CPU and hybrid CPU-GPU architectures. The benchmark calculations involve both pseudopotential and all-electron DFT calculations. GGA [72] exchange correlation of the PBE form [94] is employed in all the calculations, and ONCV [75] pseudopotentials from the SG15 [95] and PseudoDojo [96] databases are employed in all the pseudopotential DFT calculations. Further, we use Fermi-Dirac smearing with temperature T = 500 K. Additionally, for mixing the electron density in the SCF iteration, we use n-stage Anderson mixing scheme [83] and Kerker preconditioner [85] for non-periodic and bulk metallic benchmark systems, respectively.
229We consider various periodic and non-periodic pseudopotential and all-electron benchmark systems with different sizes to demonstrate the accuracy and performance of DFT-FE 1.0. The pseudopotential benchmark systems are validated using plane-wave code Quantum Espresso (QE ) [2; 97], while all-electron benchmark systems are validated with the NWChem code [10], which uses Gaussian basis. Specifically, we consider the following pseudopotential benchmark systems: (i) body centered cubic (BCC) Mo periodic supercells with a monovacancy, (ii) non-periodic Icosahedron Al nano-particles, (iii) InP-water interface system. In addition, we consider a non-periodic all-electron benchmark system: (iv) Benzamide molecule. For benchmark systems (i), we use norm-conserving ONCV pseudpotential for Mo from the SG15 database [95] (version 1.0), and for (ii) and (iii) we use ONCV pseudopotentials from the PseudoDojo database [96]. While performance studies are performed on benchmark systems (i) and (ii), the validation studies are performed on the smallest system size among the benchmark systems (i) and (ii), and further for the benchmark systems (iii) and (iv). All validation studies are conducted using a Γ-point calculation. In each of the above benchmark systems, we solve DFT-FE to two levels of discretization errors-medium and high accuracy-and compare against reference values obtained at similar accuracy using QE /NWChem. The medium accuracy standard corresponds to O 10 −4 Ha/atom in ground-state energy, O 10 −4 Ha/Bohr in ionic forces, and O 10 −6 Ha/Bohr 3 in cell stress (in periodic benchmark systems). The high accuracy standard corresponds to O 10 −5 Ha/atom in ground-state energy, O 10 −5 Ha/Bohr in ionic forces, and O 10 −7 Ha/Bohr 3 in cell stress. In the remainder of this paper, we define chemical accuracy as satisfying the medium accuracy standard. Further, we note that all simulations using DFT-FE are ran with mixed precision algorithms enabled in the RRGEP computational step and also employing FP32 communication in the CF computational step (cf. Sections 3 and 4). We remark that although similar performance and validation studies were undertaken in previous work [28] (DFT-FE 0.6) on many-core CPU architectures, these aspects are revisited here for DFT-FE 1.0 due to the modified treatment of electrostatics and configurational forces in the computational methodology and the new hybrid CPU-GPU implementation.
230Most of the simulations reported in this work were executed on the Summit supercomputer, which is currently the second fastest supercomputer in the world, with 200.79 PFLOPS FP64 peak. Summit comprises of 4,608 IBM Power System AC922 nodes with two IBM POWER9 processors (42 physical cores) and six NVIDIA Volta V100 GPUs in each node. Each node contains 512 GB of DDR4 memory for use by the POWER9 processors and 16 GB of HBM2 for each V100 GPU. Summit nodes are connected to a dual-rail EDR InfiniBand network providing a node injection bandwidth of 23 GB/s. On Summit, we have compiled DFT-FE using NVIDIA CUDA/10. Some of the numerical simulations using CPUs reported in this work were also executed on the Cori supercomputer at the National Energy Research Scientific Computing (NERSC) center. In particular, we used Cori's Phase II partition containing 9,688 compute nodes based on Intel Xeon Phi processors. Each compute node has the following specifications: single-socket Intel Xeon Phi 7250 ("Knights Landing") processor with 68 physical cores per node @ 1.4 GHz and 96 GB of memory per node. Cori uses a Cray Aries with Dragonfly topology for inter-node communication with 45.0 TB/s global peak bidirectional bandwidth. The DFT-FE simulations using the Summit GPU nodes reported in this section used all 6 V100 GPUs in each node with multiple MPI tasks (1-3) per GPU via NVIDIA multi-process service (MPS) depending on the system size. DFT-FE simulations using only the CPU cores of the Summit nodes used 42 MPI tasks per node with each MPI task bound to one physical core. Finally, the DFT-FE simulations using the CPU-only Cori supercomputer were run using 32 MPI tasks per node and 2 OpenMP threads (for BLAS operations).
Accuracy validation of DFT-FE 1.0
231In the benchmark systems involving Mo, we consider a periodic supercell constructed from bcc Mo unit cells containing 2 atoms with lattice constant of 5.95 Bohr. Next, we introduce a monovacancy by removing a Mo atom from the supercell. We consider a supercell size of 6×6×6 Mo unit cells, denoted by Mo 6x6x6 , containing 431 atoms (6, 034 electrons). Tables 1a and 1b shows the comparison of ground-state energy, ionic forces and hydrostatic cell stress between DFT-FE 1.0 and QE for medium and high accuracy comparisons respectively, which demonstrates excellent agreement between the two codes for a periodic system. We remark that taking advantage of the modified electrostatics methodology and efficient numerical implementation strategies in this work, we find the most computationally efficient strategy for pseudopotential DFT calculations is to use relatively higher order finite-elements, FE ord = 6/7 (HEX343SPECTRAL/HEX512SPECTRAL) with coarser element sizes compared to DFT-FE 0.6 [28]. Importantly, this provides significant computational efficiency improvements in comparison to DFT-FE 0.6, as will be discussed in Section 5.2.1.
232Next, in the non-periodic benchmark system involving Al, we consider a three-dimensional nonperiodic Icosahedron Al nano-particle [98]. The Icosahedron nano-particles are constructed with nearest neighbour bond length of 6.8 Bohr and varying the number of shells. We consider a Al nano-particle of size: Al 3-Shell containing 147 atoms (441 electrons). For the DFT-FE simulations, we employ non-periodic boundary conditions on a domain with a large vacuum surrounding the Al nano-particle. On the other hand, for the QE simulations, we choose an artificial periodic domain containing the Al nano-particle. The ground-state energy and ionic forces are converged with respect to the domain size in both DFT-FE and QE simulations. Tables 1a and 1b shows the comparison between DFT-FE and QE for the Al 3-Shell benchmark system, which demonstrates excellent agreement between the two codes in a non-periodic setting.
233The final pseudopotential benchmark system we consider is the InP-water semiconductor-insulator interface system, which consists of a semiconducting InP slab of 22.178 × 22.178 × 44 Bohr and an insulating water column of 35 Bohr in the Z direction containing 47 water molecules. In total, the system contains 277 atoms (1, 632 electrons). For both the DFT-FE and QE simulations, we use periodic boundary conditions on the domain. Tables 1a and 1b shows the comparison between DFT-FE 1.0 and QE, which demonstrates excellent agreement in ground-sate energy and ionic forces, similar to Mo and Al benchmark systems.
234We now validate DFT-FE 1.0 for all-electron ground-state calculations by considering the Benzamide (C 7 H 7 NO) molecule. In both NWChem and DFT-FE simulations we conduct non-periodic calculations with a domain size large enough for the boundary effects to be negligible. The appropriate mesh parameters for DFT-FE and choice of Gaussian basis for NWChem are shown in Table 2.
235The results demonstrate good agreement between DFT-FE and NWChem in the ground-state energy.
236Overall, from Tables 1 and 2, we observe excellent agreement between DFT-FE 1.0 and QE on pseudopotential DFT benchmark systems, and with NWChem for all-electron benchmark systems.
Performance of DFT-FE 1.0
237The computational efficiency and parallel scalability of DFT-FE 1.0 is discussed in this section on benchmark systems involving periodic Mo supercells and non-periodic Al nanoparticles of various system sizes. We employ finite-element meshes with discretization errors commensurate with chemical accuracy for all the benchmarks considered here.
Computational efficiency
238We first discuss about the number of FE basis functions required and the CPU computational times obtained in the current work (DFT-FE 1.0) on varying system sizes of BCC Mo periodic supercells with a monvacancy and compare with that obtained by using DFT-FE 0.6 [28]. These comparisons tabulated in Table 3 show ∼ 3× reduction in the number of FE basis functions using DFT-FE 1.0, and is accompanied by reduction in CPU computational time by 2−3×. This reduction in basis functions is due to the modified treatment of electrostatics using the smeared nuclear charges approach where the atomic positions are no longer constrained to coincide with FE nodes (for pseudopotential calculations), which in turn allowed consideration of coarser FE meshes with higher polynomial orders for a similar accuracy. We now demonstrate the computational efficiency in terms of CPU-GPU speedups obtained by DFT-FE 1.0 using benchmark systems of different sizes on Summit supercomputer, a hybrid CPU-GPU architecture. The CPU-GPU speedups are measured by computing the ratio of the node-hours obtained by running most optimized CPU-only calculation and that obtained by the hybrid CPU-GPU run. To this end, we first consider periodic Γ-point calculations on MoVac 6x6x6 (6,034 electrons), MoVac 8x8x8 (14,322 electrons) and MoVac 10x10x10 (27,986 electrons). It is evident from Table 4 and Figure 5 that the dominant computational cost of a single SCF iteration on GPUs in this regime (5, 000 − 30, 000 electrons) is the Chebyshev polynomial filtering (CF) (∼ 50% of the single SCF iteration cost) followed by the Rayleigh Ritz step (RRGEP) (∼ 30 − 40% of the single SCF iteration cost). We note from Table 4 that the CPU-GPU speedups of CF step stay nearly constant for different Mo supercell sizes, and is around 21 − 23×. Recall that the CF step is dominated by dense matrix-matrix multiplications-involving FE discretized cell level Hamiltonian matrices with wavefunction blocks of fixed sizes-and the FP32 processor boundary communication during the assembly operations. Hence, the arithmetic intensity of CF remains more or less independent of system size leading to similar CPU-GPU speedups. In the case of RRGEP step, the computational times for RRGEP-OP and RRGEP-ST show an increasing trend of CPU-GPU speedups with system size ranging from 13× for MoVac 6x6x6 to 24× for MoVac 10x10x10 (cf. Table 4 operations per byte of data accessed (arithmetic intensity) with increasing system size, thus leading to greater CPU-GPU speedups for larger systems. In the case of MoVac 6x6x6 , we further note that the CPU-GPU speedups for a single SCF iteration is almost the same as the total ground-state run time, and is around 14− 15×. This was possible as the majority of non-SCF computational steps involving initializations of pseudopotentials and electron density, ionic force computation, multivector Poisson problem solution for self-potential evaluations have all been either significantly optimized, or have been GPU ported wherever amenable. We now examine the CPU-GPU speedups in the case of periodic calculations on MoVac 6x6x6 supercell with a vacancy employing four irreducible k-points for Brillouin zone sampling. This involves the use of complex datatypes to handle complex wavefunctions on GPUs. To this end, we note from the Table 5 that the CPU-GPU speedups for the dominant computational steps involving CF, RRGEP-OP, RRGEP-ST are higher than Γ-point calculations employing real data types as reported in Table 4. The CPU-GPU speedup for a single SCF iteration was found to be 22× in contrast to 15.5× while employing real datatypes (c.f Table 4). This increase can be attributed to the use of complex datatypes leading to an increased arithmetic intensity (∼ 2×) for various computational steps in comparison to real datatypes. We next present in Table 6 the CPU-GPU speedups for non-periodic calculations involving icosahedron Al nanoparticles, namely Al 7Shell (4245 electrons) and Al 12Shell (19575 electrons). Similar to the Γ-point calculations on BCC Mo supercells, the CPU-GPU speedup of CF step is similar for both systems, while the speedup for RRGEP-OP and RRGEP-ST increases with system size. The CPU-GPU speedup for single SCF iteration is observed to be 17× for Al 7Shell and increased to 20× in the case of Al 12Shell . We finally report computational times for two large Mo supercells, namely MoVac 13x13x13 (61,502 electrons) and MoVac 16x16x16 (114,674 electrons), in Table 7. We note that even for such large systems, the ground-state calculations, computed to chemical accuracy, are completed in wall-times of < 1hr. However, we note that the dominant computational cost for both these system sizes is the diagonalization cost (RRGEP-D) and accounts for around 34% and 56% of the total SCF cost for MoVac 13x13x13 and MoVac 16x16x16 systems, respectively. Computationally efficient and scalable approaches to reduce the diagonalization costs will be a subject of our future investigations. Finally, the studies in this section also throw some light on the computational complexity of our numerical implementation on hybrid CPU-GPU architectures with respect to number of electrons (N e ). As can be seen from Figure 5 and Tables 4 and 7, the range of close to quadratic scaling in computational complexity with respect to N e is observed for much larger systems-O N 2.28 e up to N e = 27, 986-and only approach cubic scaling at N e = 61, 502 and N e = 114, 674 electrons.
Parallel scalability
239The primary parallelization route in DFT-FE is based on domain decomposition parallelization of the adaptive FE mesh into partitions distributed across different MPI tasks. The domain decomposition parallelization in DFT-FE is implemented through the deal.II finite element library [81] with p4est [99]. Unlike the all-to-all communication in global basis sets like plane-wave basis, only the FE nodes on the MPI domain partition boundaries are communicated. This has enabled massive parallel scalability of DFT-FE , as has been previously demonstrated on many-core CPU architectures [28]. Notably, for a ∼60,000 electrons system, DFT-FE was demonstrated to scale up to 192,000 MPI tasks (6,000 nodes) of the NERSC Cori KNL supercomputer. The parallel scaling advantages of FE basis naturally translates to the hybrid CPU-GPU architectures, although with the additional challenge of compute being significantly faster than communication on these architectures. In this work, our scalable numerical implementation, in conjunction with strategies such as mixed precision algorithms, asynchronous compute and communication, as well as GPU direct communication (cf. Section 4) has enabled excellent parallel scalability on hybrid CPU-GPU architectures, which we Table 4: Comparison of computational cost, measured in node-hrs, between CPU-only and hybrid CPU-GPU runs on OLCF Summit nodes using DFT-FE . Breakdown of total computational cost into the following computational steps: a) initialization & nuclear potential solve (INIT), electron density mixing (DM), total electrostatic potential solve (TEP), discrete Hamiltonian matrix construction (DHM), Chebyshev filtering (CF), Rayleigh-Ritz generalized eigenvalue problem (RRGEP), density computation (DC), and ionic forces (IF). RRGEP is further dividied into the following sub-steps: overlap matrix & subspace projected Hamiltonian (RRGEP-OP), subspace diagonalization (RRGEP-D) and subspace transformation to FE basis (RRGEP-ST). N at denotes total number of atoms, N e denotes total number of electrons, and E g denotes the ground-state energy per atom (Hartree). Case study: Pseudopotential DFT calculations on periodic BCC Mo supercells with a monovacancy using Γ-point.
Material
240MoVac demonstrate subsequently. We now demonstrate the parallel scalability of DFT-FE 1.0 on the Summit supercomputer, a hybrid CPU-GPU architecture, using benchmarks systems of different sizes. In particular, we reconsider the BCC Mo periodic benchmark systems containing a monovacancy (Γ-point calculations)-MoVac 6x6x6 and MoVac 8x8x8 (cf. Section 5.1)-which consist of 6,034 and 14,322 electrons, respectively, and conduct a strong-scaling study. The FE discretization parameters used are commensurate with chemical accuracy in energy per atom and ionic forces (cf. Section 5.1). The speedup in the strong-scaling study is measured relative to the wall-time taken on 12 and 42 GPUs for MoVac 6x6x6 and MoVac 8x8x8 , respectively, which are the smallest accessible number of GPUs based on memory requirements. We note that only domain decomposition parallelization is considered in these strongscaling studies. Although DFT-FE implements a second level of parallelization over wavefunctions (band parallelization), which has been demonstrated to extend parallel scalability on many-core architectures [28], we find the combined domain decomposition and band parallelization route to only marginally extend the parallel scalability of DFT-FE on hybrid CPU-GPU architectures.
241We first consider the strong-scaling of MoVac 6x6x6 containing 6,034 electrons. Figure 6a demonstrates the parallel scalability of the SCF iteration step and its breakdown into various constituent steps. Using 2 MPI tasks per GPU, via MPS, the domain decomposition parallelization is scaled from 12 GPUs to 192 GPUs. The per SCF wall-time reduced from 29.6 sec at 12 GPUs to 3.5 sec at 192 GPUs, where the average number of FE DoFs per GPU are ∼ 9, 000. This amounts to relative speedup of 8.5× at a parallel scaling efficiency of 53%. We further note that 70% parallel scaling efficiency is obtained at 96 GPUs, with an average of ∼ 18, 000 FE DoFs per GPU. This excellent parallel scalability is attributed to the scaling of the dominant CF step, where the key computational kernel, involving matrix-vector products of the FE discretized sparse Hamiltonian matrix and the wavefunction vectors, requires only the partition boundary nodes to be communicated. Furthermore, as discussed in Section 4.3, the boundary communication has been further reduced by using strategies such as single precision communication, overlapping compute and communication, along with optimization of data access overheads. Next, we consider the parallel scalability of the larger system size, MoVac 8x8x8 containing 14,322 electrons, which is shown in Figure 6b. Using, 1 MPI task per GPU, the domain decomposition parallelization is scaled from 42 GPUs to 672 GPUs, where the average FE DoFs per GPU are ∼ 6, 300. The per SCF wall-time reduced from 53.6 sec on 42 GPUs to 6.4 sec on 672 GPUs, which amounts to a relative speedup of 8.4× at a parallel scaling efficiency of 52%. As evident from the computational cost breakdown, at such system sizes and beyond, the dominant drivers of the scalability are the quadratic scaling CF step and the cubic scaling RRGEP steps. In this regard, the excellent parallel scalability of the RRGEP step is possible due to the implementation advances such as mixed precision algorithms, overlap of compute and communication, and hardware aware communication as discussed in Section 4.4. Overall, DFT-FE 's excellent parallel scalability on hybrid CPU-GPU architectures is primarily a result of the locality of the FE basis, and the scalable numerical implementation of the CF and RRGEP steps that reduces communication costs. Table 8 reports the minimum wall-times achieved by DFT-FE 1.0 on the same benchmark systems, with a parallel scaling efficiency of ∼ 40%. We observe that the minimum wall-time for the MoVac 6x6x6 benchmark system containing 6,034 electrons is ∼ 80 sec for the complete calculation including initialization and ionic force computation, with the SCF iteration part of the calculation taking ∼ 60 sec. Notably, for the larger MoVac 8x8x8 benchmark system containing 14,322 electrons, the wall-time for the complete calculations is ∼ 140 sec on 1,344 GPUs, with the SCF iteration part of the calculation taking ∼ 100 sec. Such low wall-times of ∼ 1 − 2 minutes for medium to large system sizes at chemical accuracy are possible both due to the excellent parallel scaling of the SCF iteration procedure discussed earlier, as well as the GPU porting of ionic force computation and optimization of initialization steps. These studies underline the practical capability of DFT-FE to use the pre-exascale supercomputers for conducting fast and accurate DFT simulations of generic materials systems involving structural relaxation, molecular-dynamics, and high-throughput calculations as required in many application areas.
Molecular dynamics
242We demonstrate the capability of DFT-FE to conduct Born-Oppenheimer molecular dynamics (MD) calculations [100]. In particular, we consider the InP-water interface system from Section 5.1, which consists of 277 atoms (1,632 electrons) and conduct a NVE molecular dynamics simulation. We use an initial ionic temperature of T = 600 K and employ a time step of 1.0 fs using a velocity Verlet time integration algorithm. This simulation is conducted using norm-conserving ONCV pseudopotentials and GGA exchange correlation. We use the FE discretization parameters from Table 1, which has been demonstrated to achieve chemical accuracy in ground-state energy and ionic forces with respect to QE . We assign initial velocities using a Maxwell-Boltzmann distribution corresponding to the initial temperature of 600 K. Figure 7 shows the variation of the total energy of the system up to 410 fs. The mean and the standard deviation of the total energy is computed to be −21.8812448 Ha/atom and 4 × 10 −6 Ha/atom, respectively. We also compute the drift in the total energy by evaluating the slope of linear fit, which is found to be 1 × 10 −6 Ha/atom-ps. The average ionic temperature is around 300 K.
Conclusions
243In this work, we have developed DFT-FE 1.0, which incorporates significant methodology and implementation improvements over the previous version, DFT-FE 0.6 [28]. The key methodology improvement in DFT-FE 1.0 is the use of a smeared nuclear charges approach in the electrostatics formulation unlike the regularized Dirac distributions used in DFT-FE 0.6. Importantly, in the case of pseudopotential calculations, the use of smeared nuclear charges allows to decouple the atoms from the FE triangulation nodes. This enables usage of coarser finite-elements with a higher interpolating polynomial order compared to DFT-FE 0.6 for pseudopotential calculations, leading to a substantial reduction in FE basis functions required to achieve chemical accuracy. The other substantial methodology change in DFT-FE 1.0 is the modification of the configurational forces formulation to account for the smeared nuclear charges. Aside from the above formulation improvements, DFT-FE 1.0 employs a similar numerical solution procedure as DFT-FE 0.6 using FE discretization in conjunction with an efficient and scalable Chebyshev filtered eigensolver (ChFES) based SCF iteration procedure. Each SCF iteration involves the following steps: (i) computation of the FE cell level Hamiltonian matrix contributions, (ii) Chebyshev polynomial filtering (CF) to compute lowest occupied eigensubspace, (iii) Rayleigh-Ritz (RRGEP) procedure which involves projection of the Kohn-Sham problem onto the filtered subspace and solving the resulting small GHEP problem, and (iv) computation of the electron density (DC). Although the RRGEP procedure implemented in DFT-FE 1.0 is slightly different from the orthogonalization and Rayleigh-Ritz approach implemented in DFT-FE 0.6, the accuracy and robustness of the solver is not affected.
244The major implementation improvement in DFT-FE 1.0 is the efficient GPU porting of all the key computational kernels in the SCF iteration, namely CF, RRGEP and DC. Our GPU porting strategy hinges on reducing data-access and communication costs while effectively utilizing the massive fine grained parallelism of GPUs. In the case of the CF step, which involves sparse-dense matrix products, we achieved a high GPU throughput performance of 54% of the V100 GPU FP64 peak in a multi-node job with a total of 24 GPUs for a ∼6,000 electrons metallic benchmark system. Further, on 96 GPUs, the throughput performance was observed to be 43% of the FP64 peak. This high GPU throughput performance was achieved by leveraging the FE cell structure to recast the sparse-dense matrix products into a batch of small dense-dense matrix products that have higher arithmetic intensity and naturally exploiting the massive parallelism of GPUs. Further, we efficiently utilize the high memory bandwidth of the GPUs by performing blocked operations over the wavefunctions in the various data movement steps in CF. Additionally, the low boundary communication cost due to the locality of the FE basis and reduction of communication latencies in CF by performing simultaneous point-to-point communications across multiple wavefunctions are also crucial in realizing this performance. We further reduced the communication costs by combining implementation strategies such as asynchronous compute and communication and FP32 boundary communication, the latter being motivated from the small percentage of FE boundary nodes in a given MPI partition. Next, in the case of the O M N 2 RRGEP procedure, which is the dominant cost for larger systems, we implemented a scalable approach specifically designed to overcome the communication and peak memory bottlenecks associated with performing parallel dense matrix-matrix multiplications involving matrices with extreme aspect ratios (M/N ≫ 1). Our implementation reduces the dominant communication cost to O(N 2 log(M )) through optimal distribution of compute costs across FE domain decomposition MPI partitions and efficient data movement strategies involving the intermediate N × N matrices that are stored in a parallel block-cyclic format. Further, we implemented a blocked approach to reduce the peak memory footprint in the intermediate steps. The blocked approach is also exploited to further enhance the performance of the parallel dense matrix-matrix multiplications on GPUs by implementing mixed precision arithmetic, asynchronous compute and communication and GPU-direct communication strategies. To assess the computational efficiency of our RRGEP implementation, we studied the throughput performance of the dominant RRGEP steps on a ∼60,000 electrons metallic benchmark system using 960 GPUs. We achieved 30-40% throughput performance of the FP64 peak, which was significantly boosted to 70-110% when the mixed precision arithmetic and asynchronous compute and communication strategies are employed.
245In order to assess the accuracy of the improved electrostatics methodology as well as the new GPU implementation, we conducted a validation study of DFT-FE 1.0 using QE (pseudopotential calculations) and NWChem (all-electron calculations). Our pseudopotenial benchmark systems included a periodic bulk metallic system, non-periodic nanoparticle, and a semiconductor-insulator interface system. On all the benchmark systems, we demonstrate excellent agreement between DFT-FE 1.0 and QE on ground-state energies, ionic forces and stresses, when both codes are solved to chemical accuracy. Similarly, in the case of the all-electron validation study, we demonstrate excellent agreement of DFT-FE 1.0 with NWChem on the ground-state energy of a non-periodic aromatic compound.
246We demonstrated the computational efficiency and parallel scalability of DFT-FE 1.0 for pseudopotential DFT calculations on a subset of the benchmark problems with varying system sizes (∼ 4,000-120,000 electrons), all calculations being solved to chemical accuracy. First, to assess the computational efficiency afforded for pseudopotential DFT calculations by the improved electrostatics methodology, we compared the CPU computational time per SCF iteration step between DFT-FE 0.6 and DFT-FE 1.0 on periodic BCC Mo benchmark systems of various sizes. These studies performed on a many-core CPU machine indicated ∼ 3× reduction both in the CPU time and the number of FE basis functions compared to DFT-FE 0.6 . Next, we evaluated the performance of DFT-FE 1.0 on the Summit hybrid CPU-GPU supercomputer considering both periodic and non-periodic metallic benchmark systems. We find DFT-FE 1.0 to achieve ∼16-20× CPU-GPU speedups for system sizes ranging from ∼ 4,000-30,000 electrons, where the speedup is measured by comparing the node-hrs per SCF iteration step consumed by a hybrid CPU-GPU run against a CPU-only run on the Summit machine, while using all the available compute resources on the compute nodes. An analysis of the computational cost breakdown showed that the efficient GPU performance of DFT-FE for both the O(M N ) CF step and the O M N 2 RRGEP steps is crucial to realize these CPU-GPU speedups for both medium and large system sizes. Furthermore, DFT-FE 1.0 demonstrated excellent parallel scalability on the hybrid CPU-GPU architectures, with an observed strong scaling of a 14,322 electrons system from 42 to 672 GPUs at a relative speedup of 8.5×. This enabled very low wall-times for the full ground-state calculation, which includes initialization costs and computation of ionic forces. In particular, DFT-FE 1.0 achieved minimum wall-times of ∼1-2 minutes for system sizes of ∼6,000-14,000 electrons. Finally, we studied the performance of DFT-FE 1.0 on large systems with 61,502 and 114,674 electrons, using 960 and 3,600 GPUs respectively. Notably, DFT-FE 1.0 wall-times for the full ground-state calculation of the 61,502 and 114,674 electrons systems were 32 and 54 minutes, respectively.
247In summary, DFT-FE 1.0 combines improved computational efficiency and the ability to achieve significant acceleration and parallel scalability on hybrid CPU-GPU architectures to enable fast and accurate pseudopotential DFT calculations at larger length-scales than possible heretofore. Furthermore, the high throughput performance and parallel scalability achieved by DFT-FE on preexascale hybrid CPU-GPU supercomputers, as demonstrated in this work, makes it well placed to leverage the upcoming exascale supercomputers. In this regard, our future implementation efforts will focus on ensuring performance portability of DFT-FE on a diverse array of accelerators from different vendors requiring different programming languages such as CUDA and HIP. Our ongoing and future efforts will also involve implementation of softer projector augmented-wave pseudopotentials [101] in DFT-FE for more efficient pseudopotential DFT calculations, and implementation of enriched finite-element basis [26; 35], which can enable large-scale efficient all-electron DFT calculations. Another important area of focus for further development of DFT-FE is the implementation of advanced exchange-correlation functionals, where the authors are currently pursuing development of numerical strategies for fast and accurate hybrid exchange-correlation functional calculations. Also related to exchange-correlation functional development is the ongoing effort of implementing systematically convergent inverse DFT approaches [102] into DFT-FE to compute exact exchange-correlation potentials from many-body ground-state electron densities [103], and subsequently improve the exchange-correlation models from this data. Finally, implementation of real-time time-dependent DFT [27] and its GPU porting is also being pursued.
248Technology India (Grant Number: SRG/2020/002194) for the purchase of a GPU cluster, which also provided computational resources for this work.
249Appendix A. Efficient evaluation of terms related to the external potential correction in the configurational force expression
250We describe here the procedure for the combined evaluation of the terms´Ω p E ext,corr : ∇Υ(x) dx+ F ext,corr in the configurational force expression (cf. Eq. 28 in Section 2.2) implemented in DFT-FE 1.0. The notations followed here are consistent with that of Section 2. Considering the expression forΩ p E ext,corr : ∇Υ(x) dx + F ext,corr =Ω p a r V a ext,loc (|x − (R a + L r )|) − V a sm (x, (R a + L r )) ρ(x) I :
251presents two challenges for its computationally efficient and accurate evaluation. The first challenge is that the direct evaluation of integrals containing ∇V a ext,loc (|x−(R a +L r )|) would be inefficient due to requirement of denser quadrature grids owing to their potentially non-smooth nature. However, employing integration by parts to transfer the gradient on to smoother fields, as done in other places in Section 2.2, needs to be carefully employed here to ensure that the terms in the final expression have cancellation of the tails of V a ext,loc (|x−(R a +L r )|) and V a sm (x, R a +L r ) for convergent evaluation of their combined sums over the periodic lattice sites r. The second challenge in evaluation of Eq. A.1 is the accurate and efficient computation of ∂V a smε (x,bsm(| τ ε (y)− τ ε (Ra)|) ∂ε ε=0
252. First, we discuss our methodology to address the first challenge. To begin with, we take integration by parts of terms involving ∇V a ext,loc (|x − (R a + L r )|) and ∇V a sm (x, R a + L r ) to rewrite Eq. A.1 as followŝ Ωp a r V a sm (x, R a + L r ) − V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(x)) dx +Ω p a r V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(R a + L r )) dx Next, considering the last term in the above, we further facilitate transfer of derivatives by splitting the integration over Ω p for each (a, r) pair into two regions inside the unit cell: (i) Ω a,r ∩ Ω p , which is the intersection of a bounded domain Ω a,r surrounding the atom at (R a + L r ) with the unit cell periodic domain Ω p , and (ii) Ω p − Ω a,r , which is the remainder region inside Ω p excluding the intersection with Ω a,r . Thus, Eq. A.2 is rewritten aŝ Ωp a r V a sm (x, R a + L r ) − V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(x)) dx +Ω p a r V a ext,loc (|x − (R a + L r )|) (∇ρ(x) · Υ(R a + L r )) dx − a rΩ a,r ∩ Ωpρ
2533)
254The choice of Ω a,r in the above is such that outside Ω a,r , V a sm (x, R a + L r ) can be assumed to be a smooth radially symmetric function, given by V a sm (|x − (R a + L r )|. We use this assumption to rewrite the last term in Eq. A.3 as Further, noting that form of Eq. A.4 is now amenable to apply integration by parts, we transform it using integration by parts into a sum of a surface integral term and a volume integral term which subsequently do not have ∇V a sm (|x − (R a + L r )|. This is desired to ensure cancellation of the asymptotic tail of V a sm (|x − (R a + L r )| with that of V a ext,loc (|x − (R a + L r )|) in Eq. A.3. We perform this step as follows Next, we discuss our methodology for addressing the second challenge, which is the evaluation of ∂V a smε (x, b sm (| τ ε (y) − τ ε (R a + L r )|)) ∂ε present in the third term in Eq. A.6. We consider the following three different cases: (a) allelectron ionic forces-configurational force is evaluated with respect to a generator perturbing the atom and the underlying space in a compact support around the atom. This is required in allelectron calculations where the ionic positions are coupled to the corner nodes of FE triangulation elements to capture the cusp in the electronic wavefunctions; (b) pseudopotential ionic forcesconfigurational force is evaluated by perturbing the atoms without perturbing the underlying space i.e. floating nuclear charges with Υ(x) = 0 and Υ(R a + L r ) = 0. This approach is used in the case of pseudopotential calculations with smooth electronic fields; and (c) periodic unit-cell stress computation-configurational force is computed with respect to a affine deformation generator (Υ i = C ij x j ). First, in the case of all-electron ionic forces (case (a)), we assume V a sm (x, R a + L r ) to be a radially symmetric field, V a sm (|x − R a + L r |), which is a reasonable assumption as refined FE triangulations with much smaller element sizes near the ionic positions are employed in the case of all-electron calculations in DFT-FE. Thus, Eq. A.7 now simplifies to ∂V a smε (|x − τ ε (R a + L r )|) ∂ε ε=0 = −∇V a sm (|x − (R a + L r )|) · Υ(R a + L r ) . (A.8)
255Second, in the case of pseudopotential ionic forces (case (b)), the assumption of floating nuclear charges (Υ(x) = 0 and Υ(R a + L r ) = 0) simplifies Eq. A.7 to ∂V a smε (x, b sm (|y − τ ε (R a + L r )|)) ∂ε ε=0 = R 3 −∇b a sm (|y − (R a + L r )|) |x − y| dy ·Υ(R a +L r ) , (A. 9) where the integral over the Coulomb kernel is obtained by solutions of Poisson problems to compute the potential associated with the gradient of the smeared charge distribution. The Poisson problems are solved on bounded domains Ω a,r with Dirichlet boundary conditions set to the gradient of the exact nuclear potential, ∇V a nuc |x − (R a + L r )|. We note that only the Poisson problems corresponding to a finite number of bounded domains Ω a,r having non-trivial intersection with the periodic unit cell (Ω a,r ∩ Ω p = ∅) need to be considered. Finally, for the case of periodic unit-cell stress computation (case (c)), we employ central finite difference scheme to evaluate Eq. A.7 corresponding to the six unique affine strain components. We remark that a similar approach would be impractical for all-electron ionic forces (case (a)) as it would incur a large cost to evaluate Eq. A.7 by finite difference for all the different τ ε corresponding to individual force components over all the atoms.
참고문헌 83건
- Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis 2019 10.1145/3295500
- Electronic Structure: Basic Theory and Practical Methods 2004
- Optimization algorithm for the generation of ONCV pseudopotentials Computer Physics Communications · Elsevier BV · 2015 10.1016/j.cpc.2015.05.011
- <scp>cp2k:</scp> atomistic simulations of condensed matter systems Wiley Interdisciplinary Reviews Computational Molecular Science · Wiley · 2013 10.1002/wcms.1159
- RESCU: A real space electronic structure method Journal of Computational Physics · Elsevier BV · 2015 10.1016/j.jcp.2015.12.014
- NWChem: A comprehensive and scalable open-source solution for large scale molecular simulations Computer Physics Communications · Elsevier BV · 2010 10.1016/j.cpc.2010.04.018
- Electronic structure calculations with GPAW: a real-space implementation of the projector augmented-wave method Journal of Physics Condensed Matter · IOP Publishing · 2010 10.1088/0953-8984/22/25/253202
- All-electron Kohn–Sham density functional theory on hierarchic finite element spaces Journal of Computational Physics · Elsevier BV · 2013 10.1016/j.jcp.2013.04.020
- Projector augmented-wave method Physical review. B, Condensed matter · American Physical Society · 1994 10.1103/physrevb.50.17953
- Efficient iteration scheme for self-consistent pseudopotential calculations Physical review. B, Condensed matter · American Physical Society · 1981 10.1103/physrevb.23.3082
- Adaptive finite-element method for electronic-structure calculations Physical review. B, Condensed matter · American Physical Society · 1996 10.1103/physrevb.54.7602
- Introducing <scp>ONETEP</scp>: Linear-scaling density functional simulations on parallel computers The Journal of Chemical Physics · American Institute of Physics · 2005 10.1063/1.1839852
- Generalized Gradient Approximation Made Simple Physical Review Letters · American Physical Society · 1996 10.1103/physrevlett.77.3865
- Orbital-free density functional theory simulations of dislocations in magnesium Modelling and Simulation in Materials Science and Engineering · IOP Publishing · 2011 10.1088/0965-0393/20/1/015006
- Speeding up plane-wave electronic-structure calculations using graphics-processing units Computer Physics Communications · Elsevier BV · 2011 10.1016/j.cpc.2011.03.010
- <i>Ab Initio</i>Study of Screw Dislocations in Mo and Ta: A New Picture of Plasticity in bcc Transition Metals Physical Review Letters · American Physical Society · 2000 10.1103/physrevlett.84.1499
- Finite element methods in<i>ab initio</i>electronic structure calculations Modelling and Simulation in Materials Science and Engineering · IOP Publishing · 2005 10.1088/0965-0393/13/3/r01
- Self-Consistent Molecular-Orbital Methods. I. Use of Gaussian Expansions of Slater-Type Atomic Orbitals The Journal of Chemical Physics · American Institute of Physics · 1969 10.1063/1.1672392
- Electronic-structure study of an edge dislocation in Aluminum and the role of macroscopic deformations on its energetics Journal of the Mechanics and Physics of Solids · Elsevier BV · 2014 10.1016/j.jmps.2014.12.009
- The Chemistry of Deformation: How Solutes Soften Pure Metals Science · American Association for the Advancement of Science · 2005 10.1126/science.1118616
- A generic interface for parallel cell-based finite element operator application Computers & Fluids · Elsevier BV · 2012 10.1016/j.compfluid.2012.04.012
- Non-periodic finite-element formulation of Kohn–Sham density functional theory Journal of the Mechanics and Physics of Solids · Elsevier BV · 2009 10.1016/j.jmps.2009.10.002
- Algorithms and data structures for massively parallel generic adaptive finite element codes ACM Transactions on Mathematical Software · Association for Computing Machinery · 2011 10.1145/2049673.2049678
- First-principles computation of material properties: the ABINIT software project Computational Materials Science · Elsevier BV · 2002 10.1016/s0927-0256(02)00325-7
- Iterative Procedures for Nonlinear Integral Equations Journal of the ACM · Association for Computing Machinery · 1965 10.1145/321296.321305
- Non-periodic finite-element formulation of orbital-free density functional theory Journal of the Mechanics and Physics of Solids · Elsevier BV · 2006 10.1016/j.jmps.2006.09.011
- Real-space local polynomial basis for solid-state electronic-structure calculations: A finite-element approach Physical review. B, Condensed matter · American Physical Society · 1999 10.1103/physrevb.59.12352
- Efficient pseudopotentials for plane-wave calculations Physical review. B, Condensed matter · American Physical Society · 1991 10.1103/physrevb.43.1993
- Efficacious Form for Model Pseudopotentials Physical Review Letters · American Physical Society · 1982 10.1103/physrevlett.48.1425
- Beyond the local-density approximation in calculations of ground-state electronic properties Physical review. B, Condensed matter · American Physical Society · 1983 10.1103/physrevb.28.1809
- Density functional theory calculation on many-cores hybrid central processing unit-graphic processing unit architectures The Journal of Chemical Physics · American Institute of Physics · 2009 10.1063/1.3166140
- exciting: a full-potential all-electron package implementing density-functional theory and many-body perturbation theory Journal of Physics Condensed Matter · IOP Publishing · 2014 10.1088/0953-8984/26/36/363202
- Higher-order adaptive finite-element methods for Kohn–Sham density functional theory Journal of Computational Physics · Elsevier BV · 2013 10.1016/j.jcp.2013.06.042
- Linear scaling electronic structure methods Reviews of Modern Physics · American Physical Society · 1999 10.1103/revmodphys.71.1085
- Adaptive Finite Element Method for Solving the Exact Kohn−Sham Equation of Density Functional Theory Journal of Chemical Theory and Computation · American Chemical Society · 2009 10.1021/ct800350j
- Efficient iterative schemes for<i>ab initio</i>total-energy calculations using a plane-wave basis set Physical review. B, Condensed matter · American Physical Society · 1996 10.1103/physrevb.54.11169
- Large‐scale DFT calculations in implicit solvent—A case study on the T4 lysozyme L99A/M102Q protein International Journal of Quantum Chemistry · Wiley · 2012 10.1002/qua.24075
- Linear-scaling first-principles molecular dynamics with plane-waves accuracy Physical Review B · American Physical Society · 2006 10.1103/physrevb.73.115124
- Electronic-structure calculations based on the finite-element method Physical review. B, Condensed matter · American Physical Society · 1995 10.1103/physrevb.52.5573
- Dislocation Core Energies and Core Fields from First Principles Physical Review Letters · American Physical Society · 2009 10.1103/physrevlett.102.055502
- Real-space grids and the Octopus code as tools for the development of new simulation approaches for electronic systems Physical Chemistry Chemical Physics · Royal Society of Chemistry · 2015 10.1039/c5cp00351b
- Daubechies wavelets for high performance electronic structure calculations: The BigDFT project Comptes Rendus Mécanique · Elsevier BV · 2010 10.1016/j.crme.2010.12.003
- QUANTUM ESPRESSO: a modular and open-source software project for quantum simulations of materials Journal of Physics Condensed Matter · IOP Publishing · 2009 10.1088/0953-8984/21/39/395502
- Polarization consistent basis sets. II. Estimating the Kohn–Sham basis set limit The Journal of Chemical Physics · American Institute of Physics · 2002 10.1063/1.1465405
- Ab initio molecular simulations with numeric atom-centered orbitals Computer Physics Communications · Elsevier BV · 2009 10.1016/j.cpc.2009.06.022
- The ELPA library: scalable parallel eigenvalue solutions for electronic structure theory and computational science Journal of Physics Condensed Matter · IOP Publishing · 2014 10.1088/0953-8984/26/21/213201
- First principles methods using CASTEP Zeitschrift für Kristallographie - Crystalline Materials · De Gruyter · 2005 10.1524/zkri.220.5.567.65075
- PARSEC – the pseudopotential algorithm for real‐space electronic structure calculations: recent advances and novel applications to nano‐structures physica status solidi (b) · Wiley · 2006 10.1002/pssb.200541463
- On the adaptive finite element analysis of the Kohn–Sham equations: methods, algorithms, and implementation International Journal for Numerical Methods in Engineering · Wiley · 2015 10.1002/nme.5140
- Self-Consistent Equations Including Exchange and Correlation Effects Physical Review · American Institute of Physics · 1965 10.1103/physrev.140.a1133
- Orbital-free density functional theory study of the energetics of vacancy clustering and prismatic dislocation loop nucleation in aluminium The Philosophical Magazine A Journal of Theoretical Experimental and Applied Physics · Taylor & Francis · 2016 10.1080/14786435.2016.1205232
- SPARC: Accurate and efficient finite-difference formulation and parallel implementation of Density Functional Theory: Isolated clusters Computer Physics Communications · Elsevier BV · 2016 10.1016/j.cpc.2016.09.020
- Subquadratic-scaling subspace projection method for large-scale Kohn-Sham density functional theory calculations using spectral finite-element discretization Physical Review B · American Physical Society · 2014 10.1103/physrevb.90.115127
- Progress in the development of exchange-correlation functionals Elsevier eBooks · Elsevier BV · 2005 10.1016/b978-044451719-7/50067-6
- Applications of large-scale density functional theory in biology Journal of Physics Condensed Matter · IOP Publishing · 2016 10.1088/0953-8984/28/39/393001
- Spectrum-splitting approach for Fermi-operator expansion in all-electron Kohn-Sham DFT calculations Physical review. B./Physical review. B · American Physical Society · 2017 10.1103/physrevb.95.035111
- Large-scale all-electron density functional theory calculations using an enriched finite-element basis Physical review. B./Physical review. B · American Physical Society · 2017 10.1103/physrevb.95.035112
- Ab initio modeling of dislocation core properties in metals and semiconductors Acta Materialia · Elsevier BV · 2016 10.1016/j.actamat.2016.09.049
- Electronic structure study of screw dislocation core energetics in Aluminum and core energetics informed forces in a dislocation aggregate Journal of the Mechanics and Physics of Solids · Elsevier BV · 2017 10.1016/j.jmps.2017.03.010
- Beyond Magic Numbers: Atomic Scale Equilibrium Nanoparticle Shapes for Any Size Nano Letters · American Chemical Society · 2017 10.1021/acs.nanolett.7b02761
- Advanced capabilities for materials modelling with Quantum ESPRESSO Journal of Physics Condensed Matter · IOP Publishing · 2017 10.1088/1361-648x/aa8f79
- The PseudoDojo: Training and grading a 85 element optimized norm-conserving pseudopotential table Computer Physics Communications · Elsevier BV · 2018 10.1016/j.cpc.2018.01.012
- Two-Level Chebyshev Filter Based Complementary Subspace Method: Pushing the Envelope of Large-Scale Electronic Structure Calculations Journal of Chemical Theory and Computation · American Chemical Society · 2018 10.1021/acs.jctc.7b01243
- Configurational forces in electronic structure calculations using Kohn-Sham density functional theory Physical review. B./Physical review. B · American Physical Society · 2018 10.1103/physrevb.97.165132
- Review on modeling of the anode solid electrolyte interphase (SEI) for lithium-ion batteries npj Computational Materials · Nature Portfolio · 2018 10.1038/s41524-018-0064-0
- Application of order-N first-principles DFT calculations with temperature controlled molecular dynamics to biomolecular system Journal of Physics Conference Series · IOP Publishing · 2018 10.1088/1742-6596/1136/1/012025
- The deal.II library, Version 9.0 Journal of Numerical Mathematics · De Gruyter · 2018 10.1515/jnma-2018-0054
- Real time time-dependent density functional theory using higher order finite-element methods Physical review. B./Physical review. B · American Physical Society · 2019 10.1103/physrevb.100.115148
- Discrete discontinuous basis projection method for large-scale electronic structure calculations The Journal of Chemical Physics · American Institute of Physics · 2018 10.1063/1.5037794
- Adaptive Finite Element Approximations for Kohn--Sham Models Multiscale Modeling and Simulation · Society for Industrial and Applied Mathematics · 2014 10.1137/130916096
- DFT-FE – A massively parallel adaptive finite-element code for large-scale density functional theory calculations Computer Physics Communications · Elsevier BV · 2019 10.1016/j.cpc.2019.07.016
- <i>Ab initio</i> theory of the nitrogen‐vacancy center in diamond Nanophotonics · De Gruyter · 2018 10.1515/nanoph-2019-0154
- Exact exchange-correlation potentials from ground-state electron densities Nature Communications · Nature Portfolio · 2019 10.1038/s41467-019-12467-0
- DFT modelling of explicit solid–solid interfaces in batteries: methods and challenges Physical Chemistry Chemical Physics · Royal Society of Chemistry · 2020 10.1039/c9cp06485k
- Backbone charge transport in double-stranded DNA Nature Nanotechnology · Nature Portfolio · 2020 10.1038/s41565-020-0741-2
- Fast and robust all-electron density functional theory calculations in solids using orthogonalized enriched finite elements Physical review. B./Physical review. B · American Physical Society · 2021 10.1103/physrevb.104.085112
- Optimizations of the eigensolvers in the ELPA library Parallel Computing · Elsevier BV · 2019 10.1016/j.parco.2019.04.003
- Tensor-structured algorithm for reduced-order scaling large-scale Kohn–Sham density functional theory calculations npj Computational Materials · Nature Portfolio · 2021 10.1038/s41524-021-00517-5
- Spin–spin interactions in defects in solids from mixed all-electron and pseudopotential first-principles calculations npj Computational Materials · Nature Portfolio · 2021 10.1038/s41524-021-00590-w
- Pushing the boundaries of lithium battery research with atomistic modelling on different scales Progress in Energy · IOP Publishing · 2021 10.1088/2516-1083/ac3894
- The Mathematical theory of finite element methods Computers & Mathematics with Applications · Elsevier BV · 2003 10.1016/s0898-1221(03)90061-7
- A Comparison of Exact and Model Exchange–Correlation Potentials for Molecules The Journal of Physical Chemistry Letters · American Chemical Society · 2021 10.1021/acs.jpclett.1c03670
- 2012 20th Euromicro International Conference on Parallel, Distributed and Network-based Processing 2012 10.1109/pdp20099.2012