a bunch refactoring changes in the python pair style and the examples

- make all python potential classes derived from LAMMPSPairPotential
  which contains shared functionality. We currently don't check
  for supported atom types. may want to add that again later.
- keep track of skipped atom types in the C++ code.
- add test against units setting. must set self.units='...' in constructor
- make compute_force method consistent with Pair::single() in LAMMPS and return force/r instead of force.
- rename potentials.py to py_pot.py
- update test runs. some small tweaks.
This commit is contained in:
Axel Kohlmeyer
2017-05-17 20:55:48 -04:00
parent 1d48f287f0
commit 67962b15fc
18 changed files with 521 additions and 316 deletions

View File

@ -1,5 +1,4 @@
LAMMPS (4 May 2017)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
using 1 OpenMP thread(s) per MPI task
# 3d Lennard-Jones melt
@ -19,7 +18,7 @@ mass * 1.0
velocity all create 3.0 87287
pair_style python 2.5
pair_coeff * * potentials.LJCutMelt lj
pair_coeff * * py_pot.LJCutMelt lj
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
@ -48,20 +47,20 @@ Step Temp E_pair E_mol TotEng Press
150 1.6324555 -4.7286791 0 -2.280608 5.9589514
200 1.6630725 -4.7750988 0 -2.2811136 5.7364886
250 1.6275257 -4.7224992 0 -2.281821 5.9567365
Loop time of 24.2466 on 1 procs for 250 steps with 4000 atoms
Loop time of 21.6481 on 1 procs for 250 steps with 4000 atoms
Performance: 4454.233 tau/day, 10.311 timesteps/s
59.9% CPU use with 1 MPI tasks x 1 OpenMP threads
Performance: 4988.899 tau/day, 11.548 timesteps/s
98.5% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 24.079 | 24.079 | 24.079 | 0.0 | 99.31
Neigh | 0.13174 | 0.13174 | 0.13174 | 0.0 | 0.54
Comm | 0.016789 | 0.016789 | 0.016789 | 0.0 | 0.07
Output | 0.000271 | 0.000271 | 0.000271 | 0.0 | 0.00
Modify | 0.015073 | 0.015073 | 0.015073 | 0.0 | 0.06
Other | | 0.003428 | | | 0.01
Pair | 21.529 | 21.529 | 21.529 | 0.0 | 99.45
Neigh | 0.08819 | 0.08819 | 0.08819 | 0.0 | 0.41
Comm | 0.013276 | 0.013276 | 0.013276 | 0.0 | 0.06
Output | 0.00025654 | 0.00025654 | 0.00025654 | 0.0 | 0.00
Modify | 0.014466 | 0.014466 | 0.014466 | 0.0 | 0.07
Other | | 0.003143 | | | 0.01
Nlocal: 4000 ave 4000 max 4000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
@ -79,7 +78,6 @@ write_data melt.data
write_restart melt.restart
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
using 1 OpenMP thread(s) per MPI task
read_restart melt.restart
@ -88,7 +86,7 @@ read_restart melt.restart
4000 atoms
pair_style python 2.5
pair_coeff * * potentials.LJCutMelt lj
pair_coeff * * py_pot.LJCutMelt lj
fix 1 all nve
@ -114,20 +112,20 @@ Step Temp E_pair E_mol TotEng Press
400 1.6540555 -4.7622999 0 -2.281837 5.8200413
450 1.6264734 -4.7200865 0 -2.2809863 5.9546991
500 1.6366891 -4.7350979 0 -2.2806781 5.9369284
Loop time of 24.3239 on 1 procs for 250 steps with 4000 atoms
Loop time of 21.9592 on 1 procs for 250 steps with 4000 atoms
Performance: 4440.069 tau/day, 10.278 timesteps/s
60.0% CPU use with 1 MPI tasks x 1 OpenMP threads
Performance: 4918.203 tau/day, 11.385 timesteps/s
98.5% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 24.017 | 24.017 | 24.017 | 0.0 | 98.74
Neigh | 0.26927 | 0.26927 | 0.26927 | 0.0 | 1.11
Comm | 0.018113 | 0.018113 | 0.018113 | 0.0 | 0.07
Output | 0.000254 | 0.000254 | 0.000254 | 0.0 | 0.00
Modify | 0.015259 | 0.015259 | 0.015259 | 0.0 | 0.06
Other | | 0.004524 | | | 0.02
Pair | 21.74 | 21.74 | 21.74 | 0.0 | 99.00
Neigh | 0.18588 | 0.18588 | 0.18588 | 0.0 | 0.85
Comm | 0.01476 | 0.01476 | 0.01476 | 0.0 | 0.07
Output | 0.00022244 | 0.00022244 | 0.00022244 | 0.0 | 0.00
Modify | 0.01356 | 0.01356 | 0.01356 | 0.0 | 0.06
Other | | 0.004382 | | | 0.02
Nlocal: 4000 ave 4000 max 4000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
@ -142,7 +140,6 @@ Neighbor list builds = 25
Dangerous builds = 25
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
using 1 OpenMP thread(s) per MPI task
units lj
@ -157,7 +154,7 @@ read_data melt.data
4000 velocities
pair_style python 2.5
pair_coeff * * potentials.LJCutMelt lj
pair_coeff * * py_pot.LJCutMelt lj
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
@ -186,20 +183,20 @@ Step Temp E_pair E_mol TotEng Press
150 1.6537193 -4.7627023 0 -2.2827434 5.8177704
200 1.6258731 -4.7205017 0 -2.2823017 5.952511
250 1.6370862 -4.7373176 0 -2.2823022 5.925807
Loop time of 22.9051 on 1 procs for 250 steps with 4000 atoms
Loop time of 21.8255 on 1 procs for 250 steps with 4000 atoms
Performance: 4715.116 tau/day, 10.915 timesteps/s
60.1% CPU use with 1 MPI tasks x 1 OpenMP threads
Performance: 4948.331 tau/day, 11.454 timesteps/s
98.6% CPU use with 1 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 22.752 | 22.752 | 22.752 | 0.0 | 99.33
Neigh | 0.12254 | 0.12254 | 0.12254 | 0.0 | 0.53
Comm | 0.013385 | 0.013385 | 0.013385 | 0.0 | 0.06
Output | 0.000254 | 0.000254 | 0.000254 | 0.0 | 0.00
Modify | 0.014159 | 0.014159 | 0.014159 | 0.0 | 0.06
Other | | 0.002851 | | | 0.01
Pair | 21.707 | 21.707 | 21.707 | 0.0 | 99.46
Neigh | 0.088455 | 0.088455 | 0.088455 | 0.0 | 0.41
Comm | 0.01311 | 0.01311 | 0.01311 | 0.0 | 0.06
Output | 0.00025082 | 0.00025082 | 0.00025082 | 0.0 | 0.00
Modify | 0.013836 | 0.013836 | 0.013836 | 0.0 | 0.06
Other | | 0.003096 | | | 0.01
Nlocal: 4000 ave 4000 max 4000 min
Histogram: 1 0 0 0 0 0 0 0 0 0
@ -214,4 +211,4 @@ Neighbor list builds = 12
Dangerous builds not checked
shell rm melt.data melt.restart
Total wall time: 0:01:13
Total wall time: 0:01:07