add harmonic/cut to python example folder. small tweaks to docs and examples

This commit is contained in:
Axel Kohlmeyer
2022-03-18 17:58:30 -04:00
parent 6c6a6b7c64
commit a7fce6dc39
18 changed files with 1354 additions and 213 deletions

View File

@ -223,19 +223,21 @@ be explicitly provided. The corresponding python code is:
.. admonition:: Performance Impact .. admonition:: Performance Impact
:class: note :class: note
The evaluation of scripted python code will slow down the The evaluation of scripted python code will slow down the computation
computation pairwise interactions quite significantly. However, this of pairwise interactions quite significantly. However, this performance
can be largely worked around through using the python pair style not penalty can be worked around through using the python pair style not
for the actual simulation, but to generate tabulated potentials on the for the actual simulation, but to generate tabulated potentials using
fly using the :doc:`pair_write <pair_write>` command. Please see below the :doc:`pair_write <pair_write>` command. This will also enable
for an example LAMMPS input of how to build a table file: GPU or multi-thread acceleration through the GPU, KOKKOS, or OPENMP
package versions of the *table* pair style. Please see below for a
LAMMPS input example demonstrating how to build a table file:
.. code-block:: LAMMPS .. code-block:: LAMMPS
pair_style python 2.5 pair_style python 2.5
pair_coeff * * py_pot.LJCutMelt lj pair_coeff * * py_pot.LJCutMelt lj
shell rm -f melt.table shell rm -f lj.table
pair_write 1 1 2000 rsq 0.01 2.5 lj1_lj2.table lj pair_write 1 1 2000 rsq 0.01 2.5 lj.table lj
Note that it is strongly recommended to try to **delete** the potential Note that it is strongly recommended to try to **delete** the potential
table file before generating it. Since the *pair_write* command will table file before generating it. Since the *pair_write* command will
@ -250,7 +252,7 @@ to be assigned to the LAMMPS atom types like this:
.. code-block:: LAMMPS .. code-block:: LAMMPS
pair_style table linear 2000 pair_style table linear 2000
pair_coeff 1 1 melt.table lj pair_coeff 1 1 lj.table lj
This can also be done for more complex systems. Please see the This can also be done for more complex systems. Please see the
*examples/python* folders for a few more examples. *examples/python* folders for a few more examples.

View File

@ -0,0 +1,84 @@
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
region box block -5 5 -5 5 -5 5
create_box 2 box
create_atoms 1 box
set type 1 type/ratio 2 0.5 424662346
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
write_restart repulsive.restart
clear
read_restart repulsive.restart
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
fix 1 all nve
thermo 50
run 250 post no
clear
read_restart repulsive.restart
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
clear
read_restart repulsive.restart
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
pair_coeff 1 2 python.dat PYTH_A_B
pair_coeff 2 2 python.dat PYTH_B_B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat

View File

@ -0,0 +1,235 @@
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.001 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
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
bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.139 | 4.139 | 4.139 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423789.56 0 423825.32 249259.3
50 75.889551 422919.46 0 423824.08 248893.24
100 105.20972 422570.47 0 423824.6 250756.6
150 132.08764 422249.71 0 423824.23 251894.29
200 118.14116 422416.43 0 423824.7 252088.96
250 128.40086 422293.71 0 423824.28 252057.16
Loop time of 17.4414 on 1 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
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
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 4.977 | 4.977 | 4.977 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 23.4715 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 4.138 | 4.138 | 4.138 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 0.843376 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
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
bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.552 | 4.552 | 4.552 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.14
300 119.72876 422397.4 0 423824.6 251985.1
350 124.88381 422335.77 0 423824.42 252051.26
400 121.76148 422373.11 0 423824.53 252006.37
450 125.29842 422330.9 0 423824.49 251997.21
500 126.87418 422312.08 0 423824.46 252053.48
Loop time of 1.57415 on 1 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:43

View File

