## Friday, April 17, 2015

### Get the max CPU performance for scientific computing : Intel Xeon height cores and more ("Haswell-EP")

Haswell is the codename for the Intel processor microarchitecture that is the successor to the Ivy Bridge microarchitecture. Most Haswell products are branded as 4th Generation Intel® Core™ Processors for client systems, and Intel® Xeon® v3 Processors for server systems.
Intel officially announced processors with this microarchitecture in 2013.

List:
http://ark.intel.com/products/codename/42174/Haswell#@All

Example: 8cores
http://ark.intel.com/products/82766
http://ark.intel.com/products/82767

Datasheet
http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v3-datasheet-vol-1.html

One of the best choice Price/power:
Intel® Xeon® Processor E5-1660 v3  (3.00 GHz)
L2 cache=8 × 256 KB
L3 cache=20 MB

Electrical Specifications
C-states (W= Watt):
Model Number TDP                  C1E (W) 2 C3 (W) 2 C6 (W)
E5-1660 v3       140W 8-Core   34               25            12

Idle States (C-states) are used to save power when the processor is idle. C0 is the operational state, meaning that the CPU is doing useful work. C1 is the first idle state, C2 the second, and so on, where more power saving actions are taken for numerically higher C-states.

 # of Cores 8 # of Threads 16 Processor Base Frequency 3 GHz Max Turbo Frequency 3.5 GHz TDP 140 W
 TCASE 65.9°C
Case Temperature is the maximum temperature allowed at the processor Integrated Heat Spreader (IHS).

First to get the max CPU performance, it is necessary to

1. manage the Power Management States. https://software.intel.com/en-us/articles/power-management-states-p-states-c-states-and-package-c-states,. control C-state power. When the Temperature increases, above 70°C the performance must decrease!
2. always work at turbo Frequency (no switch) then it is very important to control the Temperature of CPU (and also of DDR RAM). For the E5-1660 v3, it's 3.5GHz. Typically the CPU temperature is around 55-60°C (benchmark with LAMMPS dynamics of 800 000atoms/5000timesteps).  T must be below 65°C.

 Intel® Turbo Boost Technology ‡ 2.0 Intel® vPro Technology ‡ Yes Intel® Hyper-Threading Technology ‡ Yes Intel® Virtualization Technology (VT-x) ‡ Yes Intel® Virtualization Technology for Directed I/O (VT-d) ‡ Yes Intel® VT-x with Extended Page Tables (EPT) ‡ Yes Intel® TSX-NI No Intel® 64 ‡ Yes Idle States Yes Enhanced Intel SpeedStep® Technology Yes Intel® Demand Based Switching Yes Thermal Monitoring Technologies Yes Intel® Flex Memory Access No Intel® Identity Protection Technology ‡ Yes

Intel® Turbo Boost Technology dynamically increases the processor's frequency as needed by taking advantage of thermal and power headroom to give you a burst of speed when you need it, and increased energy efficiency when you don’t. But the problem is the "switch" between electrical/thermal systems and performance.

Intel® Hyper-Threading Technology (Intel® HT Technology) delivers two processing threads per physical core. Highly threaded applications can get more work done in parallel, completing tasks sooner.
THE HYPER-THREADING must be disabled in the domain of scientific computation (like LAMMPS): only one thread/core.

Intel® Demand Based Switching is a power-management technology in which the applied voltage and clock speed of a microprocessor are kept at the minimum necessary levels until more processing power is required. This technology was introduced as Intel SpeedStep® Technology in the server marketplace.

Thermal Monitoring Technologies protect the processor package and the system from thermal failure through several thermal management features. An on-die Digital Thermal Sensor (DTS) detects the core's temperature, and the thermal management features reduce package power consumption and thereby temperature when required in order to remain within normal operating limits

## Thursday, April 16, 2015

### pair potential style and LAMMPS (pairwise interactions and many-body effects)

In a script we have:
#potential

pair_style eam
pair_coeff * * Au_u3.eam

The command "pair_style" is very important.

Set the formula(s) LAMMPS uses to compute pairwise interactions. In LAMMPS, pair potentials are defined between pairs of atoms that are within a cutoff distance and the set of active interactions typically changes over time. See the bond_style command to define potentials between pairs of bonded atoms, which typically remain in place for the duration of a simulation.

In LAMMPS, pairwise force fields encompass a variety of interactions, some of which include many-body effects, e.g. EAM, Stillinger-Weber, Tersoff, REBO potentials. They are still classified as "pairwise" potentials because the set of interacting atoms changes with time (unlike molecular bonds) and thus a neighbor list is used to find nearby interacting atoms.

