Linux and MPI

Download Report

Transcript Linux and MPI

PWscf, FPMD and CP
(Democritos Package)
Tutorial
Carlo Cavazzoni
(High Performance Computing Group)
CINECA
07/07/2015
1
Outline
• ab-initio simulations introduction
• PWSCF and Democritos package
• Installation
• Functionality
• Simple examples
07/07/2015
2
The scope of computer
simulation
Measure theories. Solve equations which
could not be solved otherwise. “Get
numbers out of theories” much in the
same way as experiments “get numbers
out of a natural process”
Do virtual experiments where
experimental conditions can be controlled
down to the atomic scale in ways which
would not be possible in the lab
Ab initio simulations
The Born-Oppenheimer approximation (M>>m)
Density functional theory
Kohn-Sham
Hamiltonian
Kohn-Sham equations from
functional minimization
Kohn & Sham
Helmann &
Feynman
The tricks of the trade
Expanding the Kohn-Sham orbitals into
a suitable basis set turns DFT into a
multi-variate minimization problem,
and the KS equation into a non-linear
matrix eigenvalue problem
The use of pseudo-potentials allows to
ignore chemically inert core states and
to use plane waves (the name of the
game!)
The tricks of the trade (II)
Plane waves are orthogonal and the matrix elements
are usually easy to calculate; the effective
completeness of the basis is easy to check
Plane-waves allow to calculate efficiently matrixvector products and to solve the Poisson equation
using FFT’s
Supercells for treating finite (or semi-infinite)
systems
Iterative diagonalization vs. global minimization
The tricks of the trade (III)
Summing over occupied states: specialpoint and Gaussian-smearing techniques
Non-linear extrapolation for SCF
acceleration and density prediction in MD
Choice of fictitious masses in CP
dynamics
Which algorithm shall I use?
Electronic structure:
minimization
SCF diagonalization vs. energy
Geometry optimization:
standard DFT
Lattice vibrations, static response functions:
DF perturbation theory
Dynamics:
Car-Parrinello vs. Born-Oppenheimer
Slow kinetics and rare events:
Parrinello-Laio metadynamics
path sampling vs.
Optical properties, excited states:
DFT & many-body perturbation theory
Time-dependent
PWSCF and Democritos
(www.democritos.it)
(DEmocritos MOdeling Center for Research in aTOmistic Simulatios)
Democritos is a National Simulation Center of the Italian
Istituto Nazionale per la Fisica della Materia (INFM).
Hosted by SISSA in Trieste
PWSCF is promoted, maintained and developed
by Democritos
CINECA is a Partner of Democritos.
07/07/2015
11
Democritos and Scientific Software
GOAL:
Development of software for next generation
parallel computers (N>10000 processors)
Production of high-quality software package for
atomistic simulations based on densityfunctional theory (DFT), plane wave (PW) and
pseudopotentials (PP)
07/07/2015
12
PWSCF is also part of a merge effort
of pre-existing scientific software
PWscf package: electronic
structure, structural optimization,
molecular dynamics, vibrational and
dielectric properties. Developed by S.
Baroni, S. de Gironcoli, A. Dal Corso
(SISSA, Trieste), P. Giannozzi (Scuola
Normale, Pisa) and others.
See http://www.pwscf.org for more
information and downloads.
CP
code: Car-Parrinello
variable-cell molecular dynamics.
Developed by A. Pasquarello
(IRRMA, Lausanne), K. Laasonen
(Oulu), A. Trave (UCBerkeley), R.
Car (Princeton), P. Giannozzi and
others. Based on the original code
written by R. Car and A.
Pasquarello.
Download CP (initial public release)
http://www.democritos.it/scientific.php
07/07/2015
FPMD code: Car-Parrinello
variable-cell molecular dynamics.
Developed by C. Cavazzoni (CINECA,
Bologna), S. Scandolo (ICTP, Trieste), G.
Chiarotti (SISSA, Trieste), P. Focher, G.
Ballabio and others. Based on the original
code written by R. Car and M. Parrinello.
Download FPMD (initial public release)
GNU License
13
Present Package Status
The Package is developed in Fortran90
The codes in the Package share:
• installation
• most parts of the basic code
• input format
• PP format
• a graphical GUI is being developed
• output format (CP/FPMD fully compatible/restartable)
07/07/2015
14
Basic Data Type
Real space
Charge density
3D arrays
Wave functions
1D arrays
Reciprocal space
07/07/2015
15
Reciprocal Space Representation
Wave
Functions
 i r  