@ -0,0 +1,235 @@
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.000 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
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
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.225 | 3.225 | 3.225 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423843.22 0 423878.98 249277.9
50 79.665061 422928.03 0 423877.66 248995.64
100 108.5878 422583.81 0 423878.21 250822.76
150 130.90607 422317.45 0 423877.89 251949.08
200 120.05458 422447.24 0 423878.33 252105.09
250 135.76605 422259.47 0 423877.84 252077.41
Loop time of 4.70112 on 4 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
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
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 3.666 | 3.667 | 3.667 Mbytes
Step Temp E_pair E_mol TotEng Press
250 135.76605 422259.47 0 423877.84 252077.41
300 119.63404 422452.21 0 423878.28 251958.74
350 129.35013 422336.12 0 423878 252069.99
400 123.04377 422411.48 0 423878.19 252024.23
450 126.01375 422375.98 0 423878.1 252019.19
500 126.91094 422365.34 0 423878.15 252012.59
Loop time of 6.20423 on 4 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 3.227 | 3.227 | 3.229 Mbytes
Step Temp E_pair E_mol TotEng Press
250 135.76605 422259.47 0 423877.84 252077.41
300 119.63404 422452.21 0 423878.28 251958.74
350 129.35013 422336.12 0 423878 252069.99
400 123.04377 422411.48 0 423878.19 252024.23
450 126.01375 422375.98 0 423878.1 252019.19
500 126.91094 422365.34 0 423878.15 252012.59
Loop time of 0.257048 on 4 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 2 by 2 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
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
bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.257 | 3.257 | 3.257 Mbytes
Step Temp E_pair E_mol TotEng Press
250 135.76605 422259.47 0 423877.84 252077.38
300 119.63401 422452.21 0 423878.28 251958.73
350 129.35009 422336.11 0 423878 252069.98
400 123.04383 422411.48 0 423878.19 252024.21
450 126.01378 422375.98 0 423878.1 252019.16
500 126.91078 422365.34 0 423878.15 252012.57
Loop time of 0.497624 on 4 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:11

View File

@ -0,0 +1,288 @@
LAMMPS (17 Feb 2022)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.000 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
Your simulation uses code contributions which should be cited:
- GPU package (short-range, long-range and three-body potentials):
@Article{Brown11,
author = {W. M. Brown, P. Wang, S. J. Plimpton, A. N. Tharrington},
title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Short Range Forces},
journal = {Comp.~Phys.~Comm.},
year = 2011,
volume = 182,
pages = {898--911}
}
@Article{Brown12,
author = {W. M. Brown, A. Kohlmeyer, S. J. Plimpton, A. N. Tharrington},
title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle Particle-Mesh},
journal = {Comp.~Phys.~Comm.},
year = 2012,
volume = 183,
pages = {449--459}
}
@Article{Brown13,
author = {W. M. Brown, Y. Masako},
title = {Implementing Molecular Dynamics on Hybrid High Performance Computers Three-Body Potentials},
journal = {Comp.~Phys.~Comm.},
year = 2013,
volume = 184,
pages = {2785--2793}
}
@Article{Trung15,
author = {T. D. Nguyen, S. J. Plimpton},
title = {Accelerating dissipative particle dynamics simulations for soft matter systems},
journal = {Comput.~Mater.~Sci.},
year = 2015,
volume = 100,
pages = {173--180}
}
@Article{Trung17,
author = {T. D. Nguyen},
title = {GPU-accelerated Tersoff potentials for massively parallel Molecular Dynamics simulations},
journal = {Comp.~Phys.~Comm.},
year = 2017,
volume = 212,
pages = {113--122}
}
@Article{Nikolskiy19,
author = {V. Nikolskiy, V. Stegailov},
title = {GPU acceleration of four-site water models in LAMMPS},
journal = {Proceeding of the International Conference on Parallel Computing (ParCo 2019), Prague, Czech Republic},
year = 2019
}
CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton off
pair build: half/bin/newtoff
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.612 | 4.612 | 4.612 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423789.56 0 423825.32 249259.3
50 75.889551 422919.46 0 423824.08 248893.24
100 105.20972 422570.47 0 423824.6 250756.6
150 132.08764 422249.71 0 423824.23 251894.29
200 118.14116 422416.43 0 423824.7 252088.96
250 128.40086 422293.71 0 423824.28 252057.16
Loop time of 21.1837 on 1 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton off
pair build: half/bin/newtoff
stencil: full/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 5.451 | 5.451 | 5.451 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 28.5184 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut, perpetual
attributes: half, newton off
pair build: half/bin/newtoff
stencil: full/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 4.611 | 4.611 | 4.611 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 1.1146 on 1 procs for 250 steps with 4000 atoms
clear
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
using 1 OpenMP thread(s) per MPI task
package gpu 0
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Per MPI rank memory allocation (min/avg/max) = 2.965 | 2.965 | 2.965 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.14
300 119.72876 422397.4 0 423824.6 251985.09
350 124.88381 422335.77 0 423824.42 252051.26
400 121.76148 422373.11 0 423824.53 252006.37
450 125.29841 422330.9 0 423824.49 251997.2
500 126.87418 422312.08 0 423824.45 252053.48
Loop time of 0.389958 on 1 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:54

