adding Pair::single() support to python pair style and examples

with the single function, python pair styles can be massively
sped up and made compatible to accelerators, as one can translate
the analytic force and energy functions through LAMMPS into suitable
tables and then simply use the on-the-fly tables for production runs
This commit is contained in:
Axel Kohlmeyer
2017-05-17 17:20:56 -04:00
parent 45becfb235
commit 43efe9e417
9 changed files with 9743 additions and 2 deletions

View File

@ -0,0 +1,99 @@
LAMMPS (4 May 2017)
using 1 OpenMP thread(s) per MPI task
# 3d Lennard-Jones melt
units lj
atom_style atomic
lattice fcc 0.8442
Lattice spacing in x,y,z = 1.6796 1.6796 1.6796
region box block 0 10 0 10 0 10
create_box 1 box
Created orthogonal box = (0 0 0) to (16.796 16.796 16.796)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 4000 atoms
mass * 1.0
velocity all create 3.0 87287
pair_style python 2.5
pair_coeff * * potentials.LJCutMelt lj
# generate tabulated potential from python variant
pair_write 1 1 10000 rsq 0.01 2.5 lj_1_1.table LJ
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 2.8
ghost atom cutoff = 2.8
binsize = 1.4, bins = 12 12 12
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
pair_style table linear 10000
pair_coeff 1 1 lj_1_1.table LJ
WARNING: 1 of 10000 force values in table are inconsistent with -dE/dr.
Should only be flagged at inflection points (../pair_table.cpp:476)
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
thermo 50
run 250
Neighbor list info ...
update every 20 steps, delay 0 steps, check no
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 2.8
ghost atom cutoff = 2.8
binsize = 1.4, bins = 12 12 12
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair table, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.69 | 2.69 | 2.69 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 -6.7733675 0 -2.2744925 -3.7033435
50 1.6754092 -4.794723 0 -2.2822376 5.6616601
100 1.6503295 -4.7559815 0 -2.2811061 5.8051261
150 1.6596603 -4.7699379 0 -2.2810699 5.7830168
200 1.6371948 -4.7365549 0 -2.2813766 5.9245585
250 1.6321199 -4.7288017 0 -2.2812339 5.9776124
Loop time of 0.313548 on 4 procs for 250 steps with 4000 atoms
Performance: 344444.576 tau/day, 797.325 timesteps/s
99.1% CPU use with 4 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.24963 | 0.25443 | 0.2632 | 1.1 | 81.15
Neigh | 0.023249 | 0.023735 | 0.024497 | 0.3 | 7.57
Comm | 0.020689 | 0.030402 | 0.035249 | 3.4 | 9.70
Output | 0.00020766 | 0.00021476 | 0.00023031 | 0.0 | 0.07
Modify | 0.0034959 | 0.0035564 | 0.0036762 | 0.1 | 1.13
Other | | 0.001206 | | | 0.38
Nlocal: 1000 ave 1010 max 982 min
Histogram: 1 0 0 0 0 0 1 0 0 2
Nghost: 2703.75 ave 2713 max 2689 min
Histogram: 1 0 0 0 0 0 0 2 0 1
Neighs: 37915.5 ave 39231 max 36202 min
Histogram: 1 0 0 0 0 1 1 0 0 1
Total # of neighbors = 151662
Ave neighs/atom = 37.9155
Neighbor list builds = 12
Dangerous builds not checked
shell rm lj_1_1.table
Total wall time: 0:00:00