1
Ci G  expiGr 

 G
G / 2  Ecut
2
Charge
Density
 r    fi  i r 
2
i
 G  
1
f i  Ci GCi G  G expiG  Gr 

 i
G
G / 2  4 Ecut
2
07/07/2015
To truncate the infinite sum
To retain the same accurancy
as the wave function
16
DFT Functional
 1

*
E i , R I    f i  dr i r    2  Vnlps  i r  
 2

i
occ
e r e r
Zv2
1
 drVl r e r   2  drdr r  r  Exc e  
I  J RI  RJ
ps
07/07/2015
17
FFTs
Ecut
4Ecut
Reciprocal
Space
 G 
 i G
|G|2/2< Ecut
|G|2/2< 4Ecut
FFT
Real
Space
 i r 
07/07/2015
 r    fi  i r 
2
i
18
Parallelization
Reciprocal Space distribution
 G 
P0
 i G
P2
P3
P4
PWSCF parallelize also over K-points
07/07/2015
19
Parallelization
FFT algorithm
z
x
Transform along Z
y
y
0 1 2 3 0 1 2 3
0 1 2 3 0 1 2 3 0 1
2 3
Ec
x
Transform along Y
z
Transform along X
0
0
4Ec
y
x
z
2
2
1
1
3
3
Nx Nz / 2 FFT along y
Ny Nz FFT along x
~ Nx Ny / 5 FFT along z
Column
Owner
0
PE 0
PE 1
PE 2
PE 3
1
2
3
07/07/2015
20
SP4, optimization issues
•use essl
•use non-blocking communications
•use mass
•modify strides to reduce TLB misses
•use block-algorithm whenever possible
ATLAS strategy
07/07/2015
21
Case study: matrix transposition
do i=1,n
do j=1,m
y(j,i) = x(i,j)
enddo
enddo
block-algorithm
bsiz = block size
nb
= n / bsiz
mb
= n / bsiz
more code for reminder:
MOD(n / bsiz) /= 0 OR
MOD(m / bsiz) /= 0
07/07/2015
do ib = 1, nb
ioff = (ib-1) * bsiz
do jb = 1, mb
joff = (jb-1) * bsiz
do j = 1, bsiz
do i = 1, bsiz
buf(i,j) = x(i+ioff, j+joff)
enddo
enddo
do j = 1, bsiz
do i = 1, j-1
bswp = buf(i,j)
buf(i,j) = buf(j,i)
buf(j,i) = bswp
enddo
enddo
do i=1,bsiz
do j=1,bsiz
y(j+joff, i+ioff) = buf(j,i)
enddo
enddo
enddo
enddo
22
Block algorithm for matrix transposition
80
70
Mips
60
50
40
30
20
10
0
0
20
40
60
80
100
120
block dimension
07/07/2015
23
CP code
Developed by A. Pasquarello (IRRMA, Lausanne), K. Laasonen (Oulu), A. Trave (UCBerkeley), R. Car (Princeton), P.
Giannozzi and others. Based on the original code written by R. Car and A. Pasquarello.
Verlet dynamics with mass preconditioning
Temperature control: Nose’ thermostat, velocity rescaling
Metallic systems: Nose’ thermostat for both electrons and ions
electronic and ionic minimization via damped dynamics
Modified kinetic functional for costant-pressure calculations
“grid box” for fast treatment of augmentation terms in Ultrasoft PP’s
Nudget Elastic Band (NEB) scheme for transition paths and energy barriers
07/07/2015
Limitations:
no k-points
no fancier minimization chemes
no constraints
24
FPMD code
Developed by C. Cavazzoni (CINECA, Bologna), S. Scandolo (ICTP, Trieste), G. Chiarotti (SISSA, Trieste), P. Focher, G.
Ballabio and others. Based on the original code written by R. Car and M. Parrinello.
Verlet dynamics with mass preconditioning
Temperature control: Nose’ thermostat, velocity rescaling
Metallic systems: Nose’ thermostat for both electrons and ions
Various electronic and ionic minimization schemes
Modified kinetic functional for costant-pressure calculations
Macroscopic polarization via Berry Phase
Nudget Elastic Band (NEB) scheme for transition paths and energy
barriers
Constrained dynamics
Limitations:
no Ultrasoft PP’s
07/07/2015
25
PWSCF code
Developed by S. Baroni, S. de Gironcoli, A. Dal Corso (SISSA, Trieste), P. Giannozzi (Scuola Normale, Pisa) and others.
Self-consistent ground-state energy and Kohn-Sham orbitals
Structural optimization
Molecular dynamics on the ground-state Born-Oppenheimer surface
Variable-cell molecular dynamics
Phonon frequencies and eigenvectors at a generic wave vector
Effective charges and dielectric tensors
Electron-phonon interaction coefficients for metals
Third-order anharmonic phonon lifetimes
Macroscopic polarization via Berry Phase
Nudget Elastic Band (NEB) scheme for transition paths and energy
barriers
Limitations:
no Car-Parrinello dynamics
very limited constrained minimization and dynamics
07/07/2015
26
Access the anonymous CVS of the
Democritos PW-PP-DFT Package
anonymous CVS contains the whole package,
with all the codes
(tcsh/csh):
setenv CVS_RSH ssh
setenv CVSROOT :pserver:[email protected]:/home/cvs
(sh/bash):
export CVS_RSH=ssh
export CVSROOT=:pserver:[email protected]:/home/cvs
Then:
cvs login
(password: cvsanon).
For the first code download:
cvs co O-sesame
Open-Sesame: Open-Source Scalable Electronic Structure and Atomistic Modeling Environment
07/07/2015
27
Installation
./configure
make target
where target is one of the following:
pw
basic code for scf, structure optimization, MD
fpmd
FPMD code for Car-Parrinello MD
cp
CP code: CP MD with ultrasoft pseudopotentials
ph
phonon code
pp
postprocessing programs
gamma
Gamma-only version of phonon code
nc
non collinear magnetic version of pw code
pwcond
ballistic conductance
d3
third-order derivatives
tools
misc tools for data analysis
upf
utilities for pseudopotential conversion
pwall
same as "make pw ph pp gamma nc pwcond d3 tools"
all
same as "make pwall fpmd cp upf"
links
creates links to executables in bin/
clean
remove executables and objects
veryclean
revert distribution to the original status
tar
create a tarball of the source tree
tar-gui
create a tarball of the GUI sources
07/07/2015
28
Installation (DEMO)
how to configure configure?
07/07/2015
29
Directories tree
I/II
include
includes files
Modules
clib
flib
upftools
common modules, subroutine and tools
CPV
FPMD
PW
main codes directories
D3
PH
PP
pw post-processing codes
07/07/2015
30
Directories tree II/II
pwdocs
cpdocs
documentation
pseudo
pseudopotential library
install
preconfigured installation parameter files
cp_examples
pw_examples
run examples
07/07/2015
31
Input files
PWscf, CP and FPMD share the same
input files format
All codes read input parameters from
standard input
Codes read from files PP data,
all codes read the same PP files
In directory upftools there are conversion
tools for PP formats (there is one also for CPMD)
07/07/2015
32
Standard Input Layout
The standard input is divided in two main section
the first contains fortran namelists
the seconds contains optional input “CARDS”
all input parameter are described in cpdocs and
pwdocs file.
all input parameter for all codes are contained
in file Modules/input_parameters.f90
07/07/2015
33
cards
namelists
layout
07/07/2015
&CONTROL
control_parameter_1, control_parameter_2,
.......
/
&SYSTEM
sistem_parameter_1, sistem_parameter_2,
.......
/
&ELECTRONS
electrons_parameter_1, electrons_parameter_2,
.......
/
&IONS
ions_parameter_1, ions_parameter_2,
.......
/
&CELL
cell_parameter_1, cell_parameter_2,
.......
/
‘ATOMIC_SPECIES’
label_1 mass_1 pseudo_file_1
label_2 mass_2 pseudo_file_2
.....
‘ATOMIC_POSITIONS’
label_1 px_1 py_1 pz_1
label_2 px_2 py_2 pz_2
.....
the namelist order is
fixed, but within a
namelist the parameter
sequence is irrelevant
card order is irrelevant,
but within a card the
parameter layout is fixed
34
Input Namelists
&CONTROL input variables that control the flux of teh
calculation and the amount of I/O on disk and on the screen
&SYSTEM input variables that specify the system under study
&ELECTRONS input variables that control the algorithms used to
reach the self-consistent solution of KS equations for the
electrons, and the electrons dynamics (for CP and FPMD)
&IONS input variables that control ionic motion in molecular
dynamics run or structural relaxation
&CELL input variables that control cell-shape evolution in a
variable-cell MD run or structural relaxation
07/07/2015
35
Input Cards
ATOMIC_SPECIES name, mass and pseudopotential used for
each atomic species present in the system
ATOMIC_POSITIONS type and coordinate of each atom in the
unit cell
K_POINTS coordinate and weights of the k-points used for BZ
integration
CELL_PARAMETERS …
OCCUPATIONS …
CLINBING_IMAGES …
07/07/2015
36
Silicon Band Structure
(www.cineca.it/~acv0/Public/PWSCF_Tutorial.tgz)
•Select the appropriate unit cell
•Input the atomic coordinate
•Choose the pseudopotentials
•Determine k-point sampling
•Select the size of the basis set (Ecut)
07/07/2015
37
Select the appropriate unit cell
ibrav
ibrav
bravais lattice
celldm(.)
cell parameters
celldm(1)
celldm(2)
celldm(3)
celldm(4)
celldm(5)
celldm(6)
=
=
=
=
=
=
a,
b/a,
c/a
cos(bc)
cos(ac)
cos(ab)
0
1
2
3
4
5
6
7
8
9
10
celldm(2)-celldm(6)
"free", see above
cubic P (sc)
cubic F (fcc)
cubic I (bcc)
Hexagonal and Trigonal P
Trigonal R
Tetragonal P (st)
Tetragonal I (bct)
Orthorhombic P
not used
not used
not used
not used
celldm(3)=c/a
celldm(4)=cos(aalpha)
celldm(3)=c/a
celldm(3)=c/a
celldm(2)=b/a,
celldm(3)=c/a
Orthorhombic base-centered(bco) celldm(2)=b/a,
celldm(3)=c/a
Orthorhombic face-centered
celldm(2)=b/a,
celldm(3)=c/a
11
Orthorhombic body-centered
celldm(2)=b/a,
celldm(3)=c/a
12
Monoclinic P
13
Monoclinic base-centered
celldm(2)=b/a,
celldm(3)=c/a,
celldm(4)=cos(ab)
celldm(2)=b/a
celldm(3)=c/a,
celldm(4)=cos(ab)
celldm(2)= b/a,
celldm(3)= c/a,
celldm(4)= cos(bc),
celldm(5)= cos(ac),
celldm(6)= cos(ab)
14
07/07/2015
structure
Triclinic P
38
Unit cell
ibrav = 2, cubic fcc
07/07/2015
ibrav = 1, simple cubic
39
Unit cell (supercells)
ibrav = 1, simple cubic
(crystal with defects)
07/07/2015
ibrav = 6, tetragonal
(surfaces)
40
Silicon Crystal unit cell
&control
prefix='silicon',
pseudo_dir = '$PSEUDO_DIR/',
outdir='$TMP_DIR/'
/
&system
ibrav= 2, celldm(1) =10.20, nat=
ecutwfc =12.0,
/
&electrons
/
2, ntyp= 1,
empty namelist, keep default values
for Self-Consistent Field iterations
07/07/2015
41
Atomic Positions
ATOMIC_POSITION (units)
units: if units is not specified, unit
is assumed
units = bohr
position in
units = angstrom
position in
units = crystal
position in
07/07/2015
of “celldm(1)”
Bohr radius
Angstrom
crystal coord.
ATOMIC_SPECIES
Si 28.086 Si.vbc.UPF
ATOMIC_POSITIONS
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
42
K-points set
Automatic
K_POINTS (automatic)
2 2 2
1 1 1
k-points grid
User specified
grid off-set
K_POINTS
2
0.25 0.25 0.75 3.0
0.25 0.25 0.25 1.0
number of k-points
k-points weight
k-points coordinate
(crystal coord.)
start with coarse grid, then try finer ones to check convergence
07/07/2015
43
Input for Silicon Crystal SCF calculation
07/07/2015
&control
prefix='silicon',
pseudo_dir = '$PSEUDO_DIR/',
outdir='$TMP_DIR/'
/
&system
ibrav= 2, celldm(1) =10.20, nat= 2, ntyp= 1,
ecutwfc =12.0,
/
&electrons
/
ATOMIC_SPECIES
Si 28.086 Si.vbc.UPF
ATOMIC_POSITIONS
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS
2
pw.x < inputfile
0.25 0.25 0.75 3.0
0.25 0.25 0.25 1.0
44
Non SCF calculation
To compute band structure, we need the value of
eigenvectors on all k-point of the bands.
If the computation is converged with respect to
the k-points grid, we do not need to repeat the
SCF calculation on all k-points of the bands, but
we can diagonalize the Hamiltonian using the SCF
Kohn-Sham potential.
07/07/2015
45
Input for Non SCF calculation
07/07/2015
&control
calculation='nscf'
pseudo_dir = '$PSEUDO_DIR/',
outdir='$TMP_DIR/',
prefix='silicon'
/
&system
ibrav= 2, celldm(1) =10.20, nat=
ecutwfc =12.0, nbnd = 8,
/
&electrons
/
ATOMIC_SPECIES
Si 28.086 Si.vbc.UPF
ATOMIC_POSITIONS
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS
…
2, ntyp= 1,
46
K-points set along high
symmetry lines
# band structure calculation along delta, sigma and lambda lines
K_POINTS
36
0.5 0.5
0.4 0.4
0.3 0.3
0.2 0.2
0.1 0.1
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
0.0 0.0
07/07/2015
0.5 1
0.4 2
0.3 3
0.2 4
0.1 5
0.0 6
0.1 7
0.2 8
0.3 9
0.4 10
0.5 11
0.6 12
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.7
0.8
0.9
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
13
14
15
16
17
18
19
20
21
22
23
24
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.0
0.9
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0
1.0
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0
25
26
27
28
29
30
31
32
33
34
35
36
47
Post Processing
&inputpp
prefix = 'silicon'
outdir = '$TMP_DIR/'
filband = 'sibands.dat'
/
bands.x < inputfile
prints the bands to graphical files
sibands.dat
-6.0 10
sibands.xmgr
sibands.ps
6.3369
1.0 6.3369
07/07/2015
plotband.x < inputfile
48
the silicon bands!
07/07/2015
49
How to find equilibrium lattice parameters
different
scf computation,
changing cut-off
and lattice
parameter
07/07/2015
50
Plot Charge Density
# post-processing for charge density
cat > si.pp_rho.in << EOF
&inputpp
prefix = 'silicon'
outdir = '$TMP_DIR/'
filplot = 'sicharge'
plot_num= 0
/
EOF
./pp.x < si.pp_rho.in > si.pp_rho.out
1)
2)
# chdens
cat > si.chdens.in << EOF
&input
nfile = 1
filepp(1) = 'sicharge'
weight(1) = 1.0
iflag = 2
plot_out = 1
output_format = 2
fileout = 'si.rho.dat'
e1(1) =1.0, e1(2)=1.0, e1(3) = 0.0,
e2(1) =0.0, e2(2)=0.0, e2(3) = 1.0,
nx=56, ny=40
/
EOF
./chdens.x < si.chdens.in > si.chdens.out
3)
07/07/2015
cat > si.plotrho.in << EOF
si.rho.dat
si.rho.ps
n
0 0.09 6
EOF
./plotrho.x < si.plotrho.in > si.plotrho.out
51
Charge Density
07/07/2015
52
MD - Molecular Dynamics
Initial configuration
accumulate statistics
(RDF, Energies, MSD, ecc..)
Stop
calculate forces
update atomic positions
07/07/2015
53
DFT - Solution of the KS equation.
trial n(r)
build VKS
solve
[-1/22+VKS]i = ii
nold = nnew
calculate nnew(r) = ∑fi|i|2
no
07/07/2015
|nnew-nold|<nthr
?
yes
groud state
54
AIMD ab-Initio Molecular Dynamics
Born-Oppenheimer MD
Initial configuration
accumulate statistics
Stop
Solve the DFTproblem Egs[{RI}]
calculate forces FI=∂Egs[{RI}] /∂RI
update atomic positions
07/07/2015
55
CPMD Car-Parrinello Molecular Dynamics
Initial configuration
Solve the DFTproblem Egs[{RI}, {i}]
accumulate statistics
Stop
ionic forces FI = - ∂Etot[{RI}] / ∂RI
electronic forces F i = - ∂Etot[{RI}, {i}] / ∂i*
update atomic positions RI
update wave functions i
07/07/2015
56
Car-Parrinello Lagrangian
(deformable cell extension)
occ
L     dr  i r  
2
i
1
2



 t GS  E , hS 