In the formulas listed for each pair style, E is the energy of a pairwise interaction between two atoms separated by a distance r. The force between the atoms is the negative derivative of this expression:

-∂E/∂r is a force

If the pair_style command has a cutoff argument, it sets global cutoffs for all pairs of atom types.

There are also additional accelerated pair styles (not listed on the pair_style doc page) included in the LAMMPS distribution for faster performance on CPUs and GPUs. The list of these with links to the individual styles are given in the pair section of this page.

The list of pair_style (LAMMPS 2015 january):

• pair_style none - turn off pairwise interactions
• pair_style hybrid - multiple styles of pairwise interactions
• pair_style hybrid/overlay - multiple styles of superposed pairwise interactions
• pair_style airebo - AIREBO potential of Stuart
• pair_style beck - Beck potential
• pair_style body - interactions between body particles
• pair_style bop - BOP potential of Pettifor
• pair_style born - Born-Mayer-Huggins potential
• pair_style born/coul/long - Born-Mayer-Huggins with long-range Coulombics
• pair_style born/coul/msm - Born-Mayer-Huggins with long-range MSM Coulombics
• pair_style born/coul/wolf - Born-Mayer-Huggins with Coulombics via Wolf potential
• pair_style brownian - Brownian potential for Fast Lubrication Dynamics
• pair_style brownian/poly - Brownian potential for Fast Lubrication Dynamics with polydispersity
• pair_style buck - Buckingham potential
• pair_style buck/coul/cut - Buckingham with cutoff Coulomb
• pair_style buck/coul/long - Buckingham with long-range Coulombics
• pair_style buck/coul/msm - Buckingham long-range MSM Coulombics
• pair_style buck/long/coul/long - long-range Buckingham with long-range Coulombics
• pair_style colloid - integrated colloidal potential
• pair_style comb - charge-optimized many-body (COMB) potential
• pair_style comb3 - charge-optimized many-body (COMB3) potential
• pair_style coul/cut - cutoff Coulombic potential
• pair_style coul/debye - cutoff Coulombic potential with Debye screening
• pair_style coul/dsf - Coulombics via damped shifted forces
• pair_style coul/long - long-range Coulombic potential
• pair_style coul/msm - long-range MSM Coulombics
• pair_style coul/wolf - Coulombics via Wolf potential
• pair_style dpd - dissipative particle dynamics (DPD)
• pair_style dpd/tstat - DPD thermostatting
• pair_style dsmc - Direct Simulation Monte Carlo (DSMC)
• pair_style eam - embedded atom method (EAM)
• pair_style eam/alloy - alloy EAM
• pair_style eam/fs - Finnis-Sinclair EAM
• pair_style eim - embedded ion method (EIM)
• pair_style gauss - Gaussian potential
• pair_style gayberne - Gay-Berne ellipsoidal potential
• pair_style gran/hertz/history - granular potential with Hertzian interactions
• pair_style gran/hooke - granular potential with history effects
• pair_style gran/hooke/history - granular potential without history effects
• pair_style hbond/dreiding/lj - DREIDING hydrogen bonding LJ potential
• pair_style hbond/dreiding/morse - DREIDING hydrogen bonding Morse potential
• pair_style kim - interface to potentials provided by KIM project
• pair_style lcbop - long-range bond-order potential (LCBOP)
• pair_style line/lj - LJ potential between line segments
• pair_style lj/charmm/coul/charmm - CHARMM potential with cutoff Coulomb
• pair_style lj/charmm/coul/charmm/implicit - CHARMM for implicit solvent
• pair_style lj/charmm/coul/long - CHARMM with long-range Coulomb
• pair_style lj/charmm/coul/msm - CHARMM with long-range MSM Coulombics
• pair_style lj/class2 - COMPASS (class 2) force field with no Coulomb
• pair_style lj/class2/coul/cut - COMPASS with cutoff Coulomb
• pair_style lj/class2/coul/long - COMPASS with long-range Coulomb
• pair_style lj/cut - cutoff Lennard-Jones potential with no Coulomb
• pair_style lj/cut/coul/cut - LJ with cutoff Coulomb
• pair_style lj/cut/coul/debye - LJ with Debye screening added to Coulomb
• pair_style lj/cut/coul/dsf - LJ with Coulombics via damped shifted forces
• pair_style lj/cut/coul/long - LJ with long-range Coulombics
• pair_style lj/cut/coul/msm - LJ with long-range MSM Coulombics
• pair_style dipole/cut - point dipoles with cutoff
• pair_style dipole/long - point dipoles with long-range Ewald
• pair_style lj/cut/tip4p/cut - LJ with cutoff Coulomb for TIP4P water
• pair_style lj/cut/tip4p/long - LJ with long-range Coulomb for TIP4P water
• pair_style lj/expand - Lennard-Jones for variable size particles
• pair_style lj/gromacs - GROMACS-style Lennard-Jones potential
• pair_style lj/gromacs/coul/gromacs - GROMACS-style LJ and Coulombic potential
• pair_style lj/long/coul/long - long-range LJ and long-range Coulombics
• pair_style lj/long/dipole/long - long-range LJ and long-range point dipoles
• pair_style lj/long/tip4p/long - long-range LJ and long-range Coulomb for TIP4P water
• pair_style lj/smooth - smoothed Lennard-Jones potential
• pair_style lj/smooth/linear - linear smoothed Lennard-Jones potential
• pair_style lj96/cut - Lennard-Jones 9/6 potential
• pair_style lubricate - hydrodynamic lubrication forces
• pair_style lubricate/poly - hydrodynamic lubrication forces with polydispersity
• pair_style lubricateU - hydrodynamic lubrication forces for Fast Lubrication Dynamics
• pair_style lubricateU/poly - hydrodynamic lubrication forces for Fast Lubrication
with polydispersity
• pair_style meam - modified embedded atom method (MEAM)
• pair_style mie/cut - Mie potential
• pair_style morse - Morse potential
• pair_style nb3b/harmonic - nonbonded 3-body harmonic potential
• pair_style nm/cut - N-M potential
• pair_style nm/cut/coul/cut - N-M potential with cutoff Coulomb
• pair_style nm/cut/coul/long - N-M potential with long-range Coulombics
• pair_style peri/eps - peridynamic EPS potential
• pair_style peri/lps - peridynamic LPS potential
• pair_style peri/pmb - peridynamic PMB potential
• pair_style peri/ves - peridynamic VES potential
• pair_style reax - ReaxFF potential
• pair_style rebo - 2nd generation REBO potential of Brenner
• pair_style resquared - Everaers RE-Squared ellipsoidal potential
• pair_style snap - SNAP quantum-accurate potential • pair_style soft - Soft (cosine) potential
• pair_style sw - Stillinger-Weber 3-body potential
• pair_style table - tabulated pair potential
• pair_style tersoff - Tersoff 3-body potential
• pair_style tersoff/mod - modified Tersoff 3-body potential
• pair_style tersoff/zbl - Tersoff/ZBL 3-body potential
• pair_style tip4p/cut - Coulomb for TIP4P water w/out LJ
• pair_style tip4p/long - long-range Coulombics for TIP4P water w/out LJ
• pair_style tri/lj - LJ potential between triangles
• pair_style yukawa - Yukawa potential
• pair_style yukawa/colloid - screened Yukawa potential for finite-size particles
• pair_style zbl - Ziegler-Biersack-Littmark potential