View File

@ -0,0 +1,268 @@
LAMMPS (17 Feb 2022)
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
# 3d soft repulsive particles
units real
atom_style atomic
lattice fcc 5.0 origin 0.1 0.1 0.1
Lattice spacing in x,y,z = 5 5 5
region box block -5 5 -5 5 -5 5
create_box 2 box
Created orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
create_atoms 1 box
Created 4000 atoms
using lattice units in orthogonal box = (-25 -25 -25) to (25 25 25)
create_atoms CPU = 0.001 seconds
set type 1 type/ratio 2 0.5 424662346
Setting atom values ...
2000 settings made for type/ratio
mass * 1.0
velocity all create 3.0 87287
pair_style python 9.0
pair_coeff * * py_pot.Harmonic A B
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
No /omp style for force computation currently active
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 6.024 | 6.024 | 6.024 Mbytes
Step Temp E_pair E_mol TotEng Press
0 3 423789.56 0 423825.32 249259.3
50 75.889551 422919.46 0 423824.08 248893.24
100 105.20972 422570.47 0 423824.6 250756.6
150 132.08764 422249.71 0 423824.23 251894.29
200 118.14116 422416.43 0 423824.7 252088.96
250 128.40086 422293.71 0 423824.28 252057.16
Loop time of 18.9294 on 4 procs for 250 steps with 4000 atoms
write_restart repulsive.restart
System init for write_restart ...
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
No /omp style for force computation currently active
clear
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.001 seconds
pair_style python 10.0
pair_coeff * * py_pot.Harmonic A B
shell rm -f python.dat
pair_write 1 1 1000 rsq 0.1 10.0 python.dat PYTH_A_A
Creating table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
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
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 python.dat PYTH_B_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 python.dat PYTH_A_B
Appending to table file python.dat with DATE: 2022-03-18
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
No /omp style for force computation currently active
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 9 9 9
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair python, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 7.626 | 7.626 | 7.626 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 24.3294 on 4 procs for 250 steps with 4000 atoms
clear
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style harmonic/cut
pair_coeff 1 1 0.2 9.0
pair_coeff 2 2 0.4 9.0
shell rm -f harmonic.dat
pair_write 1 1 1000 rsq 0.1 10.0 harmonic.dat HARM_1_1
Creating table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut/omp, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d
bin: standard
pair_write 2 2 1000 rsq 0.1 10.0 harmonic.dat HARM_2_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
pair_write 1 2 1000 rsq 0.1 10.0 harmonic.dat HARM_1_2
Appending to table file harmonic.dat with DATE: 2022-03-18
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 1 of 1 mixed pair_coeff terms from geometric mixing rule
Last active /omp style is pair_style harmonic/cut/omp
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 10
ghost atom cutoff = 10
binsize = 5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair harmonic/cut/omp, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 6.023 | 6.023 | 6.023 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.16
300 119.72871 422397.4 0 423824.6 251985.11
350 124.88375 422335.77 0 423824.42 252051.28
400 121.76143 422373.11 0 423824.53 252006.39
450 125.29847 422330.9 0 423824.49 251997.23
500 126.87408 422312.08 0 423824.45 252053.51
Loop time of 0.219199 on 4 procs for 250 steps with 4000 atoms
clear
using 4 OpenMP thread(s) per MPI task
package omp 0
using multi-threaded neighbor list subroutines
read_restart repulsive.restart
Reading restart file ...
restart file = 17 Feb 2022, LAMMPS = 17 Feb 2022
restoring atom style atomic from restart
orthogonal box = (-25 -25 -25) to (25 25 25)
1 by 1 by 1 MPI processor grid
pair style python stores no restart info
4000 atoms
read_restart CPU = 0.000 seconds
pair_style table spline 1000
pair_coeff 1 1 python.dat PYTH_A_A
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 1 2 python.dat PYTH_A_B
Reading pair table potential file python.dat with DATE: 2022-03-18
pair_coeff 2 2 python.dat PYTH_B_B
Reading pair table potential file python.dat with DATE: 2022-03-18
neighbor 1.0 bin
neigh_modify every 2 delay 4 check yes
fix 1 all nve
thermo 50
run 250 post no
generated 0 of 1 mixed pair_coeff terms from geometric mixing rule
Last active /omp style is pair_style table/omp
Neighbor list info ...
update every 2 steps, delay 4 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 11
ghost atom cutoff = 11
binsize = 5.5, bins = 10 10 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair table/omp, perpetual
attributes: half, newton on, omp
pair build: half/bin/atomonly/newton/omp
stencil: half/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 6.056 | 6.056 | 6.056 Mbytes
Step Temp E_pair E_mol TotEng Press
250 128.40086 422293.71 0 423824.28 252057.14
300 119.72876 422397.4 0 423824.6 251985.1
350 124.88381 422335.77 0 423824.42 252051.26
400 121.76148 422373.11 0 423824.53 252006.37
450 125.29842 422330.9 0 423824.49 251997.21
500 126.87418 422312.08 0 423824.46 252053.48
Loop time of 0.374806 on 4 procs for 250 steps with 4000 atoms
# remove temporary files
shell rm repulsive.restart harmonic.dat python.dat
Total wall time: 0:00:44