M
S
 I I I
i
I
I

   ij  dr *i r  j r    ij  W Trh t h   p
ij
1
2
Density Functionl Energy
E i , hSI   EG  (G), hSI   Er  (r ), hSI 
Diagonal in Fourier space
07/07/2015
Diagonal in Real space
Computationally it is convenient to calculate quantities
in the space where they are diagonal
57
Equations of motion
Electrons treated as classical scalar fields, follow
adiabatically the ions remaining close to the ground state.
i s   
E
 s *i

   s
ij
j
j
Ions in scaled coordinates, move along the Born
Oppenheimer surface
S   1 E h t 1  G 1 G S 
I
  I

M I SI
Cell shape is driven by the imbalance of internal
stress  and external pressure p.
07/07/2015
h  1   p h t 1




W
58
CINECA/Democritos CP Code
FORM
NLRH
RHOOFR
VOFRHO
07/07/2015
PRESS
Pseudopotential Form factors
(r) =  |(r)|2
V(R, ) = V DFT(R, (r)) + V
r
G
DFT(R,
FORCE
Forces on the electrons: F
ORTHO
Orthogonalize wave functions: 
(G))
59
A CP simulation require usually many RUNs and JOBs
1.
2.
3.
4.
5.
Minimize the Electronic degrees of freedom ( d.o.f. )
Minimize the ionic d.o.f.
Randomize ionic d.o.f.
Re-minimize Electronic d.o.f
Move Electronic and Ionic d.o.f. using Verlet to
integrate the equations of motion
6. Change temperature using thermostat
7. Accumulate statistics for few picoseconds of
simulated time ( 20000 – 40000 time steps )
www.cineca.it/~acv0/Public/tutorial_fpmd.tar.gz
07/07/2015
60
Electronic Minimization I/II
CP time step (in a.u.)
convergence threshold,
effective only for minimization
&CONTROL
title = ' Water Molecule ',
calculation = 'cp',
restart_mode = 'from_scratch',
prefix = 'h2o_mol‘
nstep = 50,
dt
= 5.0d0,
etot_conv_thr = 1.d-9,
ekin_conv_thr = 1.d-4,
/
&SYSTEM
ibrav = 1,
celldm(1) = 10.0,
nat = 3, ntyp = 2,
nbnd = 4, nelec = 8,
ecutwfc = 70.0,
xc_type = 'BLYP'
number of bands, and
electrons
Energy cut-off,
in Rydberg
number of CP step
Simulation Cell (in a.u.)
number of atom,
and species
/
Exchange and correlation
functional
07/07/2015
61
Electronic Minimization II/II
Fictitious electron mass (a.u.)
 parameter in CP dynamic