### potential files, directories and LAMMPS

In a script we have:
#potential

pair_style eam
pair_coeff * * Au_u3.eam

The command "pair_coeff"
When a pair_coeff command using a potential file is specified, LAMMPS looks for the potential file in 2 places.

• First it looks in the location specified. E.g. if the file is specified as "Au_u3.eam", it is looked for in the current working directory.
• If it is specified as "../potentials/niu3.eam", then it is looked for in the potentials directory, assuming it is a sister directory of the current working directory.
• If the file is not found, it is then looked for in the directory specified by the LAMMPS_POTENTIALS environment variable.
• Thus if this is set to the potentials directory in the LAMMPS distro, then you can use those files from anywhere on your system, without copying them into your working directory. Environment variables are set in different ways for different shells. Here are example settings for

csh, tcsh:
% setenv LAMMPS_POTENTIALS /path/to/lammps/potentials
bash:
% export LAMMPS_POTENTIALS=/path/to/lammps/potentials
Windows:
% set LAMMPS_POTENTIALS="C:\Path to LAMMPS\Potentials

-------------------------------
Styles with a cuda, gpu, intel, kk, omp, or opt suffix are functionally the same as the corresponding style without the suffix. They have been optimized to run faster, depending on your available hardware. The accelerated styles take the same arguments and should produce the same results, except for round-off and precision issues.
These accelerated styles are part of the USER-CUDA, GPU, USER-INTEL, KOKKOS, USER-OMP and OPT packages, respectively. They are only enabled if LAMMPS was built with those packages.
You can specify the accelerated styles explicitly in your input script by including their suffix, or you can use the -suffix command-line switch when you invoke LAMMPS, or you can use the suffix command in your input script.
-------------------------------
As an example, imagine a file SiC.sw has Stillinger-Weber values for Si and C. If your LAMMPS simulation has 4 atoms types and you want the 1st 3 to be Si, and the 4th to be C, you would use the following pair_coeff command:

pair_coeff * * SiC.sw Si Si Si C

The 1st 2 arguments must be * * so as to span all LAMMPS atom types.
The first three Si arguments map LAMMPS atom types 1,2,3 to the Si element in the SW file. The final C argument maps LAMMPS atom type 4 to the C element in the SW file. If a mapping value is specified as NULL, the mapping is not performed. This can be used when a sw potential is used as part of the hybrid pair style. The NULL values are placeholders for atom types that will be used with other potentials.
Stillinger-Weber files in the potentials directory of the LAMMPS distribution have a ".sw" suffix. Lines that are not blank or comments (starting with #) define parameters for a triplet of elements. The parameters in a single entry correspond to the two-body and three-body coefficients in the formula above:
• element 1 (the center atom in a 3-body interaction)
• element 2
• element 3
• epsilon (energy units)
• sigma (distance units)
•a
• lambda
• gamma
• costheta0
•A
•B
•p
•q
• tol
The A, B, p, and q parameters are used only for two-body interactions. The lambda and costheta0 parameters are used only for three-body interactions. The epsilon, sigma and a parameters are used for both two-body and three-body interactions. gamma is used only in the three-body interactions, but is defined for pairs of atoms. The non-annotated parameters are unitless.
LAMMPS introduces an additional performance-optimization parameter tol that is used for both two-body and three-body interactions. In the Stillinger-Weber potential, the interaction energies become negligibly small at atomic separations substantially less than the theoretical cutoff distances. LAMMPS therefore defines a virtual cutoff distance based on a user defined tolerance tol. The use of the virtual cutoff distance in constructing atom neighbor lists can significantly reduce the neighbor list sizes and therefore the computational cost. LAMMPS provides a tol value for each of the three-body entries so that they can be separately controlled. If tol = 0.0, then the standard Stillinger-Weber cutoff is used.
The Stillinger-Weber potential file must contain entries for all the elements listed in the pair_coeff command. It can also contain entries for additional elements not being used in a particular simulation; LAMMPS ignores those entries.
For a single-element simulation, only a single entry is required (e.g. SiSiSi). For a two-element simulation, the file must contain 8 entries (for SiSiSi, SiSiC, SiCSi, SiCC, CSiSi, CSiC, CCSi, CCC), that specify SW parameters for all permutations of the two elements interacting in three-body configurations. Thus for 3 elements, 27 entries would be required, etc.
As annotated above, the first element in the entry is the center atom in a three-body interaction. Thus an entry for SiCC means a Si atom with 2 C atoms as neighbors. The parameter values used for the two-body interaction come from the entry where the 2nd and 3rd elements are the same. Thus the two-body parameters for Si interacting with C, comes from the SiCC entry. The three-body parameters can in principle be specific to the three elements of the configuration. In the literature, however, the three-body parameters are usually defined by simple formulas involving two sets of pair-wise parameters, corresponding to the ij and ik pairs, where i is the center atom. The user must ensure that the correct combining rule is used to calculate the values of the threebody parameters for alloys. Note also that the function phi3 contains two exponential screening factors with parameter values from the ij pair and ik pairs. So phi3 for a C atom bonded to a Si atom and a second C atom will depend on the three-body parameters for the CSiC entry, and also on the two-body parameters for the CCC and CSiSi entries. Since the order of the two neighbors is arbitrary, the threebody parameters for entries CSiC and CCSi should be the same. Similarly, the two-body parameters for entries SiCC and CSiSi should also be the same. The parameters used only for two-body interactions (A, B, p, and q) in entries whose 2nd and 3rd element are different (e.g. SiCSi) are not used for anything and can be set to 0.0 if desired. This is also true for the parameters in phi3 that are taken from the ij and ik pairs (sigma, a, gamma)

# Gold (Au)

In the standard package of LAMMPS, the potential of Au is (Foiles,1986; S.M. Foiles, M.I. Baskes, and M.S. Daw, Phys. Rev. B 33, 7983, 1986).

Hoyt,2002 (Atomistic computation of liquid diffusivity, solid-liquid interfacial free
energy and kinetic coefficient in Au and Ag, J. J. Hoyt, M.Asta, Phys

Rev B, 65, 214106 (2002) http://journals.aps.org/prb/abstract/10.1103/PhysRevB.65.214106)
In recent MD studies of the solid-liquid interfacial free energy in Ni the sensitivity of the calculated values of gamma (g) to the details of the EAM potential were investigated. It was concluded that the calculated value of g depends on the accuracy of the melting point predicted by the interatomic potential
and the value of the anisotropy varied somewhat depending on the specific choice of the EAM potential. Those potentials which more accurately reproduced the elastic properties of the crystal yielded anisotropies in close agreement.
In the present work the embedded atom potentials formulated
by (Voter and Chen, 1978; A.F. Voter and S.P. Chen, in Characterization of Defects in Materials,
edited by R. W. Siegel and R. Sinclair, MRS Symposia Proceedings No. 82; Materials Research Society, Pittsburgh, 1978, p. 175. ) have been employed throughout. The Voter-Chen potentials are superior to the
earlier versions due to Foiles, Baskes, and Daw (S.M. Foiles, M.I. Baskes, and M.S. Daw, Phys. Rev. B 33, 7983, 1986)  in terms of the predicted elastic properties of the solid phase. The melting point of Au for the VC potential is closer to experiment than the FBD version whereas the melting point for Ag is slightly worse.
...
The melting point for the EAM potentials can be found by monitoring the solid-liquid interface velocity vs temperature and extrapolating to the temperature corresponding to zero motion. With this procedure we find the melting point for Ag to be 1115 K and 1120 K for Au. These values are below the actual measured melting points of 1234 K and 1338 K for Ag and Au, respectively, but the agreement with experiment is
reasonable given that no properties of the liquid were utilized in the potential fit procedure. For comparison, the melting points for the Foiles, Baskes, and Daw EAM potentials are 1170 for Ag and 1090 for Au.

---------

G. Grochola, S.P. Russo, and I.K. Snook, "On fitting a gold embedded atom method potential using the force matching method," J. Chem. Phys., 123, 204719 (2005). DOI: 10.1063/1.2124667.

Notes: This file was generated by C.A. Becker from the files below that were approved by G. Grochola (RMIT University) and posted with his permission on 21 Feb. 2011. This version is compatible with LAMMPS. Validation and usage information can be found in Au-Grochola-JCP05-conversion-notes_v2.pdf. If you use this eam.alloy file, please credit the website in addition to the original reference.

Format: EAM/alloy setfl
File(s): Au-Grochola-JCP05.eam.alloy

Notes: These files were approved by G. Grochola.

Format: EAM table
File(s):
F(ρ): Au-Grochola-JCP05-F.table
ρ(r): Au-Grochola-JCP05-rou.table
φ(r): Au-Grochola-JCP05-Phi.table

X.W. Zhou, R.A. Johnson, and H.N.G. Wadley, "Misfit-energy-increasing dislocations in vapor-deposited CoFe/NiFe multilayers," Phys. Rev. B,69, 144113 (2004). DOI: 10.1103/PhysRevB.69.144113.

Notes: This file was generated by C.A. Becker from the files sent by X.W. Zhou (Sandia National Laboratory) and posted with his permission. These files can be used to generate alloy potentials for Cu, Ag, Au, Ni, Pd, Pt, Al, Pb, Fe, Mo, Ta, W, Mg, Co, Ti, and Zr by editing EAM.input. However, as addressed in the reference, these potentials were not designed for use with metal compounds. See the Zhou04 page for more information.

Format: EAM/alloy setfl
File(s): Au.set

J.B. Adams, S.M. Foiles, and W.G. Wolfer, "Self-diffusion and impurity diffusion of FCC metals using the 5-frequency model and the Embedded Atom Method," J. Mater. Res. 4, 102-112 (1989).

Notes: auu6.txt was obtained from http://enpub.fulton.asu.edu/cms/ potentials/main/main.htm and posted with the permission of J.B. Adams. The name of the file was retained, even though the header information lists the potential as 'universal 4.' This file is compatible with the "pair_style eam" format in LAMMPS (19Feb09 version).

Format: EAM
File(s): auu6.txt

G.J. Ackland, G.I. Tichy, V. Vitek, and M.W. Finnis, "Simple N-body potentials for the noble-metals and nickel," Phil. Mag. A 56, 735-756 (1987).

Notes: The parameters in au.moldy were obtained from http://homepages.ed.ac.uk/graeme/moldy/moldy.html and posted with the permission of G.J. Ackland.

Format: Moldy FS
File(s): au.moldy

Notes: This conversion was performed from G.J. Ackland's parameters by M.I. Mendelev. Conversion checks from M.I. Mendelev can be found inconversion_check.pdf. These files were posted on 30 June 2009 with the permission of G.J. Ackland and M.I. Mendelev. These potentials are not designed for simulations of radiation damage.

Format: EAM/FS setfl
File(s): Au.eam.fs

Ref:
http://www.ctcms.nist.gov/~cbecker/Au.html