View File

@ -1,4 +1,5 @@
from __future__ import print_function from __future__ import print_function
import math
class LAMMPSPairPotential(object): class LAMMPSPairPotential(object):
def __init__(self): def __init__(self):
@ -10,6 +11,34 @@ class LAMMPSPairPotential(object):
if (units != self.units): if (units != self.units):
raise Exception("Conflicting units: %s vs. %s" % (self.units,units)) raise Exception("Conflicting units: %s vs. %s" % (self.units,units))
class Harmonic(LAMMPSPairPotential):
def __init__(self):
super(Harmonic,self).__init__()
self.units = 'real'
# set coeffs: K, r0
self.coeff = {'A' : {'A' : (0.2,9.0),
'B' : (math.sqrt(0.2*0.4),9.0)},
'B' : {'A' : (math.sqrt(0.2*0.4),9.0),
'B' : (0.4,9.0)}}
def compute_force(self,rsq,itype,jtype):
coeff = self.coeff[self.pmap[itype]][self.pmap[jtype]]
r = math.sqrt(rsq)
delta = coeff[1]-r
if (r <= coeff[1]):
return 2.0*delta*coeff[0]/r
else:
return 0.0
def compute_energy(self,rsq,itype,jtype):
coeff = self.coeff[self.pmap[itype]][self.pmap[jtype]]
r = math.sqrt(rsq)
delta = coeff[1]-r
if (r <= coeff[1]):
return delta*delta*coeff[0]
else:
return 0.0
class LJCutMelt(LAMMPSPairPotential): class LJCutMelt(LAMMPSPairPotential):
def __init__(self): def __init__(self):
super(LJCutMelt,self).__init__() super(LJCutMelt,self).__init__()