PW Energy cut-off (in Rydberg)
for Fourier Acceleration
&ELECTRONS
emass = 400.d0,
emass_cutoff = 2.5d0,
orthogonalization = 'ortho',
electron_dynamics = 'sd',
/
orthogonalization
algorithm
‘ortho’ or 'Gram-Schmidt'
&IONS
electron dynamics
sd -> steepest descend
cg -> conjugate gradient
damp -> damped
verlet -> Verlet
ion_dynamics = 'none',
/
Label
Mass (uma) PP
Label
07/07/2015
x y z
ATOMIC_SPECIES
O 16.0d0 O.BLYP.UPF 4
H 1.00d0 H.fpmd.UPF 4
ATOMIC_POSITIONS (bohr)
O
0.0099
0.0099
H
1.8325
-0.2243
H
-0.2243
1.8325
0.0000
-0.0001
0.0002
ion dynamics
none -> kept fixed
sd -> steepest descend
cg -> conjugate gradient
damp -> damped
verlet -> Verlet
62
CP – Dynamics I/II
&CONTROL
title = ' Water Molecule ',
calculation = 'cp',
restart_mode = ‘restart',
nstep = 50,
dt
= 5.0d0,
prefix = 'h2o_mol'
/
verlet should be used
for ions and electrons
07/07/2015
ion_dynamics = ‘verlet',
ion_velocities = ‘zero’
/
&SYSTEM
ibrav = 1,
celldm(1) = 10.0,
nat = 3, ntyp = 2,
nbnd = 4, nelec = 8,
ecutwfc = 70.0,
xc_type = 'BLYP'
/
&ELECTRONS
emass = 400.d0,
emass_cutoff = 2.5d0,
orthogonalization = 'ortho',
electron_dynamics = ‘verlet',
electron_velocities = ‘zero’
/
&IONS
ATOMIC_SPECIES
O 16.0d0 O.BLYP.UPF 4
H 1.00d0 H.fpmd.UPF 4
ATOMIC_POSITIONS (bohr)
O
0.0099
0.0099
H
1.8325
-0.2243
H
-0.2243
1.8325
0.0000
-0.0001
0.0002
in the very first run of
dynamics velocities
should be set to zero
63
CP – Dynamics II/II ( thermostat )
&CONTROL
title = ' Water Molecule ',
calculation = 'cp',
restart_mode = ‘restart',
nstep = 50,
dt
= 5.0d0,
prefix = 'h2o_mol'
/
&SYSTEM
ibrav = 1,
celldm(1) = 10.0,
nat = 3, ntyp = 2,
nbnd = 4, nelec = 8,
ecutwfc = 70.0,
xc_type = 'BLYP'
/
&ELECTRONS
emass = 400.d0,
emass_cutoff = 2.5d0,
orthogonalization = 'ortho',
electron_dynamics = ‘verlet',
/
07/07/2015
Termostat temperature and frequency
tempw ( Kelvin )
fnosep ( THz )
&IONS
ion_dynamics = ‘verlet',
ion_temperature = ‘nose’
tempw = 300,
fnosep = 70.0
/
ATOMIC_SPECIES
O 16.0d0 O.BLYP.UPF 4
H 1.00d0 H.fpmd.UPF 4
ATOMIC_POSITIONS (bohr)
O
0.0099
0.0099
H
1.8325
-0.2243
H
-0.2243
1.8325
0.0000
-0.0001
0.0002
64
Parrinello-Rahman Dynamics
&CONTROL
title = ' Water Molecule ',
calculation = ‘vc-cp',
restart_mode = ‘restart',
nstep = 50,
dt
= 5.0d0,
prefix = 'h2o_mol'
/
&SYSTEM
ibrav = 1,
celldm(1) = 10.0,
nat = 3, ntyp = 2,
nbnd = 4, nelec = 8,
ecutwfc = 70.0,
xc_type = 'BLYP'
/
&ELECTRONS
emass = 400.d0,
emass_cutoff = 2.5d0,
orthogonalization = 'ortho',
electron_dynamics = ‘verlet',
/
07/07/2015
change the calculation
type (variable cell cp)
&IONS
ion_dynamics = ‘verlet',
Add the CELL namelists,
with cell dynamics:
pr -> parrinello rahman
sd -> steepest descent
damp -> damped
/
&CELL
cell_dynamics = ‘pr’,
press = 0.0
/
ATOMIC_SPECIES
O 16.0d0 O.BLYP.UPF 4
H 1.00d0 H.fpmd.UPF 4
external
pressure
(Kbar)
ATOMIC_POSITIONS (bohr)
O
0.0099
0.0099
H
1.8325
-0.2243
H
-0.2243
1.8325
0.0000
-0.0001
0.0002
65
high pressure – high temperature
water phase diagram
07/07/2015
C.Cavazzoni, G.L. Chiarotti, S.Scandolo, E.Tosatti, M.Bernasconi, and M. Parrinello
“Superprotonic and metallic states of water and ammonia at giant planet conditions”,
Science.283, 44 (1999).
66
ionic trajectory at finite temperature
07/07/2015
H trajectories in the superionic phase
67
Run on SP4 - Water128
90
80
speedup
70
60
50
40
30
20
10
64
procs
07/07/2015
32
16
8
4
2
1
P
O O
LO TH
R
O RC E
FO ESS
O
PR RH
F
R
VO OF
O
RH H
R
NL
RM
FO
0
128
68
Run on SP4 - Water32
70
60
40
30
speedup
50
20
10
0
64
32
16
8
procs
PR
ES
S
4
2
1
07/07/2015
FO
RM
NL
RH
RH
OO
FR
FO
RC
E
OR
TH
O
LO
OP
VO
FR
HO
69