From 7eeb96f1afdc3aa1a37cd5429727e3549b8ebcc0 Mon Sep 17 00:00:00 2001 From: "Ryan S. Elliott" Date: Tue, 3 Jul 2018 23:37:54 -0500 Subject: [PATCH] Update pair_kim to work with new neig. list Hints --- examples/kim/in.kim.lj | 4 +- examples/kim/in.kim.lj.lmp | 2 +- examples/kim/in.kim.lj.lmp.newton-on | 35 ++++ ...g.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1} | 42 ++-- ...g.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4} | 52 ++--- ...tu.1 => log.04Jul2018.kim.lj.lmp.ubuntu.1} | 48 +++-- .../kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 | 66 ++++++ examples/kim/log.04Jul2018.kim.lj.ubuntu.1 | 69 +++++++ examples/kim/log.04Jul2018.kim.lj.ubuntu.4 | 78 ++++++++ examples/kim/log.29Jun18.kim.lj.ubuntu.4 | 68 ------- src/KIM/pair_kim.cpp | 188 ++++++++++-------- src/KIM/pair_kim.h | 10 +- 12 files changed, 433 insertions(+), 229 deletions(-) create mode 100644 examples/kim/in.kim.lj.lmp.newton-on rename examples/kim/{log.29Jun18.kim.lj.lmp.ubuntu.1 => log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1} (56%) rename examples/kim/{log.29Jun18.kim.lj.lmp.ubuntu.4 => log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4} (50%) rename examples/kim/{log.29Jun18.kim.lj.ubuntu.1 => log.04Jul2018.kim.lj.lmp.ubuntu.1} (52%) create mode 100644 examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 create mode 100644 examples/kim/log.04Jul2018.kim.lj.ubuntu.1 create mode 100644 examples/kim/log.04Jul2018.kim.lj.ubuntu.4 delete mode 100644 examples/kim/log.29Jun18.kim.lj.ubuntu.4 diff --git a/examples/kim/in.kim.lj b/examples/kim/in.kim.lj index 851243bed8..a17ec982da 100644 --- a/examples/kim/in.kim.lj +++ b/examples/kim/in.kim.lj @@ -16,6 +16,7 @@ variable zz equal 20*$z units metal atom_style atomic +newton off lattice fcc 4.4300 region box block 0 ${xx} 0 ${yy} 0 ${zz} @@ -24,9 +25,8 @@ create_atoms 1 box #pair_style lj/cut 8.1500 #pair_coeff 1 1 0.0104 3.4000 -#pair_modify shift no -pair_style kim LAMMPSvirial LennardJones_Ar +pair_style kim KIMvirial LennardJones_Ar pair_coeff * * Ar mass 1 39.95 diff --git a/examples/kim/in.kim.lj.lmp b/examples/kim/in.kim.lj.lmp index aa6dbcad6f..a10e3e2e90 100644 --- a/examples/kim/in.kim.lj.lmp +++ b/examples/kim/in.kim.lj.lmp @@ -10,6 +10,7 @@ variable zz equal 20*$z units metal atom_style atomic +newton off lattice fcc 4.4300 region box block 0 ${xx} 0 ${yy} 0 ${zz} @@ -18,7 +19,6 @@ create_atoms 1 box pair_style lj/cut 8.1500 pair_coeff 1 1 0.0104 3.4000 -pair_modify shift no #pair_style kim KIMvirial LennardJones_Ar #pair_coeff * * Ar diff --git a/examples/kim/in.kim.lj.lmp.newton-on b/examples/kim/in.kim.lj.lmp.newton-on new file mode 100644 index 0000000000..d17bc14984 --- /dev/null +++ b/examples/kim/in.kim.lj.lmp.newton-on @@ -0,0 +1,35 @@ +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units metal +atom_style atomic +newton on + +lattice fcc 4.4300 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box + +pair_style lj/cut 8.1500 +pair_coeff 1 1 0.0104 3.4000 + +#pair_style kim KIMvirial LennardJones_Ar +#pair_coeff * * Ar + +mass 1 39.95 +velocity all create 200.0 232345 loop geom + +neighbor 0.3 bin +neigh_modify delay 0 every 1 check yes + +fix 1 all nve +#fix 1 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 3.0 + +run 100 diff --git a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 similarity index 56% rename from examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 rename to examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 index 76106e009f..70eae36a48 100644 --- a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.1 +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.1 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[30970,1],0]: A high-performance Open MPI point-to-point messaging module +[[19053,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,13 +16,13 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.0031676 secs + Time spent = 0.00270113 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair lj/cut, perpetual attributes: half, newton on @@ -33,34 +33,34 @@ Setting up Verlet run ... Unit style : metal Current step : 0 Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 16.58 | 16.58 | 16.58 Mbytes +Per MPI rank memory allocation (min/avg/max) = 19.23 | 19.23 | 19.23 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.66365 -547.67175 0 331.94665 -1054.2086 -Loop time of 1.40245 on 1 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.18554 on 1 procs for 100 steps with 32000 atoms -Performance: 6.161 ns/day, 3.896 hours/ns, 71.304 timesteps/s -100.0% CPU use with 1 MPI tasks x no OpenMP threads +Performance: 3.953 ns/day, 6.071 hours/ns, 45.755 timesteps/s +99.6% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.2556 | 1.2556 | 1.2556 | 0.0 | 89.53 -Neigh | 0.098976 | 0.098976 | 0.098976 | 0.0 | 7.06 -Comm | 0.011525 | 0.011525 | 0.011525 | 0.0 | 0.82 -Output | 0.00021903 | 0.00021903 | 0.00021903 | 0.0 | 0.02 -Modify | 0.023739 | 0.023739 | 0.023739 | 0.0 | 1.69 -Other | | 0.01244 | | | 0.89 +Pair | 2.0006 | 2.0006 | 2.0006 | 0.0 | 91.54 +Neigh | 0.13933 | 0.13933 | 0.13933 | 0.0 | 6.38 +Comm | 0.011122 | 0.011122 | 0.011122 | 0.0 | 0.51 +Output | 0.00020978 | 0.00020978 | 0.00020978 | 0.0 | 0.01 +Modify | 0.022358 | 0.022358 | 0.022358 | 0.0 | 1.02 +Other | | 0.01188 | | | 0.54 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 19911 ave 19911 max 19911 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 1.36493e+06 ave 1.36493e+06 max 1.36493e+06 min +Neighs: 2.12688e+06 ave 2.12688e+06 max 2.12688e+06 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 1364931 -Ave neighs/atom = 42.6541 +Total # of neighbors = 2126875 +Ave neighs/atom = 66.4648 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:01 +Total wall time: 0:00:02 diff --git a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 similarity index 50% rename from examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 rename to examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 index 634c038efd..e7157c11b8 100644 --- a/examples/kim/log.29Jun18.kim.lj.lmp.ubuntu.4 +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.newton-on.ubuntu.4 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[30962,1],0]: A high-performance Open MPI point-to-point messaging module +[[19045,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,13 +16,13 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 2 by 2 MPI processor grid Created 32000 atoms - Time spent = 0.00143054 secs + Time spent = 0.00117056 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair lj/cut, perpetual attributes: half, newton on @@ -33,34 +33,34 @@ Setting up Verlet run ... Unit style : metal Current step : 0 Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 6.875 | 6.875 | 6.875 Mbytes +Per MPI rank memory allocation (min/avg/max) = 7.632 | 7.632 | 7.632 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.66365 -547.67175 0 331.94665 -1054.2086 -Loop time of 1.55473 on 4 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.34104 on 4 procs for 100 steps with 32000 atoms -Performance: 5.557 ns/day, 4.319 hours/ns, 64.320 timesteps/s -23.8% CPU use with 4 MPI tasks x no OpenMP threads +Performance: 3.691 ns/day, 6.503 hours/ns, 42.716 timesteps/s +24.0% CPU use with 4 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.47168 | 0.51922 | 0.58923 | 6.2 | 33.40 -Neigh | 0.061309 | 0.077009 | 0.10276 | 5.7 | 4.95 -Comm | 0.87185 | 0.92596 | 0.95327 | 3.4 | 59.56 -Output | 0.00035269 | 0.00047555 | 0.00055331 | 0.0 | 0.03 -Modify | 0.0060711 | 0.00616 | 0.0062612 | 0.1 | 0.40 -Other | | 0.0259 | | | 1.67 +Pair | 0.91499 | 0.96396 | 1.0567 | 5.6 | 41.18 +Neigh | 0.092245 | 0.11781 | 0.14572 | 6.0 | 5.03 +Comm | 1.1264 | 1.2287 | 1.2906 | 5.6 | 52.49 +Output | 0.00045199 | 0.00051154 | 0.00060273 | 0.0 | 0.02 +Modify | 0.0058738 | 0.0059629 | 0.0061675 | 0.2 | 0.25 +Other | | 0.02406 | | | 1.03 -Nlocal: 8000 ave 8014 max 7988 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Nghost: 9131 ave 9143 max 9117 min -Histogram: 1 0 0 0 0 1 1 0 0 1 -Neighs: 341233 ave 341715 max 340679 min -Histogram: 1 0 0 0 1 0 0 1 0 1 +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 531719 ave 533273 max 529395 min +Histogram: 1 0 0 0 1 0 0 0 0 2 -Total # of neighbors = 1364931 -Ave neighs/atom = 42.6541 +Total # of neighbors = 2126875 +Ave neighs/atom = 66.4648 Neighbor list builds = 3 Dangerous builds = 0 -Total wall time: 0:00:01 +Total wall time: 0:00:02 diff --git a/examples/kim/log.29Jun18.kim.lj.ubuntu.1 b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 similarity index 52% rename from examples/kim/log.29Jun18.kim.lj.ubuntu.1 rename to examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 index c1875916db..217568072c 100644 --- a/examples/kim/log.29Jun18.kim.lj.ubuntu.1 +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.1 @@ -1,5 +1,5 @@ -------------------------------------------------------------------------- -[[30495,1],0]: A high-performance Open MPI point-to-point messaging module +[[19074,1],0]: A high-performance Open MPI point-to-point messaging module was unable to find any relevant network interfaces: Module: OpenFabrics (openib) @@ -16,53 +16,51 @@ Lattice spacing in x,y,z = 4.43 4.43 4.43 Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) 1 by 1 by 1 MPI processor grid Created 32000 atoms - Time spent = 0.00259765 secs + Time spent = 0.00251478 secs Neighbor list info ... update every 1 steps, delay 0 steps, check yes max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton on, ghost, cut 7.55482 - pair build: full/bin/ghost - stencil: full/ghost/bin/3d + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff bin: standard Setting up Verlet run ... Unit style : metal Current step : 0 Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 27.14 | 27.14 | 27.14 Mbytes +Per MPI rank memory allocation (min/avg/max) = 20.37 | 20.37 | 20.37 Mbytes Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.65961 -547.66877 0 331.93294 -1053.7732 -Loop time of 2.12331 on 1 procs for 100 steps with 32000 atoms + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.6218 on 1 procs for 100 steps with 32000 atoms -Performance: 4.069 ns/day, 5.898 hours/ns, 47.096 timesteps/s +Performance: 3.295 ns/day, 7.283 hours/ns, 38.142 timesteps/s 99.9% CPU use with 1 MPI tasks x no OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.7197 | 1.7197 | 1.7197 | 0.0 | 80.99 -Neigh | 0.35501 | 0.35501 | 0.35501 | 0.0 | 16.72 -Comm | 0.012289 | 0.012289 | 0.012289 | 0.0 | 0.58 -Output | 0.00021102 | 0.00021102 | 0.00021102 | 0.0 | 0.01 -Modify | 0.023484 | 0.023484 | 0.023484 | 0.0 | 1.11 -Other | | 0.01266 | | | 0.60 +Pair | 2.2623 | 2.2623 | 2.2623 | 0.0 | 86.29 +Neigh | 0.31859 | 0.31859 | 0.31859 | 0.0 | 12.15 +Comm | 0.005914 | 0.005914 | 0.005914 | 0.0 | 0.23 +Output | 0.00033105 | 0.00033105 | 0.00033105 | 0.0 | 0.01 +Modify | 0.023461 | 0.023461 | 0.023461 | 0.0 | 0.89 +Other | | 0.01123 | | | 0.43 Nlocal: 32000 ave 32000 max 32000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 19911 ave 19911 max 19911 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -FullNghs: 2.569e+06 ave 2.569e+06 max 2.569e+06 min +Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 2568996 -Ave neighs/atom = 80.2811 +Total # of neighbors = 2370499 +Ave neighs/atom = 74.0781 Neighbor list builds = 3 Dangerous builds = 0 Total wall time: 0:00:02 diff --git a/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 new file mode 100644 index 0000000000..806c674efb --- /dev/null +++ b/examples/kim/log.04Jul2018.kim.lj.lmp.ubuntu.4 @@ -0,0 +1,66 @@ +-------------------------------------------------------------------------- +[[19098,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00123697 secs +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton off + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 8.013 | 8.013 | 8.013 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 129712.25 + 100 95.179725 6718.814 0 7112.496 133346.59 +Loop time of 2.88232 on 4 procs for 100 steps with 32000 atoms + +Performance: 2.998 ns/day, 8.006 hours/ns, 34.694 timesteps/s +24.6% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.3577 | 1.415 | 1.467 | 3.7 | 49.09 +Neigh | 0.25761 | 0.28189 | 0.29894 | 3.2 | 9.78 +Comm | 0.58287 | 0.73218 | 0.85561 | 11.5 | 25.40 +Output | 0.00082721 | 0.0029034 | 0.0051877 | 3.1 | 0.10 +Modify | 0.0058569 | 0.015767 | 0.033242 | 8.6 | 0.55 +Other | | 0.4346 | | | 15.08 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 630904 ave 632094 max 628209 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 2523614 +Ave neighs/atom = 78.8629 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 b/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 new file mode 100644 index 0000000000..3832bd060a --- /dev/null +++ b/examples/kim/log.04Jul2018.kim.lj.ubuntu.1 @@ -0,0 +1,69 @@ +-------------------------------------------------------------------------- +[[19111,1],0]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 1 by 1 MPI processor grid +Created 32000 atoms + Time spent = 0.00257231 secs +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: half, newton off, cut 8.45 + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 21.26 | 21.26 | 21.26 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 1270.4248 + 100 95.179725 6718.814 0 7112.496 604.59343 +Loop time of 3.22934 on 1 procs for 100 steps with 32000 atoms + +Performance: 2.675 ns/day, 8.970 hours/ns, 30.966 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.821 | 2.821 | 2.821 | 0.0 | 87.36 +Neigh | 0.35198 | 0.35198 | 0.35198 | 0.0 | 10.90 +Comm | 0.0081757 | 0.0081757 | 0.0081757 | 0.0 | 0.25 +Output | 0.00030922 | 0.00030922 | 0.00030922 | 0.0 | 0.01 +Modify | 0.032856 | 0.032856 | 0.032856 | 0.0 | 1.02 +Other | | 0.01501 | | | 0.46 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19911 ave 19911 max 19911 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2.3705e+06 ave 2.3705e+06 max 2.3705e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2370499 +Ave neighs/atom = 74.0781 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 b/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 new file mode 100644 index 0000000000..70b2f82812 --- /dev/null +++ b/examples/kim/log.04Jul2018.kim.lj.ubuntu.4 @@ -0,0 +1,78 @@ +-------------------------------------------------------------------------- +[[19135,1],1]: A high-performance Open MPI point-to-point messaging module +was unable to find any relevant network interfaces: + +Module: OpenFabrics (openib) + Host: ubuntu-artful + +Another transport will be used instead, although this may result in +lower performance. + +NOTE: You can disable this warning by setting the MCA parameter +btl_base_warn_component_unused to 0. +-------------------------------------------------------------------------- +LAMMPS (22 Jun 2018) +Lattice spacing in x,y,z = 4.43 4.43 4.43 +Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) + 1 by 2 by 2 MPI processor grid +Created 32000 atoms + Time spent = 0.00154417 secs +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +WARNING: KIM Model does not provide `partialVirial'. pair_kim will always use `LAMMPSvirial' option. (../pair_kim.cpp:987) +WARNING: KIM Model does not provide `partialParticleEnergy'; energy per atom will be zero (../pair_kim.cpp:992) +WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (../pair_kim.cpp:996) +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 8.45 + ghost atom cutoff = 8.45 + binsize = 4.225, bins = 21 21 21 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair kim, perpetual + attributes: half, newton off, cut 8.45 + pair build: half/bin/newtoff + stencil: half/bin/3d/newtoff + bin: standard +Setting up Verlet run ... + Unit style : metal + Current step : 0 + Time step : 0.001 +Per MPI rank memory allocation (min/avg/max) = 8.528 | 8.528 | 8.528 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 200 6290.8194 0 7118.0584 1270.4248 + 100 95.179725 6718.814 0 7112.496 604.59343 +Loop time of 3.17877 on 4 procs for 100 steps with 32000 atoms + +Performance: 2.718 ns/day, 8.830 hours/ns, 31.459 timesteps/s +24.3% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.0514 | 2.1009 | 2.1859 | 3.6 | 66.09 +Neigh | 0.29304 | 0.31706 | 0.33568 | 2.7 | 9.97 +Comm | 0.61926 | 0.72709 | 0.77083 | 7.3 | 22.87 +Output | 0.00035457 | 0.00043741 | 0.000547 | 0.0 | 0.01 +Modify | 0.0066107 | 0.0067653 | 0.0069097 | 0.1 | 0.21 +Other | | 0.02653 | | | 0.83 + +Nlocal: 8000 ave 8018 max 7967 min +Histogram: 1 0 0 0 0 0 1 0 0 2 +Nghost: 9131 ave 9164 max 9113 min +Histogram: 2 0 0 1 0 0 0 0 0 1 +Neighs: 630904 ave 632094 max 628209 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 2523614 +Ave neighs/atom = 78.8629 +Neighbor list builds = 3 +Dangerous builds = 0 +Total wall time: 0:00:03 diff --git a/examples/kim/log.29Jun18.kim.lj.ubuntu.4 b/examples/kim/log.29Jun18.kim.lj.ubuntu.4 deleted file mode 100644 index 5ef352a667..0000000000 --- a/examples/kim/log.29Jun18.kim.lj.ubuntu.4 +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------------- -[[30487,1],0]: A high-performance Open MPI point-to-point messaging module -was unable to find any relevant network interfaces: - -Module: OpenFabrics (openib) - Host: ubuntu-artful - -Another transport will be used instead, although this may result in -lower performance. - -NOTE: You can disable this warning by setting the MCA parameter -btl_base_warn_component_unused to 0. --------------------------------------------------------------------------- -LAMMPS (22 Jun 2018) -Lattice spacing in x,y,z = 4.43 4.43 4.43 -Created orthogonal box = (0 0 0) to (88.6 88.6 88.6) - 1 by 2 by 2 MPI processor grid -Created 32000 atoms - Time spent = 0.00128874 secs -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 7.85482 - ghost atom cutoff = 7.85482 - binsize = 3.92741, bins = 23 23 23 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair kim, perpetual - attributes: full, newton on, ghost, cut 7.55482 - pair build: full/bin/ghost - stencil: full/ghost/bin/3d - bin: standard -Setting up Verlet run ... - Unit style : metal - Current step : 0 - Time step : 0.001 -Per MPI rank memory allocation (min/avg/max) = 10.82 | 10.82 | 10.82 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 200 -495.29247 0 331.94661 -978.84224 - 100 212.65961 -547.66877 0 331.93294 -1053.7732 -Loop time of 2.58934 on 4 procs for 100 steps with 32000 atoms - -Performance: 3.337 ns/day, 7.193 hours/ns, 38.620 timesteps/s -24.3% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.85344 | 0.94031 | 1.0212 | 7.2 | 36.31 -Neigh | 0.40159 | 0.42603 | 0.43728 | 2.2 | 16.45 -Comm | 1.1013 | 1.1823 | 1.2796 | 6.9 | 45.66 -Output | 0.00041301 | 0.00056702 | 0.00081648 | 0.0 | 0.02 -Modify | 0.0062882 | 0.0063459 | 0.0064657 | 0.1 | 0.25 -Other | | 0.03375 | | | 1.30 - -Nlocal: 8000 ave 8014 max 7988 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Nghost: 9131 ave 9143 max 9117 min -Histogram: 1 0 0 0 0 1 1 0 0 1 -Neighs: 0 ave 0 max 0 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -FullNghs: 642249 ave 643365 max 641215 min -Histogram: 1 0 0 0 2 0 0 0 0 1 - -Total # of neighbors = 2568996 -Ave neighs/atom = 80.2811 -Neighbor list builds = 3 -Dangerous builds = 0 -Total wall time: 0:00:03 diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index ee9bac000d..ca39b5601e 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -12,13 +12,11 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Ryan S. Elliott, - Valeriu Smirichinski, - Ellad Tadmor + Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v1.6.0 (and newer) package + Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package ------------------------------------------------------------------------- */ #include @@ -45,9 +43,9 @@ PairKIM::PairKIM(LAMMPS *lmp) : Pair(lmp), settings_call_count(0), init_style_call_count(0), - kim_modelname(0), - lmps_map_species_to_unique(0), - lmps_unique_elements(0), + kim_modelname(NULL), + lmps_map_species_to_unique(NULL), + lmps_unique_elements(NULL), lmps_num_unique_elements(0), lmps_units(METAL), lengthUnit(KIM::LENGTH_UNIT::unused), @@ -55,8 +53,8 @@ PairKIM::PairKIM(LAMMPS *lmp) : chargeUnit(KIM::CHARGE_UNIT::unused), temperatureUnit(KIM::TEMPERATURE_UNIT::unused), timeUnit(KIM::TIME_UNIT::unused), - pkim(0), - pargs(0), + pkim(NULL), + pargs(NULL), kim_model_support_for_energy(KIM::SUPPORT_STATUS::notSupported), kim_model_support_for_forces(KIM::SUPPORT_STATUS::notSupported), kim_model_support_for_virial(KIM::SUPPORT_STATUS::notSupported), @@ -64,15 +62,17 @@ PairKIM::PairKIM(LAMMPS *lmp) : kim_model_support_for_particleVirial(KIM::SUPPORT_STATUS::notSupported), lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), - kim_number_of_cutoffs(0), - kim_cutoff_values(0), - neighborLists(0), - kim_particle_codes(0), + kim_number_of_neighbor_lists(0), + kim_cutoff_values(NULL), + padding_neighbor_hints(NULL), + half_list_hints(NULL), + neighborLists(NULL), + kim_particle_codes(NULL), lmps_maxalloc(0), - kim_particleSpecies(0), - kim_particleContributing(0), - lmps_stripped_neigh_list(0), - lmps_stripped_neigh_ptr(0) + kim_particleSpecies(NULL), + kim_particleContributing(NULL), + lmps_stripped_neigh_list(NULL), + lmps_stripped_neigh_ptr(NULL) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function @@ -101,6 +101,13 @@ PairKIM::~PairKIM() delete [] lmps_unique_elements[i]; delete [] lmps_unique_elements; + if (kim_particle_codes_ok) + { + delete [] kim_particle_codes; + kim_particle_codes = NULL; + kim_particle_codes_ok = false; + } + // clean up local memory used to support KIM interface memory->destroy(kim_particleSpecies); memory->destroy(kim_particleContributing); @@ -281,20 +288,6 @@ void PairKIM::settings(int narg, char **arg) // set lmps_* bool flags set_lmps_flags(); - // set virial handling - if (strcmp(arg[0],"LAMMPSvirial") == 0) - { - no_virial_fdotr_compute = 0; - } - else if (strcmp(arg[0],"KIMvirial") == 0) - { - no_virial_fdotr_compute = 1; - } - else - { - error->all(FLERR,"Unrecognized virial argument in pair_style command"); - } - // set KIM Model name int nmlen = strlen(arg[1]); if (kim_modelname != 0) @@ -305,6 +298,26 @@ void PairKIM::settings(int narg, char **arg) kim_modelname = new char[nmlen+1]; strcpy(kim_modelname, arg[1]); + // initialize KIM Model + kim_init(); + + // set virial handling + if (strcmp(arg[0],"KIMvirial") == 0) + { + if (kim_model_support_for_virial == KIM::SUPPORT_STATUS::notSupported) + no_virial_fdotr_compute = 0; + else + no_virial_fdotr_compute = 1; + } + else if (strcmp(arg[0],"LAMMPSvirial") == 0) + { + no_virial_fdotr_compute = 0; + } + else + { + error->all(FLERR,"Unrecognized virial argument in pair_style command"); + } + return; } @@ -351,7 +364,7 @@ void PairKIM::coeff(int narg, char **arg) // Assume all species arguments are valid - // errors will be detected by kim_api_init() matching + // errors will be detected by below lmps_num_unique_elements = 0; for (i = 2; i < narg; i++) { for (j = 0; j < lmps_num_unique_elements; j++) @@ -378,6 +391,29 @@ void PairKIM::coeff(int narg, char **arg) if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); + // setup mapping between LAMMPS unique elements and KIM species codes + if (kim_particle_codes_ok) + { + delete [] kim_particle_codes; + kim_particle_codes = NULL; + kim_particle_codes_ok = false; + } + kim_particle_codes = new int[lmps_num_unique_elements]; + kim_particle_codes_ok = true; + for(int i = 0; i < lmps_num_unique_elements; i++){ + int kimerror; + int supported; + int code; + kimerror = pkim->GetSpeciesSupportAndCode( + KIM::SpeciesName(lmps_unique_elements[i]), + &supported, + &code); + if (supported) + kim_particle_codes[i] = code; + else + error->all(FLERR,"create_kim_particle_codes: symbol not found "); + } + return; } @@ -394,22 +430,16 @@ void PairKIM::init_style() error->all(FLERR,"PairKIM only works with 3D problems"); int kimerror; - // KIM and Model initialization (only once) - // also sets kim_ind_* and kim_* bool flags - if (!kim_init_ok) - { - kim_init(); - } // setup lmps_stripped_neigh_list for neighbors of one atom, if needed if (lmps_using_molecular) { memory->destroy(lmps_stripped_neigh_list); memory->create(lmps_stripped_neigh_list, - kim_number_of_cutoffs*neighbor->oneatom, + kim_number_of_neighbor_lists*neighbor->oneatom, "pair:lmps_stripped_neigh_list"); delete [] lmps_stripped_neigh_ptr; - lmps_stripped_neigh_ptr = new int*[kim_number_of_cutoffs]; - for (int i = 0; i < kim_number_of_cutoffs; ++i) + lmps_stripped_neigh_ptr = new int*[kim_number_of_neighbor_lists]; + for (int i = 0; i < kim_number_of_neighbor_lists; ++i) { lmps_stripped_neigh_ptr[0] = &(lmps_stripped_neigh_list[(i-1)*(neighbor->oneatom)]); @@ -420,14 +450,32 @@ void PairKIM::init_style() // make sure comm_reverse expects (at most) 9 values when newton is off if (!lmps_using_newton) comm_reverse_off = 9; - // request full neighbor lists - for (int i = 0; i < kim_number_of_cutoffs; ++i) + // request full neighbor lists (unless hints allow for better alternatives) + for (int i = 0; i < kim_number_of_neighbor_lists; ++i) { int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = i; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; - neighbor->requests[irequest]->ghost = 1; + if (half_list_hints[i]) + { + neighbor->requests[irequest]->half = 1; + if (! lmps_using_newton) neighbor->requests[irequest]->newton = 2; + neighbor->requests[irequest]->full = 0; + } + else + { + neighbor->requests[irequest]->half = 0; + if (! lmps_using_newton) neighbor->requests[irequest]->newton = 0; + neighbor->requests[irequest]->full = 1; + } + if (padding_neighbor_hints[i]) + { + neighbor->requests[irequest]->ghost = 0; + } + else + { + neighbor->requests[irequest]->ghost = 1; + + } neighbor->requests[irequest]->cut = 1; neighbor->requests[irequest]->cutoff = kim_cutoff_values[i] + neighbor->skin; @@ -604,7 +652,8 @@ double PairKIM::memory_usage() ------------------------------------------------------------------------- */ int PairKIM::get_neigh(void const * const dataObject, - int const numberOfCutoffs, double const * const cutoffs, + int const numberOfNeighborLists, + double const * const cutoffs, int const neighborListIndex, int const particleNumber, int * const numberOfNeighbors, int const ** const neighborsOfParticle) @@ -612,8 +661,9 @@ int PairKIM::get_neigh(void const * const dataObject, PairKIM const * const Model = reinterpret_cast(dataObject); - if (numberOfCutoffs != Model->kim_number_of_cutoffs) return true; - for (int i = 0; i < numberOfCutoffs; ++i) + if (numberOfNeighborLists != Model->kim_number_of_neighbor_lists) + return true; + for (int i = 0; i < numberOfNeighborLists; ++i) { if (Model->kim_cutoff_values[i] < cutoffs[i]) return true; } @@ -666,13 +716,6 @@ void PairKIM::kim_free() } kim_init_ok = false; - if (kim_particle_codes_ok) - { - delete [] kim_particle_codes; - kim_particle_codes = 0; - kim_particle_codes_ok = false; - } - return; } @@ -713,32 +756,17 @@ void PairKIM::kim_init() // determine KIM Model capabilities (used in this function below) set_kim_model_has_flags(); - // setup mapping between LAMMPS unique elements and KIM species codes - kim_particle_codes = new int[lmps_num_unique_elements]; - kim_particle_codes_ok = true; - for(int i = 0; i < lmps_num_unique_elements; i++){ - int kimerror; - int supported; - int code; - kimerror = pkim->GetSpeciesSupportAndCode( - KIM::SpeciesName(lmps_unique_elements[i]), - &supported, - &code); - if (supported) - kim_particle_codes[i] = code; - else - error->all(FLERR,"create_kim_particle_codes: symbol not found "); - } - pkim->GetInfluenceDistance(&kim_global_influence_distance); - pkim->GetNeighborListCutoffsPointer(&kim_number_of_cutoffs, - &kim_cutoff_values); + pkim->GetNeighborListPointers(&kim_number_of_neighbor_lists, + &kim_cutoff_values, + &padding_neighbor_hints, + &half_list_hints); if (neighborLists) { delete [] neighborLists; neighborLists = 0; } - neighborLists = new NeighList*[kim_number_of_cutoffs]; + neighborLists = new NeighList*[kim_number_of_neighbor_lists]; kimerror = pargs->SetArgumentPointer( KIM::COMPUTE_ARGUMENT_NAME::numberOfParticles, @@ -932,7 +960,7 @@ void PairKIM::set_kim_model_has_flags() int kimerror = GetComputeArgumentName(i, &computeArgumentName); KIM::SupportStatus supportStatus; kimerror = pargs->GetArgumentSupportStatus(computeArgumentName, - &supportStatus); + &supportStatus); if (computeArgumentName == partialEnergy) kim_model_support_for_energy = supportStatus; @@ -958,12 +986,10 @@ void PairKIM::set_kim_model_has_flags() error->warning(FLERR,"KIM Model does not provide `partialForce'; " "Forces will be zero"); - if ((no_virial_fdotr_compute == 1) && - (kim_model_support_for_virial == notSupported)) + if (kim_model_support_for_virial == notSupported) { error->warning(FLERR,"KIM Model does not provide `partialVirial'. " - "pair_kim now using `LAMMPSvirial' option."); - no_virial_fdotr_compute = 0; + "pair_kim will always use `LAMMPSvirial' option."); } if (kim_model_support_for_particleEnergy == notSupported) diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index a236a3f87a..8929fd2b75 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -12,13 +12,11 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Ryan S. Elliott, - Valeriu Smirichinski, - Ellad Tadmor (U Minn) + Contributing authors: Ryan S. Elliott (UMinn) ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Designed for use with the kim-api-v1.6.0 (and newer) package + Designed for use with the kim-api-v2.0.0-beta.1 (and newer) package ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS @@ -100,8 +98,10 @@ namespace LAMMPS_NS { bool kim_init_ok; int lmps_local_tot_num_atoms; double kim_global_influence_distance; // KIM Model cutoff value - int kim_number_of_cutoffs; + int kim_number_of_neighbor_lists; double const * kim_cutoff_values; + int const * padding_neighbor_hints; + int const * half_list_hints; class NeighList ** neighborLists; // values set in init_style()