From dde94c28a7c63fabed4247c94f8d0182e4cc9830 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Mon, 13 Nov 2017 09:07:25 -0700 Subject: [PATCH 01/34] new example scripts for fix gcmc --- examples/gcmc/in.gcmc.co2 | 11 +- examples/gcmc/in.gcmc.h2o | 11 +- examples/gcmc/in.gcmc.lj | 11 +- examples/gcmc/log.6Jul17.gcmc.co2.g++.1 | 99 ++++++++------ examples/gcmc/log.6Jul17.gcmc.co2.g++.4 | 105 +++++++------- examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 | 169 ++++++++++++----------- examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 | 175 +++++++++++++----------- examples/gcmc/log.6Jul17.gcmc.lj.g++.1 | 59 ++++---- examples/gcmc/log.6Jul17.gcmc.lj.g++.4 | 59 ++++---- 9 files changed, 397 insertions(+), 302 deletions(-) diff --git a/examples/gcmc/in.gcmc.co2 b/examples/gcmc/in.gcmc.co2 index d11ef72fdd..128f05b489 100644 --- a/examples/gcmc/in.gcmc.co2 +++ b/examples/gcmc/in.gcmc.co2 @@ -67,6 +67,15 @@ variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol & co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +# atom counts + +variable carbon atom "type==1" +variable oxygen atom "type==2" +group carbon dynamic all var carbon +group oxygen dynamic all var oxygen +variable nC equal count(carbon) +variable nO equal count(oxygen) + # output variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) @@ -74,7 +83,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO thermo 1000 # run diff --git a/examples/gcmc/in.gcmc.h2o b/examples/gcmc/in.gcmc.h2o index 7ffaafa975..2c03b1ab78 100644 --- a/examples/gcmc/in.gcmc.h2o +++ b/examples/gcmc/in.gcmc.h2o @@ -72,6 +72,15 @@ variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol & h2omol tfac_insert ${tfac} group h2o shake wshake +# atom counts + +variable oxygen atom "type==1" +variable hydrogen atom "type==2" +group oxygen dynamic all var oxygen +group hydrogen dynamic all var hydrogen +variable nO equal count(oxygen) +variable nH equal count(hydrogen) + # output variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) @@ -79,7 +88,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH thermo 1000 # run diff --git a/examples/gcmc/in.gcmc.lj b/examples/gcmc/in.gcmc.lj index fc9afdb7f8..3fe78efb25 100644 --- a/examples/gcmc/in.gcmc.lj +++ b/examples/gcmc/in.gcmc.lj @@ -33,6 +33,12 @@ mass * 1.0 fix mygcmc all gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +# atom count + +variable type1 atom "type==1" +group type1 dynamic all var type1 +variable n1 equal count(type1) + # averaging variable rho equal density @@ -40,10 +46,11 @@ variable p equal press variable nugget equal 1.0e-8 variable lambda equal 1.0 variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) -fix ave all ave/time 10 100 1000 v_rho v_p v_muex ave one file rho_vs_p.dat +fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat variable rhoav equal f_ave[1] variable pav equal f_ave[2] variable muexav equal f_ave[3] +variable n1av equal f_ave[4] # output @@ -51,7 +58,7 @@ variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) compute_modify thermo_temp dynamic yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av thermo 1000 # run diff --git a/examples/gcmc/log.6Jul17.gcmc.co2.g++.1 b/examples/gcmc/log.6Jul17.gcmc.co2.g++.1 index f9e494c43f..38bfa0bb87 100644 --- a/examples/gcmc/log.6Jul17.gcmc.co2.g++.1 +++ b/examples/gcmc/log.6Jul17.gcmc.co2.g++.1 @@ -1,4 +1,5 @@ -LAMMPS (6 Jul 2017) +LAMMPS (22 Sep 2017) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) using 1 OpenMP thread(s) per MPI task # GCMC for CO2 molecular fluid, rigid/small/nvt dynamics # Rigid CO2 TraPPE model @@ -46,6 +47,7 @@ Read molecule co2mol: 0 impropers with 0 types create_atoms 0 box mol co2mol 464563 units box Created 24 atoms + Time spent = 0.00136113 secs # rigid CO2 TraPPE model @@ -87,6 +89,17 @@ fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt +# atom counts + +variable carbon atom "type==1" +variable oxygen atom "type==2" +group carbon dynamic all var carbon +dynamic group carbon defined +group oxygen dynamic all var oxygen +dynamic group oxygen defined +variable nC equal count(carbon) +variable nO equal count(oxygen) + # output variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) @@ -94,7 +107,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO thermo 1000 # run @@ -110,7 +123,7 @@ WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) 0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc 0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -124,57 +137,57 @@ Neighbor list info ... stencil: half/bin/3d/newton bin: standard Per MPI rank memory allocation (min/avg/max) = 15.62 | 15.62 | 15.62 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc - 0 364.27579 4238.8631 -9.6809388 13.391989 0.5846359 24 0 0 0 0 +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO + 0 364.27579 4238.8631 -9.6809388 13.391989 0.5846359 24 0 0 0 0 8 16 WARNING: Using kspace solver on system with no charge (../kspace.cpp:289) - 1000 420.43475 1722.4052 -9.6956123 15.456579 0.5846359 24 0.20879341 0.20713005 0 0 - 2000 302.29516 -547.83641 -22.017674 14.11699 0.73079488 30 0.1742478 0.1678018 0 0 - 3000 316.6934 -1080.2672 -8.2218891 10.069364 0.51155641 21 0.13544917 0.13720634 0 0 - 4000 246.81618 -679.83642 -14.577244 10.29997 0.65771539 27 0.1568939 0.15860229 0 0 - 5000 260.22849 -896.29914 -16.097593 10.859684 0.65771539 27 0.13138744 0.13547049 0 0 - 6000 291.70796 -1521.99 -22.303136 13.622574 0.73079488 30 0.12615476 0.12717694 0 0 - 7000 236.02638 -599.92186 -27.580831 13.367447 0.87695385 36 0.119703 0.12145398 0 0 - 8000 321.45341 688.10577 -10.09204 11.817696 0.5846359 24 0.10917411 0.11032646 0 0 - 9000 502.85382 -302.31056 -0.22330142 0.99927447 0.073079488 3 0.1254105 0.12905828 0 0 - 10000 249.98239 -510.0091 -32.815145 15.399767 0.95003334 39 0.1274504 0.12875623 0 0 - 11000 247.59424 -1129.0274 -25.320205 12.792544 0.80387436 33 0.11739076 0.11916784 0 0 - 12000 0 -20.39554 -0.14872889 -0 0 0 0.1254933 0.12920375 0 0 - 13000 1272.2738 -474.79484 -0.29450485 8.8489483 0.14615898 6 0.13767133 0.14112496 0 0 - 14000 516.54246 -36.296516 -5.0012009 11.291243 0.36539744 15 0.15632744 0.15955377 0 0 - 15000 307.09233 1951.9301 -14.820362 12.815375 0.65771539 27 0.15393544 0.15716192 0 0 - 16000 198.31989 -559.48443 -30.459487 11.231925 0.87695385 36 0.1482565 0.15025652 0 0 - 17000 246.99311 657.85683 -18.579206 11.53442 0.73079488 30 0.14143958 0.14375423 0 0 - 18000 467.13468 167.03738 -1.0945268 5.569759 0.21923846 9 0.13847359 0.14098533 0 0 - 19000 359.54027 -1413.5407 -12.156233 13.217895 0.5846359 24 0.15169146 0.15294205 0 0 - 20000 227.79597 -1204.5652 -23.24144 10.637925 0.73079488 30 0.14917199 0.15022946 0 0 -Loop time of 20.153 on 1 procs for 20000 steps with 30 atoms + 1000 420.43475 1722.4052 -9.6956122 15.456579 0.5846359 24 0.20879341 0.20713005 0 0 8 16 + 2000 302.29516 -547.83642 -22.017674 14.11699 0.73079488 30 0.1742478 0.1678018 0 0 10 20 + 3000 316.6934 -1080.2673 -8.2218902 10.069364 0.51155641 21 0.13544917 0.13720634 0 0 7 14 + 4000 246.81614 -679.83628 -14.57724 10.299968 0.65771539 27 0.1568939 0.15860229 0 0 9 18 + 5000 260.23291 -896.27949 -16.097524 10.859868 0.65771539 27 0.13138744 0.13547049 0 0 9 18 + 6000 291.64889 -1524.1007 -22.306243 13.619816 0.73079488 30 0.12615476 0.12717694 0 0 10 20 + 7000 235.90417 -565.40879 -27.600934 13.360525 0.87695385 36 0.119703 0.12145398 0 0 12 24 + 8000 483.381 2017.6258 -7.1315833 15.369247 0.51155641 21 0.10942279 0.11082908 0 0 7 14 + 9000 468.87446 -285.22545 -0.22330095 0.93175047 0.073079488 3 0.13029748 0.13349433 0 0 1 2 + 10000 245.34708 -254.65444 -16.192443 11.457551 0.73079488 30 0.15023549 0.15176828 0 0 10 20 + 11000 233.27704 523.81197 -24.29051 12.052812 0.80387436 33 0.1438083 0.14547187 0 0 11 22 + 12000 230.75966 -2161.9134 -23.812352 11.922746 0.80387436 33 0.1338274 0.13534617 0 0 11 22 + 13000 216.09982 -930.72014 -23.138263 11.16531 0.80387436 33 0.12480714 0.12612138 0 0 11 22 + 14000 343.12403 -327.36241 -16.995149 16.023672 0.73079488 30 0.12006081 0.12108416 0 0 10 20 + 15000 369.60805 581.40471 -11.495738 13.588021 0.5846359 24 0.11372814 0.11534691 0 0 8 16 + 16000 221.23125 -918.58249 -30.702491 12.529519 0.87695385 36 0.11489536 0.11560548 0 0 12 24 + 17000 301.82269 -450.56586 -14.373996 12.595466 0.65771539 27 0.11226626 0.11350321 0 0 9 18 + 18000 1065.1385 474.31881 -0.45476519 7.4082761 0.14615898 6 0.11419593 0.11580815 0 0 2 4 + 19000 217.29422 -1111.0114 -12.048289 7.988458 0.5846359 24 0.12564213 0.1261457 0 0 8 16 + 20000 353.35515 465.29269 -6.8428553 9.4795613 0.43847693 18 0.12529827 0.12590018 0 0 6 12 +Loop time of 14.604 on 1 procs for 20000 steps with 18 atoms -Performance: 85.744 ns/day, 0.280 hours/ns, 992.408 timesteps/s -99.3% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 118.323 ns/day, 0.203 hours/ns, 1369.484 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 2.5352 | 2.5352 | 2.5352 | 0.0 | 12.58 -Bond | 0.026112 | 0.026112 | 0.026112 | 0.0 | 0.13 -Kspace | 0.25 | 0.25 | 0.25 | 0.0 | 1.24 -Neigh | 0.10364 | 0.10364 | 0.10364 | 0.0 | 0.51 -Comm | 0.22907 | 0.22907 | 0.22907 | 0.0 | 1.14 -Output | 0.0013065 | 0.0013065 | 0.0013065 | 0.0 | 0.01 -Modify | 16.957 | 16.957 | 16.957 | 0.0 | 84.14 -Other | | 0.05061 | | | 0.25 +Pair | 1.8966 | 1.8966 | 1.8966 | 0.0 | 12.99 +Bond | 0.019538 | 0.019538 | 0.019538 | 0.0 | 0.13 +Kspace | 0.14784 | 0.14784 | 0.14784 | 0.0 | 1.01 +Neigh | 0.070002 | 0.070002 | 0.070002 | 0.0 | 0.48 +Comm | 0.15055 | 0.15055 | 0.15055 | 0.0 | 1.03 +Output | 0.0017672 | 0.0017672 | 0.0017672 | 0.0 | 0.01 +Modify | 12.287 | 12.287 | 12.287 | 0.0 | 84.13 +Other | | 0.03089 | | | 0.21 -Nlocal: 30 ave 30 max 30 min +Nlocal: 18 ave 18 max 18 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 2310 ave 2310 max 2310 min +Nghost: 1335 ave 1335 max 1335 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 7736 ave 7736 max 7736 min +Neighs: 2797 ave 2797 max 2797 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 7736 -Ave neighs/atom = 257.867 +Total # of neighbors = 2797 +Ave neighs/atom = 155.389 Ave special neighs/atom = 2 -Neighbor list builds = 20349 +Neighbor list builds = 20401 Dangerous builds = 0 -Total wall time: 0:00:20 +Total wall time: 0:00:14 diff --git a/examples/gcmc/log.6Jul17.gcmc.co2.g++.4 b/examples/gcmc/log.6Jul17.gcmc.co2.g++.4 index 0df25430d2..6b39fda263 100644 --- a/examples/gcmc/log.6Jul17.gcmc.co2.g++.4 +++ b/examples/gcmc/log.6Jul17.gcmc.co2.g++.4 @@ -1,4 +1,5 @@ -LAMMPS (6 Jul 2017) +LAMMPS (22 Sep 2017) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) using 1 OpenMP thread(s) per MPI task # GCMC for CO2 molecular fluid, rigid/small/nvt dynamics # Rigid CO2 TraPPE model @@ -46,6 +47,7 @@ Read molecule co2mol: 0 impropers with 0 types create_atoms 0 box mol co2mol 464563 units box Created 24 atoms + Time spent = 0.00223303 secs # rigid CO2 TraPPE model @@ -87,6 +89,17 @@ fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt +# atom counts + +variable carbon atom "type==1" +variable oxygen atom "type==2" +group carbon dynamic all var carbon +dynamic group carbon defined +group oxygen dynamic all var oxygen +dynamic group oxygen defined +variable nC equal count(carbon) +variable nO equal count(oxygen) + # output variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) @@ -94,7 +107,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO thermo 1000 # run @@ -110,7 +123,7 @@ WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) 0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc 0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 @@ -124,57 +137,57 @@ Neighbor list info ... stencil: half/bin/3d/newton bin: standard Per MPI rank memory allocation (min/avg/max) = 15.41 | 15.41 | 15.41 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc - 0 386.52184 23582.465 -3.2433417 14.209828 0.5846359 24 0 0 0 0 +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO + 0 386.52184 23582.465 -3.2433417 14.209828 0.5846359 24 0 0 0 0 8 16 WARNING: Using kspace solver on system with no charge (../kspace.cpp:289) - 1000 335.66829 -3.7743052 -4.6268612 7.3374649 0.36539744 15 0.20601899 0.20787963 0 0 - 2000 459.73529 238.91592 -0.42937831 5.4815343 0.21923846 9 0.30392058 0.30105616 0 0 - 3000 255.47773 -479.67802 -36.850434 15.738299 0.95003334 39 0.22220744 0.2197582 0 0 - 4000 182.70803 -1059.2262 -43.044833 12.163134 1.0231128 42 0.16781689 0.16716177 0 0 - 5000 234.00907 -1821.0444 -46.04795 15.578317 1.0231128 42 0.13498091 0.13704201 0 0 - 6000 163.42759 -774.67294 -49.686261 11.691518 1.0961923 45 0.11401677 0.11296973 0 0 - 7000 171.64616 -355.23516 -49.323434 12.27947 1.0961923 45 0.098302308 0.098552065 0 0 - 8000 251.29791 -905.47863 -37.841209 15.480807 0.95003334 39 0.086856972 0.08638658 0 0 - 9000 143.69498 -849.95393 -49.073188 10.279858 1.0961923 45 0.078261061 0.077955243 0 0 - 10000 239.35727 -1158.1879 -43.562047 15.934355 1.0231128 42 0.070789792 0.070807529 0 0 - 11000 169.51213 -1574.7885 -51.125228 12.126803 1.0961923 45 0.065008734 0.06498871 0 0 - 12000 181.39739 160.11631 -46.850937 12.977068 1.0961923 45 0.059648717 0.059514803 0 0 - 13000 164.14601 -1107.7629 -50.726722 11.742914 1.0961923 45 0.055207333 0.055097701 0 0 - 14000 287.26285 418.51463 -41.664766 19.123497 1.0231128 42 0.051346789 0.051222285 0 0 - 15000 256.94593 -532.36615 -41.651618 17.105257 1.0231128 42 0.047870301 0.047861685 0 0 - 16000 166.92132 151.15933 -39.957018 11.11219 1.0231128 42 0.045205599 0.045042211 0 0 - 17000 163.22452 -1299.8119 -42.677558 10.866089 1.0231128 42 0.043122086 0.042993687 0 0 - 18000 158.01154 475.77329 -48.803162 11.304057 1.0961923 45 0.041016683 0.040647229 0 0 - 19000 138.49297 -1585.1508 -47.517099 9.9077098 1.0961923 45 0.038929287 0.038436764 0 0 - 20000 173.84439 -1362.6301 -53.002743 12.436731 1.0961923 45 0.036973919 0.036523816 0 0 -Loop time of 31.8386 on 4 procs for 20000 steps with 45 atoms + 1000 335.66829 -3.7743052 -4.6268612 7.3374649 0.36539744 15 0.20601899 0.20787963 0 0 5 10 + 2000 459.73529 238.91592 -0.42937831 5.4815343 0.21923846 9 0.30392058 0.30105616 0 0 3 6 + 3000 255.47773 -479.67802 -36.850434 15.738299 0.95003334 39 0.22220744 0.2197582 0 0 13 26 + 4000 182.70803 -1059.2265 -43.04484 12.163134 1.0231128 42 0.16781689 0.16716177 0 0 14 28 + 5000 234.00901 -1821.0459 -46.047939 15.578313 1.0231128 42 0.13498091 0.13704201 0 0 14 28 + 6000 163.42358 -774.64962 -49.686149 11.691232 1.0961923 45 0.11401677 0.11296973 0 0 15 30 + 7000 171.36765 -359.28792 -49.34022 12.259546 1.0961923 45 0.098302308 0.098552065 0 0 15 30 + 8000 215.2905 -905.73479 -38.206404 13.262629 0.95003334 39 0.086608098 0.086135456 0 0 13 26 + 9000 185.19905 -2320.8255 -52.964346 13.249037 1.0961923 45 0.077379246 0.077059206 0 0 15 30 + 10000 241.5783 -1410.8134 -51.37248 17.282377 1.0961923 45 0.069600048 0.069395413 0 0 15 30 + 11000 153.38332 -2647.9572 -53.967244 10.972957 1.0961923 45 0.063207938 0.06315287 0 0 15 30 + 12000 188.93059 -1639.9304 -52.218219 13.515989 1.0961923 45 0.05816163 0.058001715 0 0 15 30 + 13000 243.39974 -1127.2881 -44.54519 16.203468 1.0231128 42 0.053682268 0.053700858 0 0 14 28 + 14000 200.88474 -272.11992 -41.725507 13.373183 1.0231128 42 0.050212054 0.050071222 0 0 14 28 + 15000 204.6505 -1616.9057 -44.631997 13.623875 1.0231128 42 0.046944632 0.046920585 0 0 14 28 + 16000 169.22546 105.40991 -42.46103 11.26558 1.0231128 42 0.044460451 0.044287314 0 0 14 28 + 17000 163.55389 -783.34837 -36.841459 10.075477 0.95003334 39 0.042304052 0.042283048 0 0 13 26 + 18000 499.48334 -503.24838 -8.94456 15.881226 0.51155641 21 0.04035334 0.040870565 0 0 7 14 + 19000 658.81004 391.68747 -2.6979013 11.12813 0.29231795 12 0.055391781 0.056188676 0 0 4 8 + 20000 489.87356 -122.40743 -13.636951 18.00938 0.5846359 24 0.061378424 0.061821941 0 0 8 16 +Loop time of 17.1274 on 4 procs for 20000 steps with 24 atoms -Performance: 54.274 ns/day, 0.442 hours/ns, 628.168 timesteps/s -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 100.891 ns/day, 0.238 hours/ns, 1167.718 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 1.1546 | 1.6687 | 2.1338 | 29.5 | 5.24 -Bond | 0.019769 | 0.020369 | 0.02132 | 0.4 | 0.06 -Kspace | 0.53392 | 0.99911 | 1.5116 | 37.8 | 3.14 -Neigh | 0.06737 | 0.067842 | 0.068412 | 0.2 | 0.21 -Comm | 1.9408 | 1.9582 | 1.9733 | 1.1 | 6.15 -Output | 0.0019503 | 0.0020472 | 0.0022476 | 0.3 | 0.01 -Modify | 26.974 | 26.99 | 27.001 | 0.2 | 84.77 -Other | | 0.1322 | | | 0.42 +Pair | 0.81646 | 1.1504 | 1.4937 | 23.0 | 6.72 +Bond | 0.011878 | 0.012255 | 0.013296 | 0.5 | 0.07 +Kspace | 0.23802 | 0.58086 | 0.91304 | 32.3 | 3.39 +Neigh | 0.04321 | 0.043291 | 0.043372 | 0.0 | 0.25 +Comm | 0.90855 | 0.90959 | 0.91112 | 0.1 | 5.31 +Output | 0.0011697 | 0.0012506 | 0.001482 | 0.4 | 0.01 +Modify | 14.362 | 14.365 | 14.367 | 0.1 | 83.87 +Other | | 0.06436 | | | 0.38 -Nlocal: 11.25 ave 14 max 8 min -Histogram: 1 0 0 0 0 1 1 0 0 1 -Nghost: 2639.75 ave 2656 max 2617 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Neighs: 4320 ave 5824 max 2201 min -Histogram: 1 0 0 0 0 0 1 1 0 1 +Nlocal: 6 ave 8 max 4 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Nghost: 1465.25 ave 1556 max 1376 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 1243.5 ave 1726 max 748 min +Histogram: 1 0 0 1 0 0 1 0 0 1 -Total # of neighbors = 17280 -Ave neighs/atom = 384 +Total # of neighbors = 4974 +Ave neighs/atom = 207.25 Ave special neighs/atom = 2 -Neighbor list builds = 20394 +Neighbor list builds = 20375 Dangerous builds = 0 -Total wall time: 0:00:31 +Total wall time: 0:00:17 diff --git a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 b/examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 index 3b1606e65d..a40760d25f 100644 --- a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 +++ b/examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 @@ -1,4 +1,5 @@ -LAMMPS (6 Jul 2017) +LAMMPS (22 Sep 2017) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) using 1 OpenMP thread(s) per MPI task # fix gcmc example with fix shake @@ -51,6 +52,7 @@ Read molecule h2omol: 0 impropers with 0 types create_atoms 0 box mol h2omol 464563 units box Created 24 atoms + Time spent = 0.00136209 secs # rigid SPC/E water model @@ -99,41 +101,41 @@ Neighbor list info ... Per MPI rank memory allocation (min/avg/max) = 11.88 | 11.88 | 11.88 Mbytes Step Temp E_pair E_mol TotEng Press 0 338 -4.1890564 9.2628112e-06 18.98377 739.06991 - 100 338 -30.182886 0.85607237 -6.1539961 -2535.3207 -Loop time of 0.0525794 on 1 procs for 100 steps with 24 atoms + 100 338 -27.771871 0.61137788 -3.9876753 -2259.9107 +Loop time of 0.0333829 on 1 procs for 100 steps with 24 atoms -99.4% CPU use with 1 MPI tasks x 1 OpenMP threads +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads Minimization stats: Stopping criterion = max iterations Energy initial, next-to-last, final = - -4.18904713252 -28.9258064504 -29.3268133965 - Force two-norm initial, final = 18.0027 42.4511 - Force max component initial, final = 5.8993 16.0523 - Final line search alpha, max atom move = 0.00353207 0.056698 - Iterations, force evaluations = 100 238 + -4.18904713252 -26.8589493819 -27.1604926722 + Force two-norm initial, final = 18.0027 28.6823 + Force max component initial, final = 5.8993 11.77 + Final line search alpha, max atom move = 0.00301381 0.0354725 + Iterations, force evaluations = 100 239 MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.044199 | 0.044199 | 0.044199 | 0.0 | 84.06 -Bond | 0.00049019 | 0.00049019 | 0.00049019 | 0.0 | 0.93 -Kspace | 0.0031631 | 0.0031631 | 0.0031631 | 0.0 | 6.02 -Neigh | 0.00046444 | 0.00046444 | 0.00046444 | 0.0 | 0.88 -Comm | 0.0034101 | 0.0034101 | 0.0034101 | 0.0 | 6.49 -Output | 1.9073e-05 | 1.9073e-05 | 1.9073e-05 | 0.0 | 0.04 +Pair | 0.028252 | 0.028252 | 0.028252 | 0.0 | 84.63 +Bond | 0.00025415 | 0.00025415 | 0.00025415 | 0.0 | 0.76 +Kspace | 0.0017328 | 0.0017328 | 0.0017328 | 0.0 | 5.19 +Neigh | 0.00038004 | 0.00038004 | 0.00038004 | 0.0 | 1.14 +Comm | 0.0022359 | 0.0022359 | 0.0022359 | 0.0 | 6.70 +Output | 2.1935e-05 | 2.1935e-05 | 2.1935e-05 | 0.0 | 0.07 Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.0008333 | | | 1.58 +Other | | 0.0005062 | | | 1.52 Nlocal: 24 ave 24 max 24 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 2047 ave 2047 max 2047 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 4936 ave 4936 max 4936 min +Neighs: 4939 ave 4939 max 4939 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 4936 -Ave neighs/atom = 205.667 +Total # of neighbors = 4939 +Ave neighs/atom = 205.792 Ave special neighs/atom = 2 Neighbor list builds = 2 Dangerous builds = 0 @@ -162,36 +164,36 @@ WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) kxmax kymax kzmax = 2 2 2 Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes Step Temp E_pair E_mol TotEng Press - 0 518.26667 -30.182886 0 -7.0100684 993.1985 - 1000 326.9865 -62.258445 0 -47.638175 -5.3440813 -Loop time of 0.14263 on 1 procs for 1000 steps with 24 atoms + 0 518.26667 -27.771871 0 -4.5990532 3.1322213 + 1000 277.5448 -45.272615 0 -32.86299 -1575.2641 +Loop time of 0.101694 on 1 procs for 1000 steps with 24 atoms -Performance: 605.764 ns/day, 0.040 hours/ns, 7011.155 timesteps/s -99.5% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 849.609 ns/day, 0.028 hours/ns, 9833.435 timesteps/s +99.2% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.10849 | 0.10849 | 0.10849 | 0.0 | 76.07 -Bond | 0.00015426 | 0.00015426 | 0.00015426 | 0.0 | 0.11 -Kspace | 0.01205 | 0.01205 | 0.01205 | 0.0 | 8.45 -Neigh | 0.0046577 | 0.0046577 | 0.0046577 | 0.0 | 3.27 -Comm | 0.011531 | 0.011531 | 0.011531 | 0.0 | 8.08 -Output | 1.6212e-05 | 1.6212e-05 | 1.6212e-05 | 0.0 | 0.01 -Modify | 0.0037699 | 0.0037699 | 0.0037699 | 0.0 | 2.64 -Other | | 0.001957 | | | 1.37 +Pair | 0.078345 | 0.078345 | 0.078345 | 0.0 | 77.04 +Bond | 0.00010109 | 0.00010109 | 0.00010109 | 0.0 | 0.10 +Kspace | 0.0079424 | 0.0079424 | 0.0079424 | 0.0 | 7.81 +Neigh | 0.003454 | 0.003454 | 0.003454 | 0.0 | 3.40 +Comm | 0.0080469 | 0.0080469 | 0.0080469 | 0.0 | 7.91 +Output | 1.9073e-05 | 1.9073e-05 | 1.9073e-05 | 0.0 | 0.02 +Modify | 0.0026064 | 0.0026064 | 0.0026064 | 0.0 | 2.56 +Other | | 0.001179 | | | 1.16 Nlocal: 24 ave 24 max 24 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1660 ave 1660 max 1660 min +Nghost: 1688 ave 1688 max 1688 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 5112 ave 5112 max 5112 min +Neighs: 4952 ave 4952 max 4952 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 5112 -Ave neighs/atom = 213 +Total # of neighbors = 4952 +Ave neighs/atom = 206.333 Ave special neighs/atom = 2 -Neighbor list builds = 25 +Neighbor list builds = 26 Dangerous builds = 0 variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) @@ -201,6 +203,17 @@ fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake +# atom counts + +variable oxygen atom "type==1" +variable hydrogen atom "type==2" +group oxygen dynamic all var oxygen +dynamic group oxygen defined +group hydrogen dynamic all var hydrogen +dynamic group hydrogen defined +variable nO equal count(oxygen) +variable nH equal count(hydrogen) + # output variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) @@ -208,7 +221,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH thermo 1000 # run @@ -224,58 +237,58 @@ WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) 0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc 0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc - 1000 326.9865 -4.3509713 -62.258445 14.62027 0.23910963 24 0 0 0 0 - 2000 116.99793 -5344.1527 -286.61595 17.088682 0.74721761 75 0.048183096 0.013941446 0 0 - 3000 106.86746 -3920.4926 -361.60598 18.794545 0.89666113 90 0.035637919 0.012768883 0 0 - 4000 75.002668 540.46846 -414.8511 14.531966 0.98632724 99 0.025963651 0.0093451705 0 0 - 5000 79.924788 -2131.1173 -437.21216 15.962121 1.0162159 102 0.019879728 0.0070418993 0 0 - 6000 95.552773 -3647.0233 -438.24276 19.083253 1.0162159 102 0.015753613 0.0056885133 0 0 - 7000 79.501736 -2071.5369 -440.77351 15.877631 1.0162159 102 0.01326216 0.0046915318 0 0 - 8000 62.567091 -3102.9616 -442.21884 12.495541 1.0162159 102 0.011305503 0.0040437885 0 0 - 9000 68.324047 -3812.7866 -440.46835 13.645287 1.0162159 102 0.0099549538 0.0035157329 0 0 - 10000 83.857631 -2158.2659 -444.8183 16.747566 1.0162159 102 0.0088200922 0.0031354281 0 0 - 11000 68.350984 -2084.0789 -440.14081 13.650667 1.0162159 102 0.0081331455 0.0030247424 0 0 - 12000 76.867315 -1585.6723 -443.36199 15.3515 1.0162159 102 0.0073845932 0.0027532534 0 0 - 13000 59.74266 -2211.0211 -446.07791 11.931462 1.0162159 102 0.0067756276 0.0025213898 0 0 - 14000 81.154979 -907.0176 -441.53368 16.207808 1.0162159 102 0.0062527642 0.0023280719 0 0 - 15000 66.814346 -2804.5134 -455.80704 13.7421 1.0461046 105 0.0059590528 0.0021576214 0 0 - 16000 71.42983 -3930.4004 -458.43218 14.691394 1.0461046 105 0.0055547473 0.0020163729 0 0 - 17000 89.624855 -3569.8136 -455.18164 18.433672 1.0461046 105 0.0052173265 0.0018867687 0 0 - 18000 63.519962 -1882.8157 -456.58939 13.064525 1.0461046 105 0.0049082049 0.0017765986 0 0 - 19000 71.872698 -2243.5046 -454.93359 14.782481 1.0461046 105 0.0046439115 0.0016748361 0 0 - 20000 73.660765 -2285.3173 -476.35473 15.589381 1.0759934 108 0.0045124933 0.0015837653 0 0 - 21000 95.675868 987.92089 -475.46736 20.248603 1.0759934 108 0.004285814 0.0015049513 0 0 -Loop time of 226.155 on 1 procs for 20000 steps with 108 atoms +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH + 1000 277.5448 -1575.1516 -45.272615 12.409625 0.23910963 24 0 0 0 0 8 16 + 2000 84.31104 -7419.6538 -330.36966 13.319705 0.80699501 81 0.048183096 0.0099581757 0 0 27 54 + 3000 79.654082 -7034.6542 -345.84563 13.058853 0.83688372 84 0.027492109 0.0068755525 0 0 28 56 + 4000 73.831702 -3905.1456 -380.27757 12.984619 0.89666113 90 0.020637774 0.0060076096 0 0 30 60 + 5000 95.397292 -3523.6886 -414.9618 18.483479 0.98632724 99 0.016897769 0.0045269353 0 0 33 66 + 6000 74.46018 -4913.3009 -425.33102 14.426857 0.98632724 99 0.013390571 0.0036569014 0 0 33 66 + 7000 59.601812 -3108.7781 -425.91441 11.548009 0.98632724 99 0.01160439 0.0033510941 0 0 33 66 + 8000 74.104787 -1710.7687 -444.03326 14.799784 1.0162159 102 0.010174953 0.0028884203 0 0 34 68 + 9000 92.497957 -1255.2193 -435.57266 18.473162 1.0162159 102 0.0089594585 0.0025112378 0 0 34 68 + 10000 71.075249 -3191.4633 -454.19438 14.618465 1.0461046 105 0.0081585853 0.0022395915 0 0 35 70 + 11000 60.402203 -2011.6602 -461.68383 12.423277 1.0461046 105 0.0073396679 0.0020164949 0 0 35 70 + 12000 92.903919 -3023.4452 -462.20701 19.108096 1.0461046 105 0.0066641451 0.0018355023 0 0 35 70 + 13000 51.285407 -1016.3672 -466.29402 10.548172 1.0461046 105 0.0061145907 0.0016809265 0 0 35 70 + 14000 72.733554 -3284.3632 -463.38578 14.959539 1.0461046 105 0.0056427384 0.0015520479 0 0 35 70 + 15000 76.324778 -1795.0839 -477.59722 16.153186 1.0759934 108 0.005391524 0.0014384143 0 0 36 72 + 16000 78.185379 345.92387 -481.1903 16.546959 1.0759934 108 0.0050257238 0.0013442486 0 0 36 72 + 17000 79.868226 -3095.839 -478.59141 16.903113 1.0759934 108 0.0047204383 0.0012578458 0 0 36 72 + 18000 69.578814 -1884.4164 -482.28013 14.725487 1.0759934 108 0.0044407568 0.0011843991 0 0 36 72 + 19000 73.973471 -1943.8906 -480.82986 15.655561 1.0759934 108 0.0042016342 0.0011165574 0 0 36 72 + 20000 59.614528 -2439.1076 -485.78451 12.616671 1.0759934 108 0.0040927265 0.0011614279 0 0 36 72 + 21000 89.393596 -728.94872 -484.62787 18.919038 1.0759934 108 0.0038871336 0.0011036309 0 0 36 72 +Loop time of 148.361 on 1 procs for 20000 steps with 108 atoms -Performance: 7.641 ns/day, 3.141 hours/ns, 88.435 timesteps/s -99.2% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 11.647 ns/day, 2.061 hours/ns, 134.806 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 38.053 | 38.053 | 38.053 | 0.0 | 16.83 -Bond | 0.089673 | 0.089673 | 0.089673 | 0.0 | 0.04 -Kspace | 0.92778 | 0.92778 | 0.92778 | 0.0 | 0.41 -Neigh | 1.2619 | 1.2619 | 1.2619 | 0.0 | 0.56 -Comm | 0.97483 | 0.97483 | 0.97483 | 0.0 | 0.43 -Output | 0.0013306 | 0.0013306 | 0.0013306 | 0.0 | 0.00 -Modify | 184.68 | 184.68 | 184.68 | 0.0 | 81.66 -Other | | 0.171 | | | 0.08 +Pair | 26.404 | 26.404 | 26.404 | 0.0 | 17.80 +Bond | 0.058909 | 0.058909 | 0.058909 | 0.0 | 0.04 +Kspace | 0.58222 | 0.58222 | 0.58222 | 0.0 | 0.39 +Neigh | 0.81976 | 0.81976 | 0.81976 | 0.0 | 0.55 +Comm | 0.60514 | 0.60514 | 0.60514 | 0.0 | 0.41 +Output | 0.00070596 | 0.00070596 | 0.00070596 | 0.0 | 0.00 +Modify | 119.77 | 119.77 | 119.77 | 0.0 | 80.73 +Other | | 0.1157 | | | 0.08 Nlocal: 108 ave 108 max 108 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7850 ave 7850 max 7850 min +Nghost: 7908 ave 7908 max 7908 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 99828 ave 99828 max 99828 min +Neighs: 99854 ave 99854 max 99854 min Histogram: 1 0 0 0 0 0 0 0 0 0 -Total # of neighbors = 99828 -Ave neighs/atom = 924.333 +Total # of neighbors = 99854 +Ave neighs/atom = 924.574 Ave special neighs/atom = 2 -Neighbor list builds = 20439 +Neighbor list builds = 20442 Dangerous builds = 0 -Total wall time: 0:03:46 +Total wall time: 0:02:28 diff --git a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 b/examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 index c04b25f45e..9dcc60f849 100644 --- a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 +++ b/examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 @@ -1,4 +1,5 @@ -LAMMPS (6 Jul 2017) +LAMMPS (22 Sep 2017) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) using 1 OpenMP thread(s) per MPI task # fix gcmc example with fix shake @@ -51,6 +52,7 @@ Read molecule h2omol: 0 impropers with 0 types create_atoms 0 box mol h2omol 464563 units box Created 24 atoms + Time spent = 0.00236797 secs # rigid SPC/E water model @@ -99,31 +101,31 @@ Neighbor list info ... Per MPI rank memory allocation (min/avg/max) = 11.85 | 11.85 | 11.85 Mbytes Step Temp E_pair E_mol TotEng Press 0 338 -4.9610706 9.2628112e-06 18.211756 730.90791 - 100 338 -15.742442 0.14954269 7.579918 -637.49568 -Loop time of 0.0828406 on 4 procs for 100 steps with 24 atoms + 100 338 -15.815905 0.10936727 7.4662793 -278.75864 +Loop time of 0.0389402 on 4 procs for 100 steps with 24 atoms -98.7% CPU use with 4 MPI tasks x 1 OpenMP threads +99.0% CPU use with 4 MPI tasks x 1 OpenMP threads Minimization stats: Stopping criterion = max iterations Energy initial, next-to-last, final = - -4.96106135393 -15.5388622715 -15.592899346 - Force two-norm initial, final = 15.474 18.1478 - Force max component initial, final = 5.80042 7.56514 - Final line search alpha, max atom move = 0.00151131 0.0114333 - Iterations, force evaluations = 100 328 + -4.96106135393 -15.696637101 -15.7065379926 + Force two-norm initial, final = 15.474 4.38071 + Force max component initial, final = 5.80042 2.01432 + Final line search alpha, max atom move = 0.00468711 0.00944132 + Iterations, force evaluations = 100 346 MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.012844 | 0.025471 | 0.047008 | 8.1 | 30.75 -Bond | 0.00038934 | 0.00046468 | 0.00054336 | 0.0 | 0.56 -Kspace | 0.0061138 | 0.027556 | 0.04014 | 7.8 | 33.26 +Pair | 0.0067904 | 0.012084 | 0.019882 | 4.5 | 31.03 +Bond | 0.0001657 | 0.00019389 | 0.00022459 | 0.0 | 0.50 +Kspace | 0.0032685 | 0.010629 | 0.015032 | 4.4 | 27.30 Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.023276 | 0.023636 | 0.023804 | 0.1 | 28.53 -Output | 3.171e-05 | 3.3557e-05 | 3.8147e-05 | 0.0 | 0.04 +Comm | 0.013826 | 0.014182 | 0.015051 | 0.4 | 36.42 +Output | 2.0027e-05 | 2.2769e-05 | 3.0994e-05 | 0.0 | 0.06 Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.00568 | | | 6.86 +Other | | 0.001829 | | | 4.70 Nlocal: 6 ave 8 max 3 min Histogram: 1 0 0 0 1 0 0 0 0 2 @@ -162,36 +164,36 @@ WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) kxmax kymax kzmax = 2 2 2 Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes Step Temp E_pair E_mol TotEng Press - 0 518.26667 -15.742442 0 7.4303753 -613.0781 - 1000 369.81793 -54.202686 0 -37.667331 294.98823 -Loop time of 0.199641 on 4 procs for 1000 steps with 24 atoms + 0 518.26667 -15.815905 0 7.3569121 -385.7767 + 1000 240.84589 -44.723106 0 -33.954368 61.365522 +Loop time of 0.0971818 on 4 procs for 1000 steps with 24 atoms -Performance: 432.777 ns/day, 0.055 hours/ns, 5008.996 timesteps/s -98.5% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 889.055 ns/day, 0.027 hours/ns, 10289.993 timesteps/s +99.8% 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.017161 | 0.034988 | 0.05833 | 8.0 | 17.53 -Bond | 0.00017357 | 0.00021374 | 0.00027347 | 0.0 | 0.11 -Kspace | 0.018025 | 0.044624 | 0.065613 | 8.4 | 22.35 -Neigh | 0.0029755 | 0.0033154 | 0.0036366 | 0.6 | 1.66 -Comm | 0.059933 | 0.06537 | 0.070709 | 1.5 | 32.74 -Output | 3.4571e-05 | 3.6657e-05 | 4.22e-05 | 0.0 | 0.02 -Modify | 0.043458 | 0.045628 | 0.04767 | 0.9 | 22.86 -Other | | 0.005465 | | | 2.74 +Pair | 0.010939 | 0.020819 | 0.033432 | 5.8 | 21.42 +Bond | 9.5129e-05 | 0.00010997 | 0.0001266 | 0.0 | 0.11 +Kspace | 0.0058987 | 0.017954 | 0.027383 | 5.9 | 18.47 +Neigh | 0.0018289 | 0.001851 | 0.0018759 | 0.0 | 1.90 +Comm | 0.033144 | 0.033717 | 0.034395 | 0.3 | 34.69 +Output | 1.3113e-05 | 1.6809e-05 | 2.5988e-05 | 0.0 | 0.02 +Modify | 0.020795 | 0.020843 | 0.020866 | 0.0 | 21.45 +Other | | 0.001872 | | | 1.93 -Nlocal: 6 ave 8 max 3 min +Nlocal: 6 ave 9 max 1 min Histogram: 1 0 0 0 0 0 1 0 1 1 -Nghost: 1331.5 ave 1369 max 1290 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Neighs: 1259.75 ave 1642 max 428 min -Histogram: 1 0 0 0 0 0 0 1 0 2 +Nghost: 1375.25 ave 1495 max 1251 min +Histogram: 1 0 0 1 0 0 1 0 0 1 +Neighs: 1263.25 ave 2045 max 122 min +Histogram: 1 0 0 0 0 0 2 0 0 1 -Total # of neighbors = 5039 -Ave neighs/atom = 209.958 +Total # of neighbors = 5053 +Ave neighs/atom = 210.542 Ave special neighs/atom = 2 -Neighbor list builds = 27 +Neighbor list builds = 30 Dangerous builds = 0 variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) @@ -201,6 +203,17 @@ fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake +# atom counts + +variable oxygen atom "type==1" +variable hydrogen atom "type==2" +group oxygen dynamic all var oxygen +dynamic group oxygen defined +group hydrogen dynamic all var hydrogen +dynamic group hydrogen defined +variable nO equal count(oxygen) +variable nH equal count(hydrogen) + # output variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) @@ -208,7 +221,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH thermo 1000 # run @@ -224,58 +237,58 @@ WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) 0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc 0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc - 1000 369.81793 295.32434 -54.202686 16.535355 0.23910963 24 0 0 0 0 - 2000 84.544466 -2810.9047 -344.81664 14.364627 0.86677242 87 0.052198354 0.0099581757 0 0 - 3000 75.188527 -3688.256 -425.02228 14.567977 0.98632724 99 0.030546787 0.0049111089 0 0 - 4000 75.019396 -5669.3063 -427.69454 14.535207 0.98632724 99 0.019972039 0.0033375609 0 0 - 5000 90.415371 -2141.7596 -434.65925 17.518218 0.98632724 99 0.014909796 0.002514964 0 0 - 6000 78.212628 -943.75125 -428.80584 15.153904 0.98632724 99 0.01181521 0.0020316119 0 0 - 7000 71.754139 -2028.5122 -435.2139 13.902555 0.98632724 99 0.0099466198 0.0016755471 0 0 - 8000 84.446231 -1969.1657 -428.27313 16.361681 0.98632724 99 0.0084791272 0.0014442102 0 0 - 9000 70.952348 -2476.9812 -446.33824 14.170197 1.0162159 102 0.0077150892 0.0012556189 0 0 - 10000 71.418543 -1875.7083 -443.7214 14.263302 1.0162159 102 0.0068355714 0.0011197957 0 0 - 11000 86.094994 -4508.7581 -444.82687 17.194399 1.0162159 102 0.0061494515 0.0010082475 0 0 - 12000 81.906091 -1547.8105 -442.36719 16.357815 1.0162159 102 0.0055834729 0.00091775114 0 0 - 13000 57.221548 -4607.6222 -448.30939 11.42796 1.0162159 102 0.0051230355 0.00084046326 0 0 - 14000 61.288344 -2518.1779 -445.70636 12.240157 1.0162159 102 0.0047276997 0.00077602396 0 0 - 15000 85.787669 -2407.7111 -443.3834 17.133022 1.0162159 102 0.0043983485 0.00071920715 0 0 - 16000 74.845939 -3288.3403 -445.8247 14.947802 1.0162159 102 0.0042321884 0.00080654918 0 0 - 17000 73.835431 -1926.9566 -445.67476 14.745989 1.0162159 102 0.0039751059 0.00075470749 0 0 - 18000 72.634985 -3997.552 -447.2351 14.506243 1.0162159 102 0.0037395847 0.00071063946 0 0 - 19000 96.776472 -714.44132 -453.65552 19.904587 1.0461046 105 0.0036487876 0.00066993446 0 0 - 20000 75.470786 183.16972 -464.04688 15.522521 1.0461046 105 0.0034630763 0.00063350614 0 0 - 21000 65.658309 -773.41266 -466.27068 13.504331 1.0461046 105 0.003289113 0.00060198052 0 0 -Loop time of 93.8859 on 4 procs for 20000 steps with 105 atoms +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH + 1000 240.84589 61.724018 -44.723106 10.768738 0.23910963 24 0 0 0 0 8 16 + 2000 90.409434 -6561.5238 -333.25624 14.822134 0.83688372 84 0.050190725 0.0099581757 0 0 28 56 + 3000 67.305679 -341.32154 -396.19372 12.238152 0.92654983 93 0.030546787 0.0068755525 0 0 31 62 + 4000 70.339514 -2575.9146 -419.94752 13.628467 0.98632724 99 0.021303508 0.0046725853 0 0 33 66 + 5000 85.676845 -3904.0268 -427.45932 17.110889 1.0162159 102 0.016400775 0.0035209497 0 0 34 68 + 6000 55.817537 -2067.5498 -448.02732 11.147559 1.0162159 102 0.012996731 0.0028442566 0 0 34 68 + 7000 87.59123 -3931.0089 -442.0299 17.493219 1.0162159 102 0.01160439 0.0030159847 0 0 34 68 + 8000 77.695862 -1684.9299 -461.16897 15.980166 1.0461046 105 0.010174953 0.0025995783 0 0 35 70 + 9000 70.375873 -6250.5951 -467.15813 14.474621 1.0461046 105 0.0089594585 0.002260114 0 0 35 70 + 10000 85.004974 -3406.0315 -464.23871 17.483474 1.0461046 105 0.007938083 0.0020156323 0 0 35 70 + 11000 55.459986 -3437.3858 -470.38117 11.406782 1.0461046 105 0.0071412985 0.0018148454 0 0 35 70 + 12000 80.59057 -2145.2149 -464.5658 16.575538 1.0461046 105 0.0064840331 0.0016519521 0 0 35 70 + 13000 52.183725 -3956.875 -470.42779 10.732934 1.0461046 105 0.0059493315 0.0015128339 0 0 35 70 + 14000 78.482417 -4895.8977 -465.0452 16.141941 1.0461046 105 0.005490232 0.0013968431 0 0 35 70 + 15000 61.802226 -6148.8506 -469.41496 12.711228 1.0461046 105 0.0051077595 0.0012945729 0 0 35 70 + 16000 69.59917 -5755.4737 -462.37636 14.314872 1.0461046 105 0.004761212 0.0012098238 0 0 35 70 + 17000 78.44382 -4103.8449 -461.5505 16.134003 1.0461046 105 0.0044719941 0.0011320612 0 0 35 70 + 18000 76.04971 -3994.5995 -464.26842 15.641592 1.0461046 105 0.0042070328 0.0010659592 0 0 35 70 + 19000 70.676514 -4558.507 -463.40477 14.536455 1.0461046 105 0.0039804956 0.0010049017 0 0 35 70 + 20000 79.682951 -3876.5977 -462.70391 16.388862 1.0461046 105 0.0037779014 0.00095025921 0 0 35 70 + 21000 56.755378 -4224.8128 -465.66199 11.673213 1.0461046 105 0.0035881233 0.00090297077 0 0 35 70 +Loop time of 63.5274 on 4 procs for 20000 steps with 105 atoms -Performance: 18.405 ns/day, 1.304 hours/ns, 213.024 timesteps/s -98.8% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 27.201 ns/day, 0.882 hours/ns, 314.825 timesteps/s +99.5% CPU use with 4 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 6.7882 | 10.264 | 14.758 | 93.2 | 10.93 -Bond | 0.028286 | 0.034218 | 0.039038 | 2.5 | 0.04 -Kspace | 0.57255 | 5.2227 | 8.8493 | 133.8 | 5.56 -Neigh | 0.3635 | 0.36915 | 0.37473 | 0.9 | 0.39 -Comm | 2.9961 | 3.2542 | 3.509 | 11.4 | 3.47 -Output | 0.0011675 | 0.0012342 | 0.001375 | 0.2 | 0.00 -Modify | 74.428 | 74.499 | 74.571 | 0.7 | 79.35 -Other | | 0.2411 | | | 0.26 +Pair | 6.7399 | 8.4644 | 10.565 | 49.0 | 13.32 +Bond | 0.021824 | 0.024522 | 0.0278 | 1.4 | 0.04 +Kspace | 0.47207 | 2.5646 | 4.286 | 88.8 | 4.04 +Neigh | 0.25299 | 0.2535 | 0.25374 | 0.1 | 0.40 +Comm | 2.011 | 2.0187 | 2.0311 | 0.5 | 3.18 +Output | 0.00063848 | 0.00072688 | 0.00099015 | 0.0 | 0.00 +Modify | 50.025 | 50.035 | 50.051 | 0.1 | 78.76 +Other | | 0.166 | | | 0.26 -Nlocal: 26.25 ave 31 max 22 min -Histogram: 1 0 1 0 0 0 1 0 0 1 -Nghost: 6049.25 ave 6133 max 5962 min -Histogram: 1 0 0 0 1 0 1 0 0 1 -Neighs: 23613 ave 35083 max 14025 min -Histogram: 1 0 0 1 1 0 0 0 0 1 +Nlocal: 26.25 ave 30 max 24 min +Histogram: 1 1 0 1 0 0 0 0 0 1 +Nghost: 5965 ave 6026 max 5911 min +Histogram: 1 0 0 1 0 1 0 0 0 1 +Neighs: 23614.8 ave 29343 max 16281 min +Histogram: 1 0 0 0 0 1 1 0 0 1 -Total # of neighbors = 94452 -Ave neighs/atom = 899.543 +Total # of neighbors = 94459 +Ave neighs/atom = 899.61 Ave special neighs/atom = 2 -Neighbor list builds = 20428 +Neighbor list builds = 20437 Dangerous builds = 0 -Total wall time: 0:01:34 +Total wall time: 0:01:03 diff --git a/examples/gcmc/log.6Jul17.gcmc.lj.g++.1 b/examples/gcmc/log.6Jul17.gcmc.lj.g++.1 index 69fc2ede1c..7ff7e02f86 100644 --- a/examples/gcmc/log.6Jul17.gcmc.lj.g++.1 +++ b/examples/gcmc/log.6Jul17.gcmc.lj.g++.1 @@ -1,4 +1,5 @@ -LAMMPS (6 Jul 2017) +LAMMPS (22 Sep 2017) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) using 1 OpenMP thread(s) per MPI task # GCMC for LJ simple fluid, no dynamics # T = 2.0 @@ -43,6 +44,13 @@ fix mygcmc all gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 1.0 +# atom count + +variable type1 atom "type==1" +group type1 dynamic all var type1 +dynamic group type1 defined +variable n1 equal count(type1) + # averaging variable rho equal density @@ -54,10 +62,11 @@ variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) variable muex equal -1.25-2.0*ln(density*1+${nugget}) variable muex equal -1.25-2.0*ln(density*1+1e-08) -fix ave all ave/time 10 100 1000 v_rho v_p v_muex ave one file rho_vs_p.dat +fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat variable rhoav equal f_ave[1] variable pav equal f_ave[2] variable muexav equal f_ave[3] +variable n1av equal f_ave[4] # output @@ -68,7 +77,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) compute_modify thermo_temp dynamic yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av thermo 1000 # run @@ -87,32 +96,32 @@ Neighbor list info ... stencil: half/bin/3d/newton bin: standard Per MPI rank memory allocation (min/avg/max) = 0.433 | 0.433 | 0.433 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav - 0 0 0 0 -0 0 0 0 0 0 0 0 0 - 1000 2.4038954 2.1735585 -2.7041368 3.5476844 0.496 62 0.064790036 0.06313096 0.1081294 0.54304 1.4513524 -0.025479219 - 2000 2.0461168 1.1913842 -2.9880181 3.0212194 0.512 64 0.067416408 0.066335853 0.11306166 0.52736 1.3274665 0.034690004 - 3000 1.7930436 1.3788681 -3.2212667 2.6505861 0.552 69 0.067733191 0.066877836 0.1133516 0.5344 1.3834744 0.0070582537 - 4000 1.981449 1.2541054 -2.8222868 2.9217977 0.472 59 0.068546991 0.067856412 0.11442807 0.52504 1.3815629 0.043309657 - 5000 2.0946818 1.0701629 -3.5213291 3.0977688 0.568 71 0.06813743 0.067567891 0.11342906 0.53824 1.4049567 -0.0054539777 - 6000 1.9793484 0.68224187 -3.410211 2.9247088 0.536 67 0.067797628 0.067420108 0.11295333 0.5384 1.401683 -0.0066894359 - 7000 2.1885798 1.6745012 -3.185499 3.2345922 0.544 68 0.068630201 0.068261832 0.11403705 0.5244 1.449239 0.045987399 - 8000 2.2175324 1.5897263 -3.078898 3.2759002 0.528 66 0.068180395 0.067899629 0.11332691 0.53928 1.5488388 -0.01075766 - 9000 1.8610779 1.0396231 -2.923262 2.7465908 0.496 62 0.068346453 0.068028117 0.1134132 0.52912 1.4352871 0.027082544 - 10000 2.1079271 1.1746643 -2.9112062 3.1091925 0.48 60 0.068352878 0.068054948 0.11335434 0.5316 1.4462327 0.018503094 -Loop time of 20.6892 on 1 procs for 10000 steps with 60 atoms +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av + 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 + 1000 2.4038954 2.1735585 -2.7041368 3.5476844 0.496 62 0.064790036 0.06313096 0.1081294 0.54304 1.4513524 -0.025479219 64.98 + 2000 2.0461168 1.1913842 -2.9880181 3.0212194 0.512 64 0.067416408 0.066335853 0.11306166 0.52736 1.3274665 0.034690004 62.97 + 3000 1.7930436 1.3788681 -3.2212667 2.6505861 0.552 69 0.067733191 0.066877836 0.1133516 0.5344 1.3834744 0.0070582537 63.5 + 4000 1.981449 1.2541054 -2.8222868 2.9217977 0.472 59 0.068546991 0.067856412 0.11442807 0.52504 1.3815629 0.043309657 62.17 + 5000 2.0946818 1.0701629 -3.5213291 3.0977688 0.568 71 0.06813743 0.067567891 0.11342906 0.53824 1.4049567 -0.0054539777 64.15 + 6000 1.9793484 0.68224187 -3.410211 2.9247088 0.536 67 0.067797628 0.067420108 0.11295333 0.5384 1.401683 -0.0066894359 64.37 + 7000 2.1885798 1.6745012 -3.185499 3.2345922 0.544 68 0.068630201 0.068261832 0.11403705 0.5244 1.449239 0.045987399 62.33 + 8000 2.2175324 1.5897263 -3.078898 3.2759002 0.528 66 0.068180395 0.067899629 0.11332691 0.53928 1.5488388 -0.01075766 64.29 + 9000 1.8610779 1.0396231 -2.923262 2.7465908 0.496 62 0.068346453 0.068028117 0.1134132 0.52912 1.4352871 0.027082544 62.87 + 10000 2.1079271 1.1746643 -2.9112062 3.1091925 0.48 60 0.068352878 0.068054948 0.11335434 0.5316 1.4462327 0.018503094 63.2 +Loop time of 13.1886 on 1 procs for 10000 steps with 60 atoms -Performance: 208804.611 tau/day, 483.344 timesteps/s -99.4% CPU use with 1 MPI tasks x 1 OpenMP threads +Performance: 327555.715 tau/day, 758.231 timesteps/s +100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- -Pair | 0.47227 | 0.47227 | 0.47227 | 0.0 | 2.28 -Neigh | 1.1729 | 1.1729 | 1.1729 | 0.0 | 5.67 -Comm | 0.17133 | 0.17133 | 0.17133 | 0.0 | 0.83 -Output | 0.00028253 | 0.00028253 | 0.00028253 | 0.0 | 0.00 -Modify | 18.852 | 18.852 | 18.852 | 0.0 | 91.12 -Other | | 0.02063 | | | 0.10 +Pair | 0.37102 | 0.37102 | 0.37102 | 0.0 | 2.81 +Neigh | 0.86986 | 0.86986 | 0.86986 | 0.0 | 6.60 +Comm | 0.10394 | 0.10394 | 0.10394 | 0.0 | 0.79 +Output | 0.00025702 | 0.00025702 | 0.00025702 | 0.0 | 0.00 +Modify | 11.833 | 11.833 | 11.833 | 0.0 | 89.72 +Other | | 0.01084 | | | 0.08 Nlocal: 60 ave 60 max 60 min Histogram: 1 0 0 0 0 0 0 0 0 0 @@ -125,4 +134,4 @@ Total # of neighbors = 2133 Ave neighs/atom = 35.55 Neighbor list builds = 10000 Dangerous builds = 0 -Total wall time: 0:00:20 +Total wall time: 0:00:13 diff --git a/examples/gcmc/log.6Jul17.gcmc.lj.g++.4 b/examples/gcmc/log.6Jul17.gcmc.lj.g++.4 index 6bd3b3189c..59ed0462dc 100644 --- a/examples/gcmc/log.6Jul17.gcmc.lj.g++.4 +++ b/examples/gcmc/log.6Jul17.gcmc.lj.g++.4 @@ -1,4 +1,5 @@ -LAMMPS (6 Jul 2017) +LAMMPS (22 Sep 2017) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) using 1 OpenMP thread(s) per MPI task # GCMC for LJ simple fluid, no dynamics # T = 2.0 @@ -43,6 +44,13 @@ fix mygcmc all gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 1.0 +# atom count + +variable type1 atom "type==1" +group type1 dynamic all var type1 +dynamic group type1 defined +variable n1 equal count(type1) + # averaging variable rho equal density @@ -54,10 +62,11 @@ variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) variable muex equal -1.25-2.0*ln(density*1+${nugget}) variable muex equal -1.25-2.0*ln(density*1+1e-08) -fix ave all ave/time 10 100 1000 v_rho v_p v_muex ave one file rho_vs_p.dat +fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat variable rhoav equal f_ave[1] variable pav equal f_ave[2] variable muexav equal f_ave[3] +variable n1av equal f_ave[4] # output @@ -68,7 +77,7 @@ variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) compute_modify thermo_temp dynamic yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av thermo 1000 # run @@ -87,32 +96,32 @@ Neighbor list info ... stencil: half/bin/3d/newton bin: standard Per MPI rank memory allocation (min/avg/max) = 0.4477 | 0.4477 | 0.4477 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav - 0 0 0 0 -0 0 0 0 0 0 0 0 0 - 1000 1.956397 1.7699101 -2.7889468 2.8864874 0.488 61 0.068894746 0.067229075 0.1141726 0.53288 1.3832798 0.013392866 - 2000 2.040943 0.56060899 -2.8001647 3.0077055 0.456 57 0.069858594 0.068831934 0.11629114 0.5232 1.3587174 0.049995794 - 3000 2.0004866 1.5736515 -3.3098044 2.9572411 0.552 69 0.069594029 0.068727791 0.11592543 0.53096 1.4129434 0.020022578 - 4000 2.1127942 2.642809 -2.8865084 3.1211733 0.528 66 0.070268697 0.069533235 0.11693806 0.52424 1.3444615 0.046884078 - 5000 2.3663648 1.354269 -3.1917346 3.4957662 0.528 66 0.070519633 0.069960064 0.11710321 0.52688 1.3595814 0.036270867 - 6000 1.9224136 0.82756699 -3.1965 2.839257 0.52 65 0.06985018 0.069474645 0.11628632 0.536 1.47062 0.00141549 - 7000 2.0266192 1.5593811 -2.9972341 2.9931606 0.52 65 0.070244693 0.069880791 0.11666541 0.52528 1.3246332 0.040754793 - 8000 1.7790467 1.8680568 -2.8028819 2.6275151 0.52 65 0.070454494 0.070172368 0.11736806 0.524 1.4213649 0.047985191 - 9000 1.7968847 1.3195587 -3.261001 2.6550983 0.536 67 0.069952011 0.069618327 0.11650087 0.53904 1.4624201 -0.01069837 - 10000 2.1566109 1.1015729 -3.4999837 3.1880335 0.552 69 0.069603309 0.069284134 0.11625548 0.53128 1.3587249 0.02075238 -Loop time of 24.9916 on 4 procs for 10000 steps with 69 atoms +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av + 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 + 1000 1.956397 1.7699101 -2.7889468 2.8864874 0.488 61 0.068894746 0.067229075 0.1141726 0.53288 1.3832798 0.013392866 63.44 + 2000 2.040943 0.56060899 -2.8001647 3.0077055 0.456 57 0.069858594 0.068831934 0.11629114 0.5232 1.3587174 0.049995794 62.19 + 3000 2.0004866 1.5736515 -3.3098044 2.9572411 0.552 69 0.069594029 0.068727791 0.11592543 0.53096 1.4129434 0.020022578 63.23 + 4000 2.1127942 2.642809 -2.8865084 3.1211733 0.528 66 0.070268697 0.069533235 0.11693806 0.52424 1.3444615 0.046884078 62.57 + 5000 2.3663648 1.354269 -3.1917346 3.4957662 0.528 66 0.070519633 0.069960064 0.11710321 0.52688 1.3595814 0.036270867 62.56 + 6000 1.9224136 0.82756699 -3.1965 2.839257 0.52 65 0.06985018 0.069474645 0.11628632 0.536 1.47062 0.00141549 63.76 + 7000 2.0266192 1.5593811 -2.9972341 2.9931606 0.52 65 0.070244693 0.069880791 0.11666541 0.52528 1.3246332 0.040754793 62.2 + 8000 1.7790467 1.8680568 -2.8028819 2.6275151 0.52 65 0.070454494 0.070172368 0.11736806 0.524 1.4213649 0.047985191 62.03 + 9000 1.7968847 1.3195587 -3.261001 2.6550983 0.536 67 0.069952011 0.069618327 0.11650087 0.53904 1.4624201 -0.01069837 64.36 + 10000 2.1566109 1.1015729 -3.4999837 3.1880335 0.552 69 0.069603309 0.069284134 0.11625548 0.53128 1.3587249 0.02075238 63.24 +Loop time of 13.089 on 4 procs for 10000 steps with 69 atoms -Performance: 172857.936 tau/day, 400.134 timesteps/s -98.2% CPU use with 4 MPI tasks x 1 OpenMP threads +Performance: 330047.561 tau/day, 763.999 timesteps/s +99.8% 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.11696 | 0.12516 | 0.1321 | 1.7 | 0.50 -Neigh | 0.34874 | 0.35644 | 0.36545 | 1.2 | 1.43 -Comm | 0.48531 | 0.51366 | 0.54755 | 3.8 | 2.06 -Output | 0.0005362 | 0.00069767 | 0.00076008 | 0.0 | 0.00 -Modify | 23.956 | 23.972 | 23.988 | 0.3 | 95.92 -Other | | 0.02376 | | | 0.10 +Pair | 0.088209 | 0.093632 | 0.098849 | 1.4 | 0.72 +Neigh | 0.25982 | 0.26669 | 0.27885 | 1.5 | 2.04 +Comm | 0.27092 | 0.28815 | 0.29998 | 2.1 | 2.20 +Output | 0.00030112 | 0.00035518 | 0.00037479 | 0.0 | 0.00 +Modify | 12.432 | 12.433 | 12.433 | 0.0 | 94.98 +Other | | 0.007692 | | | 0.06 Nlocal: 17.25 ave 23 max 10 min Histogram: 1 0 0 0 0 0 2 0 0 1 @@ -125,4 +134,4 @@ Total # of neighbors = 2823 Ave neighs/atom = 40.913 Neighbor list builds = 10000 Dangerous builds = 0 -Total wall time: 0:00:24 +Total wall time: 0:00:13 From adbc75cae655c1cd4905769bc3ef3055ef8a087a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Nov 2017 11:52:01 -0500 Subject: [PATCH 02/34] add alternate log files with the latest version of LAMMPS --- examples/gcmc/log.23Oct17.gcmc.co2.g++.1 | 192 +++++++++++++++ examples/gcmc/log.23Oct17.gcmc.co2.g++.4 | 192 +++++++++++++++ examples/gcmc/log.23Oct17.gcmc.h2o.g++.1 | 293 +++++++++++++++++++++++ examples/gcmc/log.23Oct17.gcmc.h2o.g++.4 | 293 +++++++++++++++++++++++ examples/gcmc/log.23Oct17.gcmc.lj.g++.1 | 136 +++++++++++ examples/gcmc/log.23Oct17.gcmc.lj.g++.4 | 136 +++++++++++ 6 files changed, 1242 insertions(+) create mode 100644 examples/gcmc/log.23Oct17.gcmc.co2.g++.1 create mode 100644 examples/gcmc/log.23Oct17.gcmc.co2.g++.4 create mode 100644 examples/gcmc/log.23Oct17.gcmc.h2o.g++.1 create mode 100644 examples/gcmc/log.23Oct17.gcmc.h2o.g++.4 create mode 100644 examples/gcmc/log.23Oct17.gcmc.lj.g++.1 create mode 100644 examples/gcmc/log.23Oct17.gcmc.lj.g++.4 diff --git a/examples/gcmc/log.23Oct17.gcmc.co2.g++.1 b/examples/gcmc/log.23Oct17.gcmc.co2.g++.1 new file mode 100644 index 0000000000..e7b7c6afda --- /dev/null +++ b/examples/gcmc/log.23Oct17.gcmc.co2.g++.1 @@ -0,0 +1,192 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# GCMC for CO2 molecular fluid, rigid/small/nvt dynamics +# Rigid CO2 TraPPE model +# [Potoff and J.I. Siepmann, Vapor-liquid equilibria of +# mixtures containing alkanes, carbon dioxide and +# nitrogen AIChE J., 47,1676-1682 (2001)]. + +# variables available on command line + +variable mu index -8.1 +variable disp index 0.5 +variable temp index 338.0 +variable lbox index 10.0 +variable spacing index 5.0 + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5.0 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 10.0 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 1 by 1 MPI processor grid +molecule co2mol CO2.txt +Read molecule co2mol: + 3 atoms with 2 types + 2 bonds with 1 types + 1 angles with 1 types + 0 dihedrals with 0 types + 0 impropers with 0 types +create_atoms 0 box mol co2mol 464563 units box +Created 24 atoms + Time spent = 0.00196958 secs + +# rigid CO2 TraPPE model + +pair_coeff 1 1 0.053649 2.8 +pair_coeff 2 2 0.156973 3.05 +bond_coeff 1 0 1.16 +angle_coeff 1 0 180 + +# masses + +mass 1 12.0107 +mass 2 15.9994 + +# MD settings + +group co2 type 1 2 +24 atoms in group co2 +neighbor 2.0 bin +neigh_modify every 1 delay 10 check yes +velocity all create ${temp} 54654 +velocity all create 338.0 54654 +timestep 1.0 + +# rigid constraints with thermostat + +fix myrigidnvt all rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol +fix myrigidnvt all rigid/nvt/small molecule temp 338.0 ${temp} 100 mol co2mol +fix myrigidnvt all rigid/nvt/small molecule temp 338.0 338.0 100 mol co2mol +8 rigid bodies with 24 atoms + 1.16 = max distance from body owner to body atom +fix_modify myrigidnvt dynamic/dof no + +# gcmc + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt + +# atom counts + +variable carbon atom "type==1" +variable oxygen atom "type==2" +group carbon dynamic all var carbon +dynamic group carbon defined +group oxygen dynamic all var oxygen +dynamic group oxygen defined +variable nC equal count(carbon) +variable nO equal count(oxygen) + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) +variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO +thermo 1000 + +# run + +run 20000 +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.164636 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 15.62 | 15.62 | 15.62 Mbytes +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO + 0 364.27579 4238.8631 -9.6809388 13.391989 0.5846359 24 0 0 0 0 8 16 +WARNING: Using kspace solver on system with no charge (../kspace.cpp:289) + 1000 420.43475 1722.4052 -9.6956123 15.456579 0.5846359 24 0.20879341 0.20713005 0 0 8 16 + 2000 302.29516 -547.83641 -22.017674 14.11699 0.73079488 30 0.1742478 0.1678018 0 0 10 20 + 3000 316.6934 -1080.2672 -8.2218891 10.069364 0.51155641 21 0.13544917 0.13720634 0 0 7 14 + 4000 246.81618 -679.83642 -14.577244 10.29997 0.65771539 27 0.1568939 0.15860229 0 0 9 18 + 5000 260.22849 -896.29914 -16.097593 10.859684 0.65771539 27 0.13138744 0.13547049 0 0 9 18 + 6000 291.70796 -1521.99 -22.303136 13.622574 0.73079488 30 0.12615476 0.12717694 0 0 10 20 + 7000 236.02638 -599.92186 -27.580831 13.367447 0.87695385 36 0.119703 0.12145398 0 0 12 24 + 8000 321.45341 688.10577 -10.09204 11.817696 0.5846359 24 0.10917411 0.11032646 0 0 8 16 + 9000 502.85382 -302.31056 -0.22330142 0.99927447 0.073079488 3 0.1254105 0.12905828 0 0 1 2 + 10000 249.98239 -510.0091 -32.815145 15.399767 0.95003334 39 0.1274504 0.12875623 0 0 13 26 + 11000 247.59424 -1129.0274 -25.320205 12.792544 0.80387436 33 0.11739076 0.11916784 0 0 11 22 + 12000 0 -20.39554 -0.14872889 -0 0 0 0.1254933 0.12920375 0 0 0 0 + 13000 1272.2738 -474.79484 -0.29450485 8.8489483 0.14615898 6 0.13767133 0.14112496 0 0 2 4 + 14000 516.54246 -36.296516 -5.0012009 11.291243 0.36539744 15 0.15632744 0.15955377 0 0 5 10 + 15000 307.09233 1951.9301 -14.820362 12.815375 0.65771539 27 0.15393544 0.15716192 0 0 9 18 + 16000 198.31989 -559.48443 -30.459487 11.231925 0.87695385 36 0.1482565 0.15025652 0 0 12 24 + 17000 246.99311 657.85683 -18.579206 11.53442 0.73079488 30 0.14143958 0.14375423 0 0 10 20 + 18000 467.13468 167.03738 -1.0945268 5.569759 0.21923846 9 0.13847359 0.14098533 0 0 3 6 + 19000 359.54027 -1413.5407 -12.156233 13.217895 0.5846359 24 0.15169146 0.15294205 0 0 8 16 + 20000 227.79597 -1204.5652 -23.24144 10.637925 0.73079488 30 0.14917199 0.15022946 0 0 10 20 +Loop time of 20.6928 on 1 procs for 20000 steps with 30 atoms + +Performance: 83.507 ns/day, 0.287 hours/ns, 966.519 timesteps/s +99.2% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.5462 | 2.5462 | 2.5462 | 0.0 | 12.30 +Bond | 0.029783 | 0.029783 | 0.029783 | 0.0 | 0.14 +Kspace | 0.26167 | 0.26167 | 0.26167 | 0.0 | 1.26 +Neigh | 0.10705 | 0.10705 | 0.10705 | 0.0 | 0.52 +Comm | 0.23409 | 0.23409 | 0.23409 | 0.0 | 1.13 +Output | 0.0013416 | 0.0013416 | 0.0013416 | 0.0 | 0.01 +Modify | 17.458 | 17.458 | 17.458 | 0.0 | 84.37 +Other | | 0.05433 | | | 0.26 + +Nlocal: 30 ave 30 max 30 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 2310 ave 2310 max 2310 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 7736 ave 7736 max 7736 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 7736 +Ave neighs/atom = 257.867 +Ave special neighs/atom = 2 +Neighbor list builds = 20349 +Dangerous builds = 0 + +Total wall time: 0:00:20 diff --git a/examples/gcmc/log.23Oct17.gcmc.co2.g++.4 b/examples/gcmc/log.23Oct17.gcmc.co2.g++.4 new file mode 100644 index 0000000000..b344c7b068 --- /dev/null +++ b/examples/gcmc/log.23Oct17.gcmc.co2.g++.4 @@ -0,0 +1,192 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# GCMC for CO2 molecular fluid, rigid/small/nvt dynamics +# Rigid CO2 TraPPE model +# [Potoff and J.I. Siepmann, Vapor-liquid equilibria of +# mixtures containing alkanes, carbon dioxide and +# nitrogen AIChE J., 47,1676-1682 (2001)]. + +# variables available on command line + +variable mu index -8.1 +variable disp index 0.5 +variable temp index 338.0 +variable lbox index 10.0 +variable spacing index 5.0 + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5.0 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 10.0 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 2 by 2 MPI processor grid +molecule co2mol CO2.txt +Read molecule co2mol: + 3 atoms with 2 types + 2 bonds with 1 types + 1 angles with 1 types + 0 dihedrals with 0 types + 0 impropers with 0 types +create_atoms 0 box mol co2mol 464563 units box +Created 24 atoms + Time spent = 0.00261331 secs + +# rigid CO2 TraPPE model + +pair_coeff 1 1 0.053649 2.8 +pair_coeff 2 2 0.156973 3.05 +bond_coeff 1 0 1.16 +angle_coeff 1 0 180 + +# masses + +mass 1 12.0107 +mass 2 15.9994 + +# MD settings + +group co2 type 1 2 +24 atoms in group co2 +neighbor 2.0 bin +neigh_modify every 1 delay 10 check yes +velocity all create ${temp} 54654 +velocity all create 338.0 54654 +timestep 1.0 + +# rigid constraints with thermostat + +fix myrigidnvt all rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol +fix myrigidnvt all rigid/nvt/small molecule temp 338.0 ${temp} 100 mol co2mol +fix myrigidnvt all rigid/nvt/small molecule temp 338.0 338.0 100 mol co2mol +8 rigid bodies with 24 atoms + 1.16 = max distance from body owner to body atom +fix_modify myrigidnvt dynamic/dof no + +# gcmc + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt + +# atom counts + +variable carbon atom "type==1" +variable oxygen atom "type==2" +group carbon dynamic all var carbon +dynamic group carbon defined +group oxygen dynamic all var oxygen +dynamic group oxygen defined +variable nC equal count(carbon) +variable nO equal count(oxygen) + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) +variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO +thermo 1000 + +# run + +run 20000 +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.164636 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 15.41 | 15.41 | 15.41 Mbytes +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO + 0 386.52184 23582.465 -3.2433417 14.209828 0.5846359 24 0 0 0 0 8 16 +WARNING: Using kspace solver on system with no charge (../kspace.cpp:289) + 1000 335.66829 -3.7743052 -4.6268612 7.3374649 0.36539744 15 0.20601899 0.20787963 0 0 5 10 + 2000 459.73529 238.91592 -0.42937831 5.4815343 0.21923846 9 0.30392058 0.30105616 0 0 3 6 + 3000 255.47773 -479.67802 -36.850434 15.738299 0.95003334 39 0.22220744 0.2197582 0 0 13 26 + 4000 182.70803 -1059.2262 -43.044833 12.163134 1.0231128 42 0.16781689 0.16716177 0 0 14 28 + 5000 234.00907 -1821.0444 -46.04795 15.578317 1.0231128 42 0.13498091 0.13704201 0 0 14 28 + 6000 163.42759 -774.67294 -49.686261 11.691518 1.0961923 45 0.11401677 0.11296973 0 0 15 30 + 7000 171.64616 -355.23516 -49.323434 12.27947 1.0961923 45 0.098302308 0.098552065 0 0 15 30 + 8000 251.29791 -905.47863 -37.841209 15.480807 0.95003334 39 0.086856972 0.08638658 0 0 13 26 + 9000 143.69498 -849.95393 -49.073188 10.279858 1.0961923 45 0.078261061 0.077955243 0 0 15 30 + 10000 239.35727 -1158.1879 -43.562047 15.934355 1.0231128 42 0.070789792 0.070807529 0 0 14 28 + 11000 169.51213 -1574.7885 -51.125228 12.126803 1.0961923 45 0.065008734 0.06498871 0 0 15 30 + 12000 181.39739 160.11631 -46.850937 12.977068 1.0961923 45 0.059648717 0.059514803 0 0 15 30 + 13000 164.14601 -1107.7629 -50.726722 11.742914 1.0961923 45 0.055207333 0.055097701 0 0 15 30 + 14000 287.26285 418.51463 -41.664766 19.123497 1.0231128 42 0.051346789 0.051222285 0 0 14 28 + 15000 256.94593 -532.36615 -41.651618 17.105257 1.0231128 42 0.047870301 0.047861685 0 0 14 28 + 16000 166.92132 151.15933 -39.957018 11.11219 1.0231128 42 0.045205599 0.045042211 0 0 14 28 + 17000 163.22452 -1299.8119 -42.677558 10.866089 1.0231128 42 0.043122086 0.042993687 0 0 14 28 + 18000 158.01154 475.77329 -48.803162 11.304057 1.0961923 45 0.041016683 0.040647229 0 0 15 30 + 19000 138.49297 -1585.1508 -47.517099 9.9077098 1.0961923 45 0.038929287 0.038436764 0 0 15 30 + 20000 173.84439 -1362.6301 -53.002743 12.436731 1.0961923 45 0.036973919 0.036523816 0 0 15 30 +Loop time of 32.4481 on 4 procs for 20000 steps with 45 atoms + +Performance: 53.254 ns/day, 0.451 hours/ns, 616.369 timesteps/s +98.4% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.1687 | 1.6702 | 2.1864 | 30.8 | 5.15 +Bond | 0.018828 | 0.020035 | 0.020975 | 0.6 | 0.06 +Kspace | 0.57506 | 1.0931 | 1.5898 | 37.7 | 3.37 +Neigh | 0.068863 | 0.069524 | 0.070128 | 0.2 | 0.21 +Comm | 2.0735 | 2.0865 | 2.0979 | 0.7 | 6.43 +Output | 0.0025017 | 0.0025966 | 0.0027781 | 0.2 | 0.01 +Modify | 27.335 | 27.344 | 27.363 | 0.2 | 84.27 +Other | | 0.1621 | | | 0.50 + +Nlocal: 11.25 ave 14 max 8 min +Histogram: 1 0 0 0 0 1 1 0 0 1 +Nghost: 2639.75 ave 2656 max 2617 min +Histogram: 1 0 0 0 0 0 2 0 0 1 +Neighs: 4320 ave 5824 max 2201 min +Histogram: 1 0 0 0 0 0 1 1 0 1 + +Total # of neighbors = 17280 +Ave neighs/atom = 384 +Ave special neighs/atom = 2 +Neighbor list builds = 20394 +Dangerous builds = 0 + +Total wall time: 0:00:32 diff --git a/examples/gcmc/log.23Oct17.gcmc.h2o.g++.1 b/examples/gcmc/log.23Oct17.gcmc.h2o.g++.1 new file mode 100644 index 0000000000..bc7c3af454 --- /dev/null +++ b/examples/gcmc/log.23Oct17.gcmc.h2o.g++.1 @@ -0,0 +1,293 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# fix gcmc example with fix shake + +# variables available on command line + +variable mu index -8.1 +variable disp index 0.5 +variable temp index 338.0 +variable lbox index 10.0 +variable spacing index 5.0 + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5.0 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 10.0 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 1 by 1 MPI processor grid + +# we can load multiple molecule templates, but don't have to use them all +molecule co2mol CO2.txt +Read molecule co2mol: + 3 atoms with 2 types + 2 bonds with 1 types + 1 angles with 1 types + 0 dihedrals with 0 types + 0 impropers with 0 types +molecule h2omol H2O.txt +Read molecule h2omol: + 3 atoms with 2 types + 2 bonds with 1 types + 1 angles with 1 types + 0 dihedrals with 0 types + 0 impropers with 0 types +create_atoms 0 box mol h2omol 464563 units box +Created 24 atoms + Time spent = 0.00201297 secs + +# rigid SPC/E water model + +pair_coeff 1 1 0.15535 3.166 +pair_coeff * 2 0.0000 0.0000 + +bond_coeff 1 1000 1.0 +angle_coeff 1 100 109.47 + +# masses + +mass 1 15.9994 +mass 2 1.0 + +# MD settings + +group h2o type 1 2 +24 atoms in group h2o +neighbor 2.0 bin +neigh_modify every 1 delay 1 check yes +velocity all create ${temp} 54654 +velocity all create 338.0 54654 +timestep 1.0 + +minimize 0.0 0.0 100 1000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:168) +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.170448 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.88 | 11.88 | 11.88 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 338 -4.1890564 9.2628112e-06 18.98377 739.06991 + 100 338 -30.182886 0.85607237 -6.1539961 -2535.3207 +Loop time of 0.0507543 on 1 procs for 100 steps with 24 atoms + +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -4.18904713252 -28.9258064504 -29.3268133965 + Force two-norm initial, final = 18.0027 42.4511 + Force max component initial, final = 5.8993 16.0523 + Final line search alpha, max atom move = 0.00353207 0.056698 + Iterations, force evaluations = 100 238 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.042597 | 0.042597 | 0.042597 | 0.0 | 83.93 +Bond | 0.00047708 | 0.00047708 | 0.00047708 | 0.0 | 0.94 +Kspace | 0.0031135 | 0.0031135 | 0.0031135 | 0.0 | 6.13 +Neigh | 0.00045919 | 0.00045919 | 0.00045919 | 0.0 | 0.90 +Comm | 0.0032997 | 0.0032997 | 0.0032997 | 0.0 | 6.50 +Output | 1.359e-05 | 1.359e-05 | 1.359e-05 | 0.0 | 0.03 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.0007946 | | | 1.57 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 2047 ave 2047 max 2047 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 4936 ave 4936 max 4936 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 4936 +Ave neighs/atom = 205.667 +Ave special neighs/atom = 2 +Neighbor list builds = 2 +Dangerous builds = 0 +reset_timestep 0 +# rigid constraints with thermostat + +fix mynvt all nvt temp ${temp} ${temp} 100 +fix mynvt all nvt temp 338.0 ${temp} 100 +fix mynvt all nvt temp 338.0 338.0 100 +fix wshake all shake 0.0001 50 0 b 1 a 1 mol h2omol + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 8 = # of frozen angles +# gcmc + + + +run 1000 +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.170448 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 518.26667 -30.182886 0 -7.0100684 993.1985 + 1000 326.9865 -62.258445 0 -47.638175 -5.3440813 +Loop time of 0.141449 on 1 procs for 1000 steps with 24 atoms + +Performance: 610.819 ns/day, 0.039 hours/ns, 7069.663 timesteps/s +99.7% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.10788 | 0.10788 | 0.10788 | 0.0 | 76.27 +Bond | 0.00018954 | 0.00018954 | 0.00018954 | 0.0 | 0.13 +Kspace | 0.011867 | 0.011867 | 0.011867 | 0.0 | 8.39 +Neigh | 0.0045254 | 0.0045254 | 0.0045254 | 0.0 | 3.20 +Comm | 0.011277 | 0.011277 | 0.011277 | 0.0 | 7.97 +Output | 1.5497e-05 | 1.5497e-05 | 1.5497e-05 | 0.0 | 0.01 +Modify | 0.00383 | 0.00383 | 0.00383 | 0.0 | 2.71 +Other | | 0.001868 | | | 1.32 + +Nlocal: 24 ave 24 max 24 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 1660 ave 1660 max 1660 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 5112 ave 5112 max 5112 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 5112 +Ave neighs/atom = 213 +Ave special neighs/atom = 2 +Neighbor list builds = 25 +Dangerous builds = 0 + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake + +# atom counts + +variable oxygen atom "type==1" +variable hydrogen atom "type==2" +group oxygen dynamic all var oxygen +dynamic group oxygen defined +group hydrogen dynamic all var hydrogen +dynamic group hydrogen defined +variable nO equal count(oxygen) +variable nH equal count(hydrogen) + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) +variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH +thermo 1000 + +# run + +run 20000 +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.170448 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH + 1000 326.9865 -4.3509713 -62.258445 14.62027 0.23910963 24 0 0 0 0 8 16 + 2000 116.99793 -5344.1527 -286.61595 17.088682 0.74721761 75 0.048183096 0.013941446 0 0 25 50 + 3000 106.86746 -3920.4926 -361.60598 18.794545 0.89666113 90 0.035637919 0.012768883 0 0 30 60 + 4000 75.002668 540.46846 -414.8511 14.531966 0.98632724 99 0.025963651 0.0093451705 0 0 33 66 + 5000 79.924788 -2131.1173 -437.21216 15.962121 1.0162159 102 0.019879728 0.0070418993 0 0 34 68 + 6000 95.552773 -3647.0233 -438.24276 19.083253 1.0162159 102 0.015753613 0.0056885133 0 0 34 68 + 7000 79.501736 -2071.5369 -440.77351 15.877631 1.0162159 102 0.01326216 0.0046915318 0 0 34 68 + 8000 62.567091 -3102.9616 -442.21884 12.495541 1.0162159 102 0.011305503 0.0040437885 0 0 34 68 + 9000 68.324047 -3812.7866 -440.46835 13.645287 1.0162159 102 0.0099549538 0.0035157329 0 0 34 68 + 10000 83.857631 -2158.2659 -444.8183 16.747566 1.0162159 102 0.0088200922 0.0031354281 0 0 34 68 + 11000 68.350984 -2084.0789 -440.14081 13.650667 1.0162159 102 0.0081331455 0.0030247424 0 0 34 68 + 12000 76.867315 -1585.6723 -443.36199 15.3515 1.0162159 102 0.0073845932 0.0027532534 0 0 34 68 + 13000 59.74266 -2211.0211 -446.07791 11.931462 1.0162159 102 0.0067756276 0.0025213898 0 0 34 68 + 14000 81.154979 -907.0176 -441.53368 16.207808 1.0162159 102 0.0062527642 0.0023280719 0 0 34 68 + 15000 66.814346 -2804.5134 -455.80704 13.7421 1.0461046 105 0.0059590528 0.0021576214 0 0 35 70 + 16000 71.42983 -3930.4004 -458.43218 14.691394 1.0461046 105 0.0055547473 0.0020163729 0 0 35 70 + 17000 89.624855 -3569.8136 -455.18164 18.433672 1.0461046 105 0.0052173265 0.0018867687 0 0 35 70 + 18000 63.519962 -1882.8157 -456.58939 13.064525 1.0461046 105 0.0049082049 0.0017765986 0 0 35 70 + 19000 71.872698 -2243.5046 -454.93359 14.782481 1.0461046 105 0.0046439115 0.0016748361 0 0 35 70 + 20000 73.660765 -2285.3173 -476.35473 15.589381 1.0759934 108 0.0045124933 0.0015837653 0 0 36 72 + 21000 95.675868 987.92089 -475.46736 20.248603 1.0759934 108 0.004285814 0.0015049513 0 0 36 72 +Loop time of 220.662 on 1 procs for 20000 steps with 108 atoms + +Performance: 7.831 ns/day, 3.065 hours/ns, 90.637 timesteps/s +99.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 | 37.459 | 37.459 | 37.459 | 0.0 | 16.98 +Bond | 0.087067 | 0.087067 | 0.087067 | 0.0 | 0.04 +Kspace | 0.90234 | 0.90234 | 0.90234 | 0.0 | 0.41 +Neigh | 1.2299 | 1.2299 | 1.2299 | 0.0 | 0.56 +Comm | 0.95437 | 0.95437 | 0.95437 | 0.0 | 0.43 +Output | 0.0010636 | 0.0010636 | 0.0010636 | 0.0 | 0.00 +Modify | 179.85 | 179.85 | 179.85 | 0.0 | 81.51 +Other | | 0.1754 | | | 0.08 + +Nlocal: 108 ave 108 max 108 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 7850 ave 7850 max 7850 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 99828 ave 99828 max 99828 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 99828 +Ave neighs/atom = 924.333 +Ave special neighs/atom = 2 +Neighbor list builds = 20439 +Dangerous builds = 0 + +Total wall time: 0:03:40 diff --git a/examples/gcmc/log.23Oct17.gcmc.h2o.g++.4 b/examples/gcmc/log.23Oct17.gcmc.h2o.g++.4 new file mode 100644 index 0000000000..4eeab969dd --- /dev/null +++ b/examples/gcmc/log.23Oct17.gcmc.h2o.g++.4 @@ -0,0 +1,293 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# fix gcmc example with fix shake + +# variables available on command line + +variable mu index -8.1 +variable disp index 0.5 +variable temp index 338.0 +variable lbox index 10.0 +variable spacing index 5.0 + +# global model settings + +units real +atom_style full +boundary p p p +pair_style lj/cut/coul/long 14 +pair_modify mix arithmetic tail yes +kspace_style ewald 0.0001 +bond_style harmonic +angle_style harmonic + +# box, start molecules on simple cubic lattice + +lattice sc ${spacing} +lattice sc 5.0 +Lattice spacing in x,y,z = 5 5 5 +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 ${lbox} 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 ${lbox} units box +region box block 0 10.0 0 10.0 0 10.0 units box +create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 +Created orthogonal box = (0 0 0) to (10 10 10) + 1 by 2 by 2 MPI processor grid + +# we can load multiple molecule templates, but don't have to use them all +molecule co2mol CO2.txt +Read molecule co2mol: + 3 atoms with 2 types + 2 bonds with 1 types + 1 angles with 1 types + 0 dihedrals with 0 types + 0 impropers with 0 types +molecule h2omol H2O.txt +Read molecule h2omol: + 3 atoms with 2 types + 2 bonds with 1 types + 1 angles with 1 types + 0 dihedrals with 0 types + 0 impropers with 0 types +create_atoms 0 box mol h2omol 464563 units box +Created 24 atoms + Time spent = 0.00174451 secs + +# rigid SPC/E water model + +pair_coeff 1 1 0.15535 3.166 +pair_coeff * 2 0.0000 0.0000 + +bond_coeff 1 1000 1.0 +angle_coeff 1 100 109.47 + +# masses + +mass 1 15.9994 +mass 2 1.0 + +# MD settings + +group h2o type 1 2 +24 atoms in group h2o +neighbor 2.0 bin +neigh_modify every 1 delay 1 check yes +velocity all create ${temp} 54654 +velocity all create 338.0 54654 +timestep 1.0 + +minimize 0.0 0.0 100 1000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:168) +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.170448 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 16 + ghost atom cutoff = 16 + binsize = 8, bins = 2 2 2 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 11.85 | 11.85 | 11.85 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 338 -4.9610706 9.2628112e-06 18.211756 730.90791 + 100 338 -15.742442 0.14954269 7.579918 -637.49568 +Loop time of 0.0566185 on 4 procs for 100 steps with 24 atoms + +98.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -4.96106135393 -15.5388622715 -15.592899346 + Force two-norm initial, final = 15.474 18.1478 + Force max component initial, final = 5.80042 7.56514 + Final line search alpha, max atom move = 0.00151131 0.0114333 + Iterations, force evaluations = 100 328 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.0085177 | 0.016083 | 0.026787 | 5.3 | 28.41 +Bond | 0.00022459 | 0.00031394 | 0.00037575 | 0.0 | 0.55 +Kspace | 0.0049062 | 0.014122 | 0.02044 | 5.0 | 24.94 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.018515 | 0.02086 | 0.023246 | 1.2 | 36.84 +Output | 2.4796e-05 | 2.6047e-05 | 2.9802e-05 | 0.0 | 0.05 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.005213 | | | 9.21 + +Nlocal: 6 ave 8 max 3 min +Histogram: 1 0 0 0 1 0 0 0 0 2 +Nghost: 1722 ave 1725 max 1720 min +Histogram: 2 0 0 0 0 0 1 0 0 1 +Neighs: 1256.75 ave 2101 max 667 min +Histogram: 1 0 1 0 1 0 0 0 0 1 + +Total # of neighbors = 5027 +Ave neighs/atom = 209.458 +Ave special neighs/atom = 2 +Neighbor list builds = 0 +Dangerous builds = 0 +reset_timestep 0 +# rigid constraints with thermostat + +fix mynvt all nvt temp ${temp} ${temp} 100 +fix mynvt all nvt temp 338.0 ${temp} 100 +fix mynvt all nvt temp 338.0 338.0 100 +fix wshake all shake 0.0001 50 0 b 1 a 1 mol h2omol + 0 = # of size 2 clusters + 0 = # of size 3 clusters + 0 = # of size 4 clusters + 8 = # of frozen angles +# gcmc + + + +run 1000 +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.170448 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 518.26667 -15.742442 0 7.4303753 -613.0781 + 1000 369.81793 -54.202686 0 -37.667331 294.98823 +Loop time of 0.154891 on 4 procs for 1000 steps with 24 atoms + +Performance: 557.810 ns/day, 0.043 hours/ns, 6456.135 timesteps/s +98.3% 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.0154 | 0.028993 | 0.040525 | 5.5 | 18.72 +Bond | 0.00016999 | 0.0001902 | 0.00023293 | 0.0 | 0.12 +Kspace | 0.019093 | 0.028112 | 0.038976 | 4.3 | 18.15 +Neigh | 0.0020263 | 0.0022184 | 0.002408 | 0.4 | 1.43 +Comm | 0.04947 | 0.053627 | 0.058009 | 1.4 | 34.62 +Output | 2.5749e-05 | 2.7537e-05 | 3.2187e-05 | 0.0 | 0.02 +Modify | 0.035275 | 0.036815 | 0.038425 | 0.7 | 23.77 +Other | | 0.004909 | | | 3.17 + +Nlocal: 6 ave 8 max 3 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Nghost: 1331.5 ave 1369 max 1290 min +Histogram: 1 0 0 0 0 2 0 0 0 1 +Neighs: 1259.75 ave 1642 max 428 min +Histogram: 1 0 0 0 0 0 0 1 0 2 + +Total # of neighbors = 5039 +Ave neighs/atom = 209.958 +Ave special neighs/atom = 2 +Neighbor list builds = 27 +Dangerous builds = 0 + +variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) +fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake +fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake + +# atom counts + +variable oxygen atom "type==1" +variable hydrogen atom "type==2" +group oxygen dynamic all var oxygen +dynamic group oxygen defined +group hydrogen dynamic all var hydrogen +dynamic group hydrogen defined +variable nO equal count(oxygen) +variable nH equal count(hydrogen) + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) +variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) +compute_modify thermo_temp dynamic/dof yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH +thermo 1000 + +# run + +run 20000 +Ewald initialization ... +WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) + G vector (1/distance) = 0.170448 + estimated absolute RMS force accuracy = 0.0332064 + estimated relative force accuracy = 0.0001 + KSpace vectors: actual max1d max3d = 16 2 62 + kxmax kymax kzmax = 2 2 2 +WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) +0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc +0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc +WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:472) +Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH + 1000 369.81793 295.32434 -54.202686 16.535355 0.23910963 24 0 0 0 0 8 16 + 2000 84.544466 -2810.9047 -344.81664 14.364627 0.86677242 87 0.052198354 0.0099581757 0 0 29 58 + 3000 75.188527 -3688.256 -425.02228 14.567977 0.98632724 99 0.030546787 0.0049111089 0 0 33 66 + 4000 75.019396 -5669.3063 -427.69454 14.535207 0.98632724 99 0.019972039 0.0033375609 0 0 33 66 + 5000 90.415371 -2141.7596 -434.65925 17.518218 0.98632724 99 0.014909796 0.002514964 0 0 33 66 + 6000 78.212628 -943.75125 -428.80584 15.153904 0.98632724 99 0.01181521 0.0020316119 0 0 33 66 + 7000 71.754139 -2028.5122 -435.2139 13.902555 0.98632724 99 0.0099466198 0.0016755471 0 0 33 66 + 8000 84.446231 -1969.1657 -428.27313 16.361681 0.98632724 99 0.0084791272 0.0014442102 0 0 33 66 + 9000 70.952348 -2476.9812 -446.33824 14.170197 1.0162159 102 0.0077150892 0.0012556189 0 0 34 68 + 10000 71.418543 -1875.7083 -443.7214 14.263302 1.0162159 102 0.0068355714 0.0011197957 0 0 34 68 + 11000 86.094994 -4508.7581 -444.82687 17.194399 1.0162159 102 0.0061494515 0.0010082475 0 0 34 68 + 12000 81.906091 -1547.8105 -442.36719 16.357815 1.0162159 102 0.0055834729 0.00091775114 0 0 34 68 + 13000 57.221548 -4607.6222 -448.30939 11.42796 1.0162159 102 0.0051230355 0.00084046326 0 0 34 68 + 14000 61.288344 -2518.1779 -445.70636 12.240157 1.0162159 102 0.0047276997 0.00077602396 0 0 34 68 + 15000 85.787669 -2407.7111 -443.3834 17.133022 1.0162159 102 0.0043983485 0.00071920715 0 0 34 68 + 16000 74.845939 -3288.3403 -445.8247 14.947802 1.0162159 102 0.0042321884 0.00080654918 0 0 34 68 + 17000 73.835431 -1926.9566 -445.67476 14.745989 1.0162159 102 0.0039751059 0.00075470749 0 0 34 68 + 18000 72.634985 -3997.552 -447.2351 14.506243 1.0162159 102 0.0037395847 0.00071063946 0 0 34 68 + 19000 96.776472 -714.44132 -453.65552 19.904587 1.0461046 105 0.0036487876 0.00066993446 0 0 35 70 + 20000 75.470786 183.16972 -464.04688 15.522521 1.0461046 105 0.0034630763 0.00063350614 0 0 35 70 + 21000 65.658309 -773.41266 -466.27068 13.504331 1.0461046 105 0.003289113 0.00060198052 0 0 35 70 +Loop time of 84.4085 on 4 procs for 20000 steps with 105 atoms + +Performance: 20.472 ns/day, 1.172 hours/ns, 236.943 timesteps/s +98.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 6.3571 | 9.7574 | 13.984 | 90.7 | 11.56 +Bond | 0.026374 | 0.031321 | 0.035482 | 2.1 | 0.04 +Kspace | 0.57402 | 4.7894 | 8.1754 | 129.0 | 5.67 +Neigh | 0.34952 | 0.34987 | 0.35021 | 0.1 | 0.41 +Comm | 2.4028 | 2.4228 | 2.4372 | 0.9 | 2.87 +Output | 0.0012269 | 0.0012826 | 0.0014355 | 0.2 | 0.00 +Modify | 66.819 | 66.828 | 66.837 | 0.1 | 79.17 +Other | | 0.2281 | | | 0.27 + +Nlocal: 26.25 ave 31 max 22 min +Histogram: 1 0 1 0 0 0 1 0 0 1 +Nghost: 6049.25 ave 6133 max 5962 min +Histogram: 1 0 0 0 1 0 1 0 0 1 +Neighs: 23613 ave 35083 max 14025 min +Histogram: 1 0 0 1 1 0 0 0 0 1 + +Total # of neighbors = 94452 +Ave neighs/atom = 899.543 +Ave special neighs/atom = 2 +Neighbor list builds = 20428 +Dangerous builds = 0 + +Total wall time: 0:01:24 diff --git a/examples/gcmc/log.23Oct17.gcmc.lj.g++.1 b/examples/gcmc/log.23Oct17.gcmc.lj.g++.1 new file mode 100644 index 0000000000..a38dfeee77 --- /dev/null +++ b/examples/gcmc/log.23Oct17.gcmc.lj.g++.1 @@ -0,0 +1,136 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# GCMC for LJ simple fluid, no dynamics +# T = 2.0 +# rho ~ 0.5 +# p ~ 1.5 +# mu_ex ~ 0.0 +# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 + +# variables modifiable using -var command line switch + +variable mu index -1.25 +variable temp index 2.0 +variable disp index 1.0 +variable lbox index 5.0 + +# global model settings + +units lj +atom_style atomic +pair_style lj/cut 3.0 +pair_modify tail no # turn of to avoid triggering full_energy + +# box + +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 5.0 0 ${lbox} +region box block 0 5.0 0 5.0 0 5.0 +create_box 1 box +Created orthogonal box = (0 0 0) to (5 5 5) + 1 by 1 by 1 MPI processor grid + +# lj parameters + +pair_coeff * * 1.0 1.0 +mass * 1.0 + +# gcmc + +fix mygcmc all gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc all gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} +fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} +fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 1.0 + +# atom count + +variable type1 atom "type==1" +group type1 dynamic all var type1 +dynamic group type1 defined +variable n1 equal count(type1) + +# averaging + +variable rho equal density +variable p equal press +variable nugget equal 1.0e-8 +variable lambda equal 1.0 +variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+1e-08) +fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat +variable rhoav equal f_ave[1] +variable pav equal f_ave[2] +variable muexav equal f_ave[3] +variable n1av equal f_ave[4] + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) +compute_modify thermo_temp dynamic yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av +thermo 1000 + +# run + +run 10000 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, 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) = 0.433 | 0.433 | 0.433 Mbytes +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av + 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 + 1000 2.4038954 2.1735585 -2.7041368 3.5476844 0.496 62 0.064790036 0.06313096 0.1081294 0.54304 1.4513524 -0.025479219 64.98 + 2000 2.0461168 1.1913842 -2.9880181 3.0212194 0.512 64 0.067416408 0.066335853 0.11306166 0.52736 1.3274665 0.034690004 62.97 + 3000 1.7930436 1.3788681 -3.2212667 2.6505861 0.552 69 0.067733191 0.066877836 0.1133516 0.5344 1.3834744 0.0070582537 63.5 + 4000 1.981449 1.2541054 -2.8222868 2.9217977 0.472 59 0.068546991 0.067856412 0.11442807 0.52504 1.3815629 0.043309657 62.17 + 5000 2.0946818 1.0701629 -3.5213291 3.0977688 0.568 71 0.06813743 0.067567891 0.11342906 0.53824 1.4049567 -0.0054539777 64.15 + 6000 1.9793484 0.68224187 -3.410211 2.9247088 0.536 67 0.067797628 0.067420108 0.11295333 0.5384 1.401683 -0.0066894359 64.37 + 7000 2.1885798 1.6745012 -3.185499 3.2345922 0.544 68 0.068630201 0.068261832 0.11403705 0.5244 1.449239 0.045987399 62.33 + 8000 2.2175324 1.5897263 -3.078898 3.2759002 0.528 66 0.068180395 0.067899629 0.11332691 0.53928 1.5488388 -0.01075766 64.29 + 9000 1.8610779 1.0396231 -2.923262 2.7465908 0.496 62 0.068346453 0.068028117 0.1134132 0.52912 1.4352871 0.027082544 62.87 + 10000 2.1079271 1.1746643 -2.9112062 3.1091925 0.48 60 0.068352878 0.068054948 0.11335434 0.5316 1.4462327 0.018503094 63.2 +Loop time of 20.4081 on 1 procs for 10000 steps with 60 atoms + +Performance: 211680.375 tau/day, 490.001 timesteps/s +98.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.46484 | 0.46484 | 0.46484 | 0.0 | 2.28 +Neigh | 1.1447 | 1.1447 | 1.1447 | 0.0 | 5.61 +Comm | 0.1696 | 0.1696 | 0.1696 | 0.0 | 0.83 +Output | 0.000319 | 0.000319 | 0.000319 | 0.0 | 0.00 +Modify | 18.607 | 18.607 | 18.607 | 0.0 | 91.17 +Other | | 0.02194 | | | 0.11 + +Nlocal: 60 ave 60 max 60 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 663 ave 663 max 663 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 2133 ave 2133 max 2133 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 2133 +Ave neighs/atom = 35.55 +Neighbor list builds = 10000 +Dangerous builds = 0 +Total wall time: 0:00:20 diff --git a/examples/gcmc/log.23Oct17.gcmc.lj.g++.4 b/examples/gcmc/log.23Oct17.gcmc.lj.g++.4 new file mode 100644 index 0000000000..ea7dc8116f --- /dev/null +++ b/examples/gcmc/log.23Oct17.gcmc.lj.g++.4 @@ -0,0 +1,136 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# GCMC for LJ simple fluid, no dynamics +# T = 2.0 +# rho ~ 0.5 +# p ~ 1.5 +# mu_ex ~ 0.0 +# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 + +# variables modifiable using -var command line switch + +variable mu index -1.25 +variable temp index 2.0 +variable disp index 1.0 +variable lbox index 5.0 + +# global model settings + +units lj +atom_style atomic +pair_style lj/cut 3.0 +pair_modify tail no # turn of to avoid triggering full_energy + +# box + +region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 ${lbox} 0 ${lbox} +region box block 0 5.0 0 5.0 0 ${lbox} +region box block 0 5.0 0 5.0 0 5.0 +create_box 1 box +Created orthogonal box = (0 0 0) to (5 5 5) + 1 by 2 by 2 MPI processor grid + +# lj parameters + +pair_coeff * * 1.0 1.0 +mass * 1.0 + +# gcmc + +fix mygcmc all gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} +fix mygcmc all gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} +fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} +fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 1.0 + +# atom count + +variable type1 atom "type==1" +group type1 dynamic all var type1 +dynamic group type1 defined +variable n1 equal count(type1) + +# averaging + +variable rho equal density +variable p equal press +variable nugget equal 1.0e-8 +variable lambda equal 1.0 +variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+${nugget}) +variable muex equal -1.25-2.0*ln(density*1+1e-08) +fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat +variable rhoav equal f_ave[1] +variable pav equal f_ave[2] +variable muexav equal f_ave[3] +variable n1av equal f_ave[4] + +# output + +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) +variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) +variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) +variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) +compute_modify thermo_temp dynamic yes +thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av +thermo 1000 + +# run + +run 10000 +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 3.3 + ghost atom cutoff = 3.3 + binsize = 1.65, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, 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) = 0.4477 | 0.4477 | 0.4477 Mbytes +Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av + 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 + 1000 1.956397 1.7699101 -2.7889468 2.8864874 0.488 61 0.068894746 0.067229075 0.1141726 0.53288 1.3832798 0.013392866 63.44 + 2000 2.040943 0.56060899 -2.8001647 3.0077055 0.456 57 0.069858594 0.068831934 0.11629114 0.5232 1.3587174 0.049995794 62.19 + 3000 2.0004866 1.5736515 -3.3098044 2.9572411 0.552 69 0.069594029 0.068727791 0.11592543 0.53096 1.4129434 0.020022578 63.23 + 4000 2.1127942 2.642809 -2.8865084 3.1211733 0.528 66 0.070268697 0.069533235 0.11693806 0.52424 1.3444615 0.046884078 62.57 + 5000 2.3663648 1.354269 -3.1917346 3.4957662 0.528 66 0.070519633 0.069960064 0.11710321 0.52688 1.3595814 0.036270867 62.56 + 6000 1.9224136 0.82756699 -3.1965 2.839257 0.52 65 0.06985018 0.069474645 0.11628632 0.536 1.47062 0.00141549 63.76 + 7000 2.0266192 1.5593811 -2.9972341 2.9931606 0.52 65 0.070244693 0.069880791 0.11666541 0.52528 1.3246332 0.040754793 62.2 + 8000 1.7790467 1.8680568 -2.8028819 2.6275151 0.52 65 0.070454494 0.070172368 0.11736806 0.524 1.4213649 0.047985191 62.03 + 9000 1.7968847 1.3195587 -3.261001 2.6550983 0.536 67 0.069952011 0.069618327 0.11650087 0.53904 1.4624201 -0.01069837 64.36 + 10000 2.1566109 1.1015729 -3.4999837 3.1880335 0.552 69 0.069603309 0.069284134 0.11625548 0.53128 1.3587249 0.02075238 63.24 +Loop time of 23.8213 on 4 procs for 10000 steps with 69 atoms + +Performance: 181350.388 tau/day, 419.793 timesteps/s +97.6% 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.10935 | 0.11844 | 0.12741 | 2.1 | 0.50 +Neigh | 0.33 | 0.33945 | 0.35091 | 1.6 | 1.42 +Comm | 0.49249 | 0.51745 | 0.53856 | 2.7 | 2.17 +Output | 0.00053334 | 0.0007208 | 0.0007906 | 0.0 | 0.00 +Modify | 22.82 | 22.822 | 22.825 | 0.0 | 95.81 +Other | | 0.02289 | | | 0.10 + +Nlocal: 17.25 ave 23 max 10 min +Histogram: 1 0 0 0 0 0 2 0 0 1 +Nghost: 506.5 ave 519 max 490 min +Histogram: 1 0 1 0 0 0 0 0 0 2 +Neighs: 705.75 ave 998 max 369 min +Histogram: 1 0 0 0 0 1 1 0 0 1 + +Total # of neighbors = 2823 +Ave neighs/atom = 40.913 +Neighbor list builds = 10000 +Dangerous builds = 0 +Total wall time: 0:00:23 From ec067bde36a9f4035f027cfce8ca6a4595b452fc Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 13 Nov 2017 17:59:16 -0500 Subject: [PATCH 03/34] fix cut-n-paste error in create_bond docs --- doc/src/create_bonds.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/create_bonds.txt b/doc/src/create_bonds.txt index 5a87852169..6af69214d3 100644 --- a/doc/src/create_bonds.txt +++ b/doc/src/create_bonds.txt @@ -18,7 +18,7 @@ style = {many} or {single/bond} or {single/angle} or {single/dihedral} :ule,l group2-ID = ID of second group, bonds will be between atoms in the 2 groups btype = bond type of created bonds rmin = minimum distance between pair of atoms to bond together - rmax = minimum distance between pair of atoms to bond together + rmax = maximum distance between pair of atoms to bond together {single/bond} args = btype batom1 batom2 btype = bond type of new bond batom1,batom2 = atom IDs for two atoms in bond From 8e5d4fa891e43d37b97e49adc2063422c3d4a07d Mon Sep 17 00:00:00 2001 From: Stefan Paquay Date: Fri, 17 Nov 2017 14:12:16 -0500 Subject: [PATCH 04/34] Added a KOKKOS-enabled Yukawa pair style. --- src/KOKKOS/pair_yukawa_kokkos.cpp | 327 ++++++++++++++++++++++++++++++ src/KOKKOS/pair_yukawa_kokkos.h | 146 +++++++++++++ src/pair_yukawa.cpp | 2 - src/pair_yukawa.h | 3 +- 4 files changed, 474 insertions(+), 4 deletions(-) create mode 100644 src/KOKKOS/pair_yukawa_kokkos.cpp create mode 100644 src/KOKKOS/pair_yukawa_kokkos.h diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp new file mode 100644 index 0000000000..39233a9098 --- /dev/null +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -0,0 +1,327 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing authors: Stefan Paquay (Brandeis University) +------------------------------------------------------------------------- */ +#include +#include +// #include "pair_yukawa.h" +// #include "atom.h" +//#include "force.h" +//#include "comm.h" +//#include "neigh_list.h" +//#include "memory.h" +//#include "error.h" + +// These were added. +#include "pair_yukawa_kokkos.h" +#include "kokkos.h" +#include "atom_kokkos.h" +#include "comm.h" +#include "force.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "update.h" +#include "integrate.h" +#include "respa.h" +#include "math_const.h" +#include "memory.h" +#include "error.h" +#include "atom_masks.h" +// end These were added. + +using namespace LAMMPS_NS; +using namespace MathConst; + +#define KOKKOS_CUDA_MAX_THREADS 256 +#define KOKKOS_CUDA_MIN_BLOCKS 8 + +/* ---------------------------------------------------------------------- */ + +template +PairYukawaKokkos::PairYukawaKokkos(LAMMPS *lmp) : PairYukawa(lmp) +{ + respa_enable = 0; + + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + cutsq = NULL; +} + +/* ---------------------------------------------------------------------- */ + +template +PairYukawaKokkos::~PairYukawaKokkos() +{ + if (allocated) { + memory->destroy_kokkos(k_eatom,eatom); + memory->destroy_kokkos(k_vatom,vatom); + k_cutsq = DAT::tdual_ffloat_2d(); + memory->sfree(cutsq); + eatom = NULL; + vatom = NULL; + cutsq = NULL; + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairYukawaKokkos::cleanup_copy() { + // WHY needed: this prevents parent copy from deallocating any arrays + allocated = 0; + cutsq = NULL; + eatom = NULL; + vatom = NULL; +} + +/* ---------------------------------------------------------------------- + allocate all arrays +------------------------------------------------------------------------- */ + +template +void PairYukawaKokkos::allocate() +{ + PairYukawa::allocate(); + + int n = atom->ntypes; + memory->destroy(cutsq); + memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + k_params = Kokkos::DualView( + "PairYukawa::params",n+1,n+1); + + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +template +void PairYukawaKokkos::settings(int narg, char **arg) +{ + if (narg != 2) error->all(FLERR,"Illegal pair_style command"); + + PairYukawa::settings(2,arg); +} + + +/* ---------------------------------------------------------------------- + init specific to this pair style +------------------------------------------------------------------------- */ + +template +void PairYukawaKokkos::init_style() +{ + PairYukawa::init_style(); + + // error if rRESPA with inner levels + + if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) { + int respa = 0; + if (((Respa *) update->integrate)->level_inner >= 0) respa = 1; + if (((Respa *) update->integrate)->level_middle >= 0) respa = 2; + if (respa) + error->all(FLERR,"Cannot use Kokkos pair style with rRESPA inner/middle"); + } + + // irequest = neigh request made by parent class + + neighflag = lmp->kokkos->neighflag; + int irequest = neighbor->nrequest - 1; + + neighbor->requests[irequest]-> + kokkos_host = Kokkos::Impl::is_same::value && + !Kokkos::Impl::is_same::value; + neighbor->requests[irequest]-> + kokkos_device = Kokkos::Impl::is_same::value; + + if (neighflag == FULL) { + neighbor->requests[irequest]->full = 1; + neighbor->requests[irequest]->half = 0; + } else if (neighflag == HALF || neighflag == HALFTHREAD) { + neighbor->requests[irequest]->full = 0; + neighbor->requests[irequest]->half = 1; + } else if (neighflag == N2) { + neighbor->requests[irequest]->full = 0; + neighbor->requests[irequest]->half = 0; + } else { + error->all(FLERR,"Cannot use chosen neighbor list style with yukawa/kk"); + } +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ +// Rewrite this. +template +double PairYukawaKokkos::init_one(int i, int j) +{ + double cutone = PairYukawa::init_one(i,j); + + k_params.h_view(i,j).a = a[i][j]; + k_params.h_view(i,j).offset = offset[i][j]; + k_params.h_view(i,j).cutsq = cutone*cutone; + k_params.h_view(j,i) = k_params.h_view(i,j); + + if(i(); + k_params.template modify(); + + return cutone; +} + +/* ---------------------------------------------------------------------- */ + +template +void PairYukawaKokkos::compute(int eflag_in, int vflag_in) +{ + eflag = eflag_in; + vflag = vflag_in; + + + if (neighflag == FULL) no_virial_fdotr_compute = 1; + + if (eflag || vflag) ev_setup(eflag,vflag,0); + else evflag = vflag_fdotr = 0; + + // reallocate per-atom arrays if necessary + + if (eflag_atom) { + memory->destroy_kokkos(k_eatom,eatom); + memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + d_eatom = k_eatom.view(); + } + if (vflag_atom) { + memory->destroy_kokkos(k_vatom,vatom); + memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + d_vatom = k_vatom.view(); + } + + atomKK->sync(execution_space,datamask_read); + k_cutsq.template sync(); + k_params.template sync(); + if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); + else atomKK->modified(execution_space,F_MASK); + + x = atomKK->k_x.view(); + c_x = atomKK->k_x.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + tag = atomKK->k_tag.view(); + nlocal = atom->nlocal; + nall = atom->nlocal + atom->nghost; + newton_pair = force->newton_pair; + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + // loop over neighbors of my atoms + + EV_FLOAT ev = pair_compute,void >( + this,(NeighListKokkos*)list); + + if (eflag_global) eng_vdwl += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } +} + + + +template +template +KOKKOS_INLINE_FUNCTION +F_FLOAT PairYukawaKokkos:: +compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, + const int& itype, const int& jtype) const { + (void) i; + (void) j; + const F_FLOAT rr = sqrt(rsq); + // Fetch the params either off the stack or from some mapped memory? + const F_FLOAT aa = STACKPARAMS ? m_params[itype][jtype].a + : params(itype,jtype).a; + + // U = a * exp(-kappa*r) / r + // f = (kappa * a * exp(-kappa*r) / r + a*exp(-kappa*r)/r^2)*grad(r) + // = (kappa + 1/r) * (a * exp(-kappa*r) / r) + // f/r = (kappa + 1/r) * (a * exp(-kappa*r) / r^2) + const F_FLOAT rinv = 1.0 / rr; + const F_FLOAT rinv2 = rinv*rinv; + const F_FLOAT screening = exp(-kappa*rr); + const F_FLOAT forceyukawa = aa * screening * (kappa + rinv); + const F_FLOAT fpair = forceyukawa * rinv2; + + return fpair; +} + +template +template +KOKKOS_INLINE_FUNCTION +F_FLOAT PairYukawaKokkos:: +compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, + const int& itype, const int& jtype) const { + (void) i; + (void) j; + const F_FLOAT rr = sqrt(rsq); + const F_FLOAT aa = STACKPARAMS ? m_params[itype][jtype].a + : params(itype,jtype).a; + const F_FLOAT offset = STACKPARAMS ? m_params[itype][jtype].offset + : params(itype,jtype).offset; + + // U = a * exp(-kappa*r) / r + // f = (kappa * a * exp(-kappa*r) / r + a*exp(-kappa*r)/r^2)*grad(r) + // = (kappa + 1/r) * (a * exp(-kappa*r) / r) + // f/r = (kappa + 1/r) * (a * exp(-kappa*r) / r^2) + const F_FLOAT rinv = 1.0 / rr; + const F_FLOAT screening = exp(-kappa*rr); + + return aa * screening * rinv - offset; +} + + +namespace LAMMPS_NS { +template class PairYukawaKokkos; +#ifdef KOKKOS_HAVE_CUDA +template class PairYukawaKokkos; +#endif +} diff --git a/src/KOKKOS/pair_yukawa_kokkos.h b/src/KOKKOS/pair_yukawa_kokkos.h new file mode 100644 index 0000000000..1323bd1c39 --- /dev/null +++ b/src/KOKKOS/pair_yukawa_kokkos.h @@ -0,0 +1,146 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS + +PairStyle(yukawa/kk,PairYukawaKokkos) +PairStyle(yukawa/kk/device,PairYukawaKokkos) +PairStyle(yukawa/kk/host,PairYukawaKokkos) + +#else + +#ifndef LMP_PAIR_YUKAWA_KOKKOS_H +#define LMP_PAIR_YUKAWA_KOKKOS_H + +#include "pair_kokkos.h" +#include "pair_yukawa.h" +#include "neigh_list_kokkos.h" + +namespace LAMMPS_NS { + +template +class PairYukawaKokkos : public PairYukawa { + public: + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {COUL_FLAG=0}; + typedef DeviceType device_type; + + PairYukawaKokkos(class LAMMPS *); + virtual ~PairYukawaKokkos(); + + void compute(int, int); + void settings(int, char**); + void init_style(); + double init_one(int,int); + + struct params_yukawa { + KOKKOS_INLINE_FUNCTION + params_yukawa(){ cutsq=0, a = 0; offset = 0; } + KOKKOS_INLINE_FUNCTION + params_yukawa(int i){ cutsq=0, a = 0; offset = 0; } + F_FLOAT cutsq, a, offset; + }; + + + protected: + void cleanup_copy(); + + template + KOKKOS_INLINE_FUNCTION + F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, + const int& itype, const int& jtype) const; + + template + KOKKOS_INLINE_FUNCTION + F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, + const int& itype, const int& jtype) const; + + template + KOKKOS_INLINE_FUNCTION + F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, + const int& itype, const int& jtype) const + { + return 0; + } + + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + params_yukawa m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; + F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; + typename ArrayTypes::t_x_array_randomread x; + typename ArrayTypes::t_x_array c_x; + typename ArrayTypes::t_f_array f; + typename ArrayTypes::t_int_1d_randomread type; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename ArrayTypes::t_efloat_1d d_eatom; + typename ArrayTypes::t_virial_array d_vatom; + typename ArrayTypes::t_tagint_1d tag; + + int newton_pair; + double special_lj[4]; + + typename ArrayTypes::tdual_ffloat_2d k_cutsq; + typename ArrayTypes::t_ffloat_2d d_cutsq; + + + int neighflag; + int nlocal,nall,eflag,vflag; + + void allocate(); + friend class PairComputeFunctor; + friend class PairComputeFunctor; + friend class PairComputeFunctor; + friend class PairComputeFunctor; + friend class PairComputeFunctor; + friend class PairComputeFunctor; + friend class PairComputeFunctor; + friend class PairComputeFunctor; + friend EV_FLOAT pair_compute_neighlist( + PairYukawaKokkos*,NeighListKokkos*); + friend EV_FLOAT pair_compute_neighlist( + PairYukawaKokkos*,NeighListKokkos*); + friend EV_FLOAT pair_compute_neighlist( + PairYukawaKokkos*,NeighListKokkos*); + friend EV_FLOAT pair_compute_neighlist( + PairYukawaKokkos*,NeighListKokkos*); + friend EV_FLOAT pair_compute( + PairYukawaKokkos*,NeighListKokkos*); + friend void pair_virial_fdotr_compute(PairYukawaKokkos*); + +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +E: Cannot use chosen neighbor list style with yukawa/kk + +That style is not supported by Kokkos. + +*/ diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index 2ba6633d9e..0a83b2592d 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -38,7 +38,6 @@ PairYukawa::~PairYukawa() memory->destroy(setflag); memory->destroy(cutsq); - memory->destroy(rad); memory->destroy(cut); memory->destroy(a); memory->destroy(offset); @@ -140,7 +139,6 @@ void PairYukawa::allocate() memory->create(cutsq,n+1,n+1,"pair:cutsq"); - memory->create(rad,n+1,"pair:rad"); memory->create(cut,n+1,n+1,"pair:cut"); memory->create(a,n+1,n+1,"pair:a"); memory->create(offset,n+1,n+1,"pair:offset"); diff --git a/src/pair_yukawa.h b/src/pair_yukawa.h index 3859d163af..14839fe359 100644 --- a/src/pair_yukawa.h +++ b/src/pair_yukawa.h @@ -43,10 +43,9 @@ class PairYukawa : public Pair { protected: double cut_global; double kappa; - double *rad; double **cut,**a,**offset; - void allocate(); + virtual void allocate(); }; } From 53c1558271b0d1b999fae1289a710ef47ef55152 Mon Sep 17 00:00:00 2001 From: Stefan Paquay Date: Fri, 17 Nov 2017 14:21:54 -0500 Subject: [PATCH 05/34] Updated docs for pair_yukawa --- doc/src/pair_yukawa.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/src/pair_yukawa.txt b/doc/src/pair_yukawa.txt index 61d6bde6a9..e7c063ded9 100644 --- a/doc/src/pair_yukawa.txt +++ b/doc/src/pair_yukawa.txt @@ -9,6 +9,7 @@ pair_style yukawa command :h3 pair_style yukawa/gpu command :h3 pair_style yukawa/omp command :h3 +pair_style yukawa/kk command :h3 [Syntax:] From 5ba80662c33cc6516186506174751c2873299466 Mon Sep 17 00:00:00 2001 From: Stefan Paquay Date: Fri, 17 Nov 2017 15:07:59 -0500 Subject: [PATCH 06/34] Undid the removal of rad in pair_yukawa. --- src/pair_yukawa.cpp | 3 ++- src/pair_yukawa.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index 0a83b2592d..9be9237734 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -38,6 +38,7 @@ PairYukawa::~PairYukawa() memory->destroy(setflag); memory->destroy(cutsq); + memory->destroy(rad); memory->destroy(cut); memory->destroy(a); memory->destroy(offset); @@ -138,7 +139,7 @@ void PairYukawa::allocate() setflag[i][j] = 0; memory->create(cutsq,n+1,n+1,"pair:cutsq"); - + memory->create(rad,n+1,"pair:rad"); memory->create(cut,n+1,n+1,"pair:cut"); memory->create(a,n+1,n+1,"pair:a"); memory->create(offset,n+1,n+1,"pair:offset"); diff --git a/src/pair_yukawa.h b/src/pair_yukawa.h index 14839fe359..3222019a0a 100644 --- a/src/pair_yukawa.h +++ b/src/pair_yukawa.h @@ -43,6 +43,7 @@ class PairYukawa : public Pair { protected: double cut_global; double kappa; + double *rad; double **cut,**a,**offset; virtual void allocate(); From 9a5723123ff040085bbf43dcb44563023112f57f Mon Sep 17 00:00:00 2001 From: Anders Hafreager Date: Tue, 21 Nov 2017 23:43:52 -0800 Subject: [PATCH 07/34] Set peratom_freq in fix ave/chunk --- src/fix_ave_chunk.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 1060acd7bb..73df50c66c 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -63,6 +63,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : strcpy(idchunk,arg[6]); global_freq = nfreq; + peratom_freq = nfreq; no_change_box = 1; // expand args if any have wildcard character "*" From 5770a20e2c0b04935f0dfdeb8233f67d70bb8ad6 Mon Sep 17 00:00:00 2001 From: Jaap Kroes Date: Mon, 27 Nov 2017 21:16:51 +0100 Subject: [PATCH 08/34] added ExTeP to USER-MISC --- doc/src/Section_commands.txt | 1 + doc/src/lammps.book | 1 + doc/src/pair_extep.txt | 40 + doc/src/pairs.txt | 1 + examples/USER/misc/extep/BN.data | 116 +++ examples/USER/misc/extep/input | 29 + potentials/BN.extep | 127 ++++ src/USER-MISC/pair_extep.cpp | 1174 ++++++++++++++++++++++++++++++ src/USER-MISC/pair_extep.h | 225 ++++++ 9 files changed, 1714 insertions(+) create mode 100644 doc/src/pair_extep.txt create mode 100644 examples/USER/misc/extep/BN.data create mode 100644 examples/USER/misc/extep/input create mode 100644 potentials/BN.extep create mode 100755 src/USER-MISC/pair_extep.cpp create mode 100755 src/USER-MISC/pair_extep.h diff --git a/doc/src/Section_commands.txt b/doc/src/Section_commands.txt index 62d3bf3d71..6beae0b2c0 100644 --- a/doc/src/Section_commands.txt +++ b/doc/src/Section_commands.txt @@ -1045,6 +1045,7 @@ package"_Section_start.html#start_3. "edpd"_pair_meso.html, "eff/cut"_pair_eff.html, "exp6/rx"_pair_exp6_rx.html, +"extep"_pair_extep.html, "gauss/cut"_pair_gauss.html, "kolmogorov/crespi/z"_pair_kolmogorov_crespi_z.html, "lennard/mdf"_pair_mdf.html, diff --git a/doc/src/lammps.book b/doc/src/lammps.book index 0691f43e9b..09be3a3f9c 100644 --- a/doc/src/lammps.book +++ b/doc/src/lammps.book @@ -443,6 +443,7 @@ pair_edip.html pair_eff.html pair_eim.html pair_exp6_rx.html +pair_extep.html pair_gauss.html pair_gayberne.html pair_gran.html diff --git a/doc/src/pair_extep.txt b/doc/src/pair_extep.txt new file mode 100644 index 0000000000..9a784e2501 --- /dev/null +++ b/doc/src/pair_extep.txt @@ -0,0 +1,40 @@ +"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c + +:link(lws,http://lammps.sandia.gov) +:link(ld,Manual.html) +:link(lc,Section_commands.html#comm) + +:line + +pair_style extep command :h3 + +[Syntax:] + +pair_style extep :pre + +[Examples:] + +pair_style extep +pair_coeff * * BN.extep B N :pre + +[Description:] + +Style {extep} computes the Extended Tersoff Potential (ExTeP) +interactions as described in "(Los2017)"_#Los2017. + +:line + +[Restrictions:] none + +[Related commands:] + +"pair_tersoff" pair_tersoff.html + +[Default:] none + +:line + +:link(Los2017) +[(Los2017)] J. H. Los et al. "Extended Tersoff potential for boron nitride: +Energetics and elastic properties of pristine and defective h-BN", +Phys. Rev. B 96 (184108), 2017. diff --git a/doc/src/pairs.txt b/doc/src/pairs.txt index ec21b7a02e..ccd540bf44 100644 --- a/doc/src/pairs.txt +++ b/doc/src/pairs.txt @@ -32,6 +32,7 @@ Pair Styles :h1 pair_eff pair_eim pair_exp6_rx + pair_extep pair_gauss pair_gayberne pair_gran diff --git a/examples/USER/misc/extep/BN.data b/examples/USER/misc/extep/BN.data new file mode 100644 index 0000000000..3f51bdff61 --- /dev/null +++ b/examples/USER/misc/extep/BN.data @@ -0,0 +1,116 @@ +info: BN sample with r_BN=1.45 + +100 atoms +2 atom types + +0.0 21.75000000 xlo xhi +0.0 12.55736835 ylo yhi +0.0 50.00000000 zlo zhi + +Masses + +1 10.811 +2 14.0067 + +Atoms + + 1 1 0.00000000 0.00000000 0.00000000 + 2 2 1.45000000 0.00000000 0.00000000 + 3 1 2.17500000 1.25573684 0.00000000 + 4 2 3.62500000 1.25573684 0.00000000 + 5 1 0.00000000 2.51147367 0.00000000 + 6 2 1.45000000 2.51147367 0.00000000 + 7 1 2.17500000 3.76721051 0.00000000 + 8 2 3.62500000 3.76721051 0.00000000 + 9 1 0.00000000 5.02294734 0.00000000 + 10 2 1.45000000 5.02294734 0.00000000 + 11 1 2.17500000 6.27868418 0.00000000 + 12 2 3.62500000 6.27868418 0.00000000 + 13 1 0.00000000 7.53442101 0.00000000 + 14 2 1.45000000 7.53442101 0.00000000 + 15 1 2.17500000 8.79015785 0.00000000 + 16 2 3.62500000 8.79015785 0.00000000 + 17 1 0.00000000 10.04589468 0.00000000 + 18 2 1.45000000 10.04589468 0.00000000 + 19 1 2.17500000 11.30163152 0.00000000 + 20 2 3.62500000 11.30163152 0.00000000 + 21 1 4.35000000 0.00000000 0.00000000 + 22 2 5.80000000 0.00000000 0.00000000 + 23 1 6.52500000 1.25573684 0.00000000 + 24 2 7.97500000 1.25573684 0.00000000 + 25 1 4.35000000 2.51147367 0.00000000 + 26 2 5.80000000 2.51147367 0.00000000 + 27 1 6.52500000 3.76721051 0.00000000 + 28 2 7.97500000 3.76721051 0.00000000 + 29 1 4.35000000 5.02294734 0.00000000 + 30 2 5.80000000 5.02294734 0.00000000 + 31 1 6.52500000 6.27868418 0.00000000 + 32 2 7.97500000 6.27868418 0.00000000 + 33 1 4.35000000 7.53442101 0.00000000 + 34 2 5.80000000 7.53442101 0.00000000 + 35 1 6.52500000 8.79015785 0.00000000 + 36 2 7.97500000 8.79015785 0.00000000 + 37 1 4.35000000 10.04589468 0.00000000 + 38 2 5.80000000 10.04589468 0.00000000 + 39 1 6.52500000 11.30163152 0.00000000 + 40 2 7.97500000 11.30163152 0.00000000 + 41 1 8.70000000 0.00000000 0.00000000 + 42 2 10.15000000 0.00000000 0.00000000 + 43 1 10.87500000 1.25573684 0.00000000 + 44 2 12.32500000 1.25573684 0.00000000 + 45 1 8.70000000 2.51147367 0.00000000 + 46 2 10.15000000 2.51147367 0.00000000 + 47 1 10.87500000 3.76721051 0.00000000 + 48 2 12.32500000 3.76721051 0.00000000 + 49 1 8.70000000 5.02294734 0.00000000 + 50 2 10.15000000 5.02294734 0.00000000 + 51 1 10.87500000 6.27868418 0.00000000 + 52 2 12.32500000 6.27868418 0.00000000 + 53 1 8.70000000 7.53442101 0.00000000 + 54 2 10.15000000 7.53442101 0.00000000 + 55 1 10.87500000 8.79015785 0.00000000 + 56 2 12.32500000 8.79015785 0.00000000 + 57 1 8.70000000 10.04589468 0.00000000 + 58 2 10.15000000 10.04589468 0.00000000 + 59 1 10.87500000 11.30163152 0.00000000 + 60 2 12.32500000 11.30163152 0.00000000 + 61 1 13.05000000 0.00000000 0.00000000 + 62 2 14.50000000 0.00000000 0.00000000 + 63 1 15.22500000 1.25573684 0.00000000 + 64 2 16.67500000 1.25573684 0.00000000 + 65 1 13.05000000 2.51147367 0.00000000 + 66 2 14.50000000 2.51147367 0.00000000 + 67 1 15.22500000 3.76721051 0.00000000 + 68 2 16.67500000 3.76721051 0.00000000 + 69 1 13.05000000 5.02294734 0.00000000 + 70 2 14.50000000 5.02294734 0.00000000 + 71 1 15.22500000 6.27868418 0.00000000 + 72 2 16.67500000 6.27868418 0.00000000 + 73 1 13.05000000 7.53442101 0.00000000 + 74 2 14.50000000 7.53442101 0.00000000 + 75 1 15.22500000 8.79015785 0.00000000 + 76 2 16.67500000 8.79015785 0.00000000 + 77 1 13.05000000 10.04589468 0.00000000 + 78 2 14.50000000 10.04589468 0.00000000 + 79 1 15.22500000 11.30163152 0.00000000 + 80 2 16.67500000 11.30163152 0.00000000 + 81 1 17.40000000 0.00000000 0.00000000 + 82 2 18.85000000 0.00000000 0.00000000 + 83 1 19.57500000 1.25573684 0.00000000 + 84 2 21.02500000 1.25573684 0.00000000 + 85 1 17.40000000 2.51147367 0.00000000 + 86 2 18.85000000 2.51147367 0.00000000 + 87 1 19.57500000 3.76721051 0.00000000 + 88 2 21.02500000 3.76721051 0.00000000 + 89 1 17.40000000 5.02294734 0.00000000 + 90 2 18.85000000 5.02294734 0.00000000 + 91 1 19.57500000 6.27868418 0.00000000 + 92 2 21.02500000 6.27868418 0.00000000 + 93 1 17.40000000 7.53442101 0.00000000 + 94 2 18.85000000 7.53442101 0.00000000 + 95 1 19.57500000 8.79015785 0.00000000 + 96 2 21.02500000 8.79015785 0.00000000 + 97 1 17.40000000 10.04589468 0.00000000 + 98 2 18.85000000 10.04589468 0.00000000 + 99 1 19.57500000 11.30163152 0.00000000 +100 2 21.02500000 11.30163152 0.00000000 diff --git a/examples/USER/misc/extep/input b/examples/USER/misc/extep/input new file mode 100644 index 0000000000..d5e81eb82b --- /dev/null +++ b/examples/USER/misc/extep/input @@ -0,0 +1,29 @@ +# Initialization +units metal +boundary p p p +atom_style atomic +processors * * 1 + +# System and atom definition +read_data BN.data # read lammps data file + +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 +neigh_modify delay 0 +neigh_modify check yes + +# Potential +pair_style extep +pair_coeff * * ../../../../potentials/BN.extep B N + +# Output +thermo 10 +thermo_style custom step time etotal pe temp lx ly lz pxx pyy pzz spcpu +thermo_modify line one format float %14.8g + +# Setup NPT MD run +timestep 0.0001 # ps +velocity all create 300.0 12345 +fix thermos all npt temp 300 300 1.0 x 0 0 1.0 y 0 0 1.0 +run 1000 diff --git a/potentials/BN.extep b/potentials/BN.extep new file mode 100644 index 0000000000..13e87d885b --- /dev/null +++ b/potentials/BN.extep @@ -0,0 +1,127 @@ +# B and N mixture, parameterized for Tersoff potential +# values are from Albe et.al - Rad. Eff. Def. Sol. 141 (1997) 85. + +#values are calculated from Albe et. al from +# m = 3 +# gamma = 1 +# c = c, d=d +# cos(thetat0) = h +# n = n +# beta = gamma_albe +# lambda1=beta_albe*sqrt(2*S_albe) +# lambda2=beta_albe*sqrt(2/S_albe) +# lambda3=lambda3 +# A=D0/(S-1)*exp(lambda1*r0) +# B=S*D0/(S-1)*exp(lambda2*r0) +# R = R, D=D + +# Tersoff parameters for various elements and mixtures +# multiple entries can be added to this file, LAMMPS reads the ones it needs +# these entries are in LAMMPS "metal" units: +# A,B = eV; lambda1,lambda2,lambda3 = 1/Angstroms; R,D = Angstroms +# other quantities are unitless + +# format of a single entry (one or more lines): +#I J K m, gamma*, lambda3, c, d, h, n, gamma, lambda2, B, R, D, lambda1, A +B B B 3 1.0 0.0 26617.3000 141.2000 -0.1300 1.1422470 0.01498959 2.5211820 2768.7363631 2.0 0.2 2.6857244 3376.3350735 +N N N 3 1.0 0.0 23.5000 3.7500 -0.4000 0.6650000 0.01925100 2.6272721 2563.5603417 2.0 0.2 2.8293093 2978.9527928 +B B N 3 1.0 0.0 26617.3000 141.2000 -0.1300 1.1422470 0.01498959 2.5211820 2768.7363631 2.0 0.2 2.6857244 3376.3350735 +N N B 3 1.0 0.0 23.5000 3.7500 -0.4000 0.6650000 0.01925100 2.6272721 2563.5603417 2.0 0.2 2.8293093 2978.9527928 +B N B 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +B N N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +N B B 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +N B N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +# +# 1.9925 Bicubic Splines Parameters +# +# F_corr [ B, B] +# +#t1 t2 i j val dx dy dxy + B B 0 0 0.0000 0.0000 0.0000 0.0000 + B B 0 1 0.0054 0.0000 0.0000 0.0000 + B B 0 2 0.0182 0.0000 0.0000 0.0000 + B B 0 3 -0.0034 0.0000 0.0000 0.0000 + B B 0 4 -0.0034 0.0000 0.0000 0.0000 + B B 1 0 0.0054 0.0000 0.0000 0.0000 + B B 1 1 0.0100 0.0000 0.0000 0.0000 + B B 1 2 0.0062 0.0000 0.0000 0.0000 + B B 1 3 0.0154 0.0000 0.0000 0.0000 + B B 1 4 0.0154 0.0000 0.0000 0.0000 + B B 2 0 0.0182 0.0000 0.0000 0.0000 + B B 2 1 0.0062 0.0000 0.0000 0.0000 + B B 2 2 0.0154 0.0000 0.0000 0.0000 + B B 2 3 -0.0390 0.0000 -0.0727 0.0000 + B B 2 4 -0.0390 0.0000 -0.0727 0.0000 + B B 3 0 -0.0034 0.0000 0.0000 0.0000 + B B 3 1 0.0154 0.0000 0.0000 0.0000 + B B 3 2 -0.0390 -0.0727 0.0000 0.0000 + B B 3 3 -0.1300 0.0000 0.0000 0.0000 + B B 3 4 -0.1300 0.0000 0.0000 0.0000 + B B 4 0 -0.0034 0.0000 0.0000 0.0000 + B B 4 1 0.0154 0.0000 0.0000 0.0000 + B B 4 2 -0.0390 -0.0727 0.0000 0.0000 + B B 4 3 -0.1300 0.0000 0.0000 0.0000 + B B 4 4 -0.1300 0.0000 0.0000 0.0000 +# +# F_corr [ B, N] +# +#t1 t2 i j val dx dy dxy + B N 0 0 0.0170 0.0000 0.0000 0.0000 + B N 0 1 0.0078 0.0000 0.0000 0.0000 + B N 0 2 0.0000 0.0000 0.0000 0.0000 + B N 0 3 -0.0860 0.0000 0.0000 0.0000 + B N 0 4 -0.0860 0.0000 0.0000 0.0000 + B N 1 0 -0.0090 0.0000 0.0000 0.0000 + B N 1 1 0.0090 0.0000 0.0000 0.0000 + B N 1 2 -0.0068 0.0000 -0.0214 0.0000 + B N 1 3 -0.0338 0.0000 0.0388 0.0000 + B N 1 4 -0.0338 0.0000 0.0388 0.0000 + B N 2 0 0.0000 0.0000 0.0000 0.0000 + B N 2 1 -0.0198 0.0000 0.0000 0.0000 + B N 2 2 0.0000 0.0000 0.0000 0.0000 + B N 2 3 -0.0084 0.0000 0.0169 0.0000 + B N 2 4 -0.0084 0.0000 0.0169 0.0000 + B N 3 0 -0.0750 0.0000 0.0000 0.0000 + B N 3 1 -0.0168 0.0306 0.0000 0.0000 + B N 3 2 -0.0138 0.0084 0.0000 0.0000 + B N 3 3 0.0000 0.0000 0.0000 0.0000 + B N 3 4 0.0000 0.0000 0.0000 0.0000 + B N 4 0 -0.0750 0.0000 0.0000 0.0000 + B N 4 1 -0.0168 0.0306 0.0000 0.0000 + B N 4 2 -0.0138 0.0084 0.0000 0.0000 + B N 4 3 0.0000 0.0000 0.0000 0.0000 + B N 4 4 0.0000 0.0000 0.0000 0.0000 +# +# F_corr [ N, N] +# +#t1 t2 i j val dx dy dxy + N N 0 0 0.0000 0.0000 0.0000 0.0000 + N N 0 1 -0.0282 0.0000 0.0000 0.0000 + N N 0 2 -0.0018 0.0000 0.0000 0.0000 + N N 0 3 -0.0004 0.0000 0.0000 0.0000 + N N 0 4 -0.0004 0.0000 0.0000 0.0000 + N N 1 0 -0.0282 0.0000 0.0000 0.0000 + N N 1 1 0.0200 0.0000 0.0000 0.0000 + N N 1 2 0.0180 0.0162 -0.0027 0.0000 + N N 1 3 0.0146 0.0000 0.0000 0.0000 + N N 1 4 0.0146 0.0000 0.0000 0.0000 + N N 2 0 -0.0018 0.0000 0.0000 0.0000 + N N 2 1 0.0180 -0.0027 0.0162 0.0000 + N N 2 2 0.0306 0.0000 0.0000 0.0000 + N N 2 3 0.0060 0.0000 -0.0073 0.0000 + N N 2 4 0.0060 0.0000 -0.0073 0.0000 + N N 3 0 -0.0004 0.0000 0.0000 0.0000 + N N 3 1 0.0146 0.0000 0.0000 0.0000 + N N 3 2 0.0060 -0.0073 0.0000 0.0000 + N N 3 3 0.0000 0.0000 0.0000 0.0000 + N N 3 4 0.0000 0.0000 0.0000 0.0000 + N N 4 0 -0.0004 0.0000 0.0000 0.0000 + N N 4 1 0.0146 0.0000 0.0000 0.0000 + N N 4 2 0.0060 -0.0073 0.0000 0.0000 + N N 4 3 0.0000 0.0000 0.0000 0.0000 + N N 4 4 0.0000 0.0000 0.0000 0.0000 + +# Elastic properties +# ================== +# hBN: B=164 N/M; C11=290 N/M; kappa=0.64 eV +# cBN: B=402 GPa; C11=567 GPa; C66=533 GPa diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp new file mode 100755 index 0000000000..13ca404de3 --- /dev/null +++ b/src/USER-MISC/pair_extep.cpp @@ -0,0 +1,1174 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Jan Los +------------------------------------------------------------------------- */ + +#include "math.h" +#include "stdio.h" +#include "stdlib.h" +#include "string.h" +#include "pair_extep.h" +#include "atom.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "my_page.h" +#include "force.h" +#include "comm.h" +#include "memory.h" +#include "error.h" + +#include "math_const.h" + +using namespace LAMMPS_NS; +using namespace MathConst; + +#define MAXLINE 1024 +#define DELTA 4 +#define PGDELTA 1 + +/* ---------------------------------------------------------------------- */ + +PairExTeP::PairExTeP(LAMMPS *lmp) : Pair(lmp) +{ + single_enable = 0; + restartinfo = 0; + one_coeff = 1; + manybody_flag = 1; + ghostneigh = 1; + + nelements = 0; + elements = NULL; + nparams = maxparam = 0; + params = NULL; + elem2param = NULL; + + maxlocal = 0; + SR_numneigh = NULL; + SR_firstneigh = NULL; + ipage = NULL; + pgsize = oneatom = 0; + map = NULL; + + Nt = NULL; + Nd = NULL; +} + +/* ---------------------------------------------------------------------- + check if allocated, since class can be destructed when incomplete +------------------------------------------------------------------------- */ + +PairExTeP::~PairExTeP() +{ + if (elements) + for (int i = 0; i < nelements; i++) delete [] elements[i]; + delete [] elements; + memory->destroy(params); + memory->destroy(elem2param); + + memory->destroy(SR_numneigh); + memory->sfree(SR_firstneigh); + delete [] ipage; + memory->destroy(Nt); + memory->destroy(Nd); + + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(cutghost); + delete [] map; + } +} + +/* ---------------------------------------------------------------------- + create SR neighbor list from main neighbor list + SR neighbor list stores neighbors of ghost atoms +------------------------------------------------------------------------- */ + +void PairExTeP::SR_neigh() +{ + int i,j,ii,jj,n,allnum,jnum,itype,jtype,iparam_ij; + double xtmp,ytmp,ztmp,delx,dely,delz,rsq,dS; + int *ilist,*jlist,*numneigh,**firstneigh; + int *neighptr; + + double **x = atom->x; + int *type = atom->type; + + if (atom->nmax > maxlocal) { // ensure there is enough space + maxlocal = atom->nmax; // for atoms and ghosts allocated + memory->destroy(SR_numneigh); + memory->sfree(SR_firstneigh); + memory->destroy(Nt); + memory->destroy(Nd); + memory->create(SR_numneigh,maxlocal,"ExTeP:numneigh"); + SR_firstneigh = (int **) memory->smalloc(maxlocal*sizeof(int *), + "ExTeP:firstneigh"); + memory->create(Nt,maxlocal,"ExTeP:Nt"); + memory->create(Nd,maxlocal,"ExTeP:Nd"); + } + + allnum = list->inum + list->gnum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // store all SR neighs of owned and ghost atoms + // scan full neighbor list of I + + ipage->reset(); + + for (ii = 0; ii < allnum; ii++) { + i = ilist[ii]; + itype=map[type[i]]; + + n = 0; + neighptr = ipage->vget(); + + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + + Nt[i] = 0.0; + Nd[i] = 0.0; + + jlist = firstneigh[i]; + jnum = numneigh[i]; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + + jtype=map[type[j]]; + iparam_ij = elem2param[itype][jtype][jtype]; + + if (rsq < params[iparam_ij].cutsq) { + neighptr[n++] = j; + double tmp_fc = ters_fc(sqrt(rsq),¶ms[iparam_ij]); + Nt[i] += tmp_fc; + if(itype!=jtype) { + Nd[i] += tmp_fc; + } + } + } + //printf("SR_neigh : N[%d] = %f\n",i,N[i]); + + ipage->vgot(n); + if (ipage->status()) + error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); + } +} + + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::compute(int eflag, int vflag) +{ + int i,j,k,ii,jj,kk,inum,jnum; + int itype,jtype,ktype,iparam_ij,iparam_ijk; + tagint itag,jtag; + double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; + double rsq,rsq1,rsq2,r,r2; + double delr1[3],delr2[3],fi[3],fj[3],fk[3]; + double zeta_ij,prefactor; + int *ilist,*jlist,*numneigh,**firstneigh; + + evdwl = 0.0; + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = vflag_fdotr = vflag_atom = 0; + + SR_neigh(); + + double **x = atom->x; + double **f = atom->f; + tagint *tag = atom->tag; + int *type = atom->type; + int nlocal = atom->nlocal; + int newton_pair = force->newton_pair; + + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // loop over full neighbor list of my atoms + + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + itag = tag[i]; + itype = map[type[i]]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + + // two-body interactions, skip half of them + + jlist = firstneigh[i]; + jnum = numneigh[i]; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; + jtag = tag[j]; + + if (itag > jtag) { + if ((itag+jtag) % 2 == 0) continue; + } else if (itag < jtag) { + if ((itag+jtag) % 2 == 1) continue; + } else { + if (x[j][2] < x[i][2]) continue; + if (x[j][2] == ztmp && x[j][1] < ytmp) continue; + if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue; + } + + jtype = map[type[j]]; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + + iparam_ij = elem2param[itype][jtype][jtype]; + if (rsq > params[iparam_ij].cutsq) continue; + + repulsive(¶ms[iparam_ij],rsq,fpair,eflag,evdwl); + + f[i][0] += delx*fpair; + f[i][1] += dely*fpair; + f[i][2] += delz*fpair; + f[j][0] -= delx*fpair; + f[j][1] -= dely*fpair; + f[j][2] -= delz*fpair; + + if (evflag) ev_tally(i,j,nlocal,newton_pair, + evdwl,0.0,fpair,delx,dely,delz); + } + + // three-body interactions -(bij + Fcorrection) * fA + // skip immediately if I-J is not within cutoff + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; + jtag = tag[j]; + jtype = map[type[j]]; + iparam_ij = elem2param[itype][jtype][jtype]; + + delr1[0] = x[j][0] - xtmp; + delr1[1] = x[j][1] - ytmp; + delr1[2] = x[j][2] - ztmp; + rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2]; + if (rsq1 > params[iparam_ij].cutsq) continue; + + // accumulate bondorder zeta for each i-j interaction via loop over k + + zeta_ij = 0.0; + + /* F_IJ (1) */ + // compute correction to energy and forces + // dE/dr = -Fij(Zi,Zj) dV/dr + // - dFij/dZi dZi/dr V + // (conjugate term is computed when j is a central atom) + + double FXY, dFXY_dNdij, dFXY_dNdji, fa, fa_d, deng, fpair; + double Ntij = Nt[i]; + double Ndij = Nd[i]; + double Ntji = Nt[j]; + double Ndji = Nd[j]; + double r = sqrt(rsq1); + double fc_ij = ters_fc(r,¶ms[iparam_ij]); + + Ntij -= fc_ij; + Ntji -= fc_ij; + if(jtype!=itype) { + Ndij -= fc_ij; + Ndji -= fc_ij; + } + if(Ntij<0) { Ntij=0.; } + if(Ndij<0) { Ndij=0.; } + if(Ntji<0) { Ntji=0.; } + if(Ndji<0) { Ndji=0.; } + FXY = F_corr(itype, jtype, Ndij, Ndji, &dFXY_dNdij, &dFXY_dNdji); + + // envelop functions + double fenv, dfenv_ij; + fenv = envelop_function(Ntij, Ntji, &dfenv_ij); + // + double Fc = fenv * FXY; + double dFc_dNtij = dfenv_ij * FXY; + double dFc_dNdij = fenv * dFXY_dNdij; + + fa = ters_fa(r,¶ms[iparam_ij]); + fa_d = ters_fa_d(r,¶ms[iparam_ij]); + deng = 0.5 * fa * Fc; + fpair = 0.5 * fa_d * Fc / r; + + f[i][0] += delr1[0]*fpair; + f[i][1] += delr1[1]*fpair; + f[i][2] += delr1[2]*fpair; + f[j][0] -= delr1[0]*fpair; + f[j][1] -= delr1[1]*fpair; + f[j][2] -= delr1[2]*fpair; + + if (evflag) ev_tally(i,j,nlocal,newton_pair, + deng,0.0,-fpair,-delr1[0],-delr1[1],-delr1[2]); + /* END F_IJ (1) */ + + for (kk = 0; kk < jnum; kk++) { + if (jj == kk) continue; + k = jlist[kk]; + k &= NEIGHMASK; + ktype = map[type[k]]; + iparam_ijk = elem2param[itype][jtype][ktype]; + + delr2[0] = x[k][0] - xtmp; + delr2[1] = x[k][1] - ytmp; + delr2[2] = x[k][2] - ztmp; + rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2]; + if (rsq2 > params[iparam_ijk].cutsq) continue; + + r2 = sqrt(rsq2); + + zeta_ij += zeta(¶ms[iparam_ijk],r,r2,delr1,delr2); + + /* F_IJ (2) */ + // compute force components due to spline derivatives + // uses only the part with FXY_x (FXY_y is done when i and j are inversed) + int iparam_ik = elem2param[itype][ktype][0]; + double fc_ik_d = ters_fc_d(r2,¶ms[iparam_ik]); + double fc_prefac_ik_0 = 1.0 * fc_ik_d * fa / r2; + double fc_prefac_ik = dFc_dNtij * fc_prefac_ik_0; + f[i][0] += fc_prefac_ik * delr2[0]; + f[i][1] += fc_prefac_ik * delr2[1]; + f[i][2] += fc_prefac_ik * delr2[2]; + f[k][0] -= fc_prefac_ik * delr2[0]; + f[k][1] -= fc_prefac_ik * delr2[1]; + f[k][2] -= fc_prefac_ik * delr2[2]; + if ( itype != ktype ) { + fc_prefac_ik = dFc_dNdij * fc_prefac_ik_0; + f[i][0] += fc_prefac_ik * delr2[0]; + f[i][1] += fc_prefac_ik * delr2[1]; + f[i][2] += fc_prefac_ik * delr2[2]; + f[k][0] -= fc_prefac_ik * delr2[0]; + f[k][1] -= fc_prefac_ik * delr2[1]; + f[k][2] -= fc_prefac_ik * delr2[2]; + } + /* END F_IJ (2) */ + + } + + // pairwise force due to zeta + + force_zeta(¶ms[iparam_ij],r,zeta_ij,fpair,prefactor,eflag,evdwl); + + f[i][0] += delr1[0]*fpair; + f[i][1] += delr1[1]*fpair; + f[i][2] += delr1[2]*fpair; + f[j][0] -= delr1[0]*fpair; + f[j][1] -= delr1[1]*fpair; + f[j][2] -= delr1[2]*fpair; + + if (evflag) ev_tally(i,j,nlocal,newton_pair, + evdwl,0.0,-fpair,-delr1[0],-delr1[1],-delr1[2]); + + // attractive term via loop over k + + for (kk = 0; kk < jnum; kk++) { + if (jj == kk) continue; + k = jlist[kk]; + k &= NEIGHMASK; + ktype = map[type[k]]; + iparam_ijk = elem2param[itype][jtype][ktype]; + + delr2[0] = x[k][0] - xtmp; + delr2[1] = x[k][1] - ytmp; + delr2[2] = x[k][2] - ztmp; + rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2]; + if (rsq2 > params[iparam_ijk].cutsq) continue; + + attractive(¶ms[iparam_ijk],prefactor, + rsq1,rsq2,delr1,delr2,fi,fj,fk); + + + f[i][0] += fi[0]; + f[i][1] += fi[1]; + f[i][2] += fi[2]; + f[j][0] += fj[0]; + f[j][1] += fj[1]; + f[j][2] += fj[2]; + f[k][0] += fk[0]; + f[k][1] += fk[1]; + f[k][2] += fk[2]; + + if (vflag_atom) v_tally3(i,j,k,fj,fk,delr1,delr2); + } + } + } + + if (vflag_fdotr) virial_fdotr_compute(); +} + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::allocate() +{ + allocated = 1; + int n = atom->ntypes; + + memory->create(setflag,n+1,n+1,"pair:setflag"); + memory->create(cutsq,n+1,n+1,"pair:cutsq"); + memory->create(cutghost,n+1,n+1,"pair:cutghost"); + + map = new int[n+1]; +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairExTeP::settings(int narg, char **arg) +{ + if (narg != 0) error->all(FLERR,"Illegal pair_style command"); +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ + +void PairExTeP::coeff(int narg, char **arg) +{ + int i,j,n; + + if (!allocated) allocate(); + + if (narg != 3 + atom->ntypes) + error->all(FLERR,"Incorrect args for pair coefficients"); + + // insure I,J args are * * + + if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) + error->all(FLERR,"Incorrect args for pair coefficients"); + + // read args that map atom types to elements in potential file + // map[i] = which element the Ith atom type is, -1 if NULL + // nelements = # of unique elements + // elements = list of element names + + if (elements) { + for (i = 0; i < nelements; i++) delete [] elements[i]; + delete [] elements; + } + elements = new char*[atom->ntypes]; + for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + + nelements = 0; + for (i = 3; i < narg; i++) { + if (strcmp(arg[i],"NULL") == 0) { + map[i-2] = -1; + continue; + } + for (j = 0; j < nelements; j++) + if (strcmp(arg[i],elements[j]) == 0) break; + map[i-2] = j; + if (j == nelements) { + n = strlen(arg[i]) + 1; + elements[j] = new char[n]; + strcpy(elements[j],arg[i]); + nelements++; + } + } + + // read potential file and initialize potential parameters + + read_file(arg[2]); + spline_init(); + setup(); + + // clear setflag since coeff() called once with I,J = * * + + n = atom->ntypes; + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + setflag[i][j] = 0; + + // set setflag i,j for type pairs where both are mapped to elements + + int count = 0; + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + if (map[i] >= 0 && map[j] >= 0) { + setflag[i][j] = 1; + count++; + } + + if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); +} + +/* ---------------------------------------------------------------------- + init specific to this pair style +------------------------------------------------------------------------- */ + +void PairExTeP::init_style() +{ + if (atom->tag_enable == 0) + error->all(FLERR,"Pair style ExTeP requires atom IDs"); + if (force->newton_pair == 0) + error->all(FLERR,"Pair style ExTeP requires newton pair on"); + + // need a full neighbor list + + int irequest = neighbor->request(this); + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; + + // including neighbors of ghosts + neighbor->requests[irequest]->ghost = 1; + + // create pages if first time or if neighbor pgsize/oneatom has changed + + int create = 0; + if (ipage == NULL) create = 1; + if (pgsize != neighbor->pgsize) create = 1; + if (oneatom != neighbor->oneatom) create = 1; + + if (create) { + delete [] ipage; + pgsize = neighbor->pgsize; + oneatom = neighbor->oneatom; + + int nmypage= comm->nthreads; + ipage = new MyPage[nmypage]; + for (int i = 0; i < nmypage; i++) + ipage[i].init(oneatom,pgsize,PGDELTA); + } +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +double PairExTeP::init_one(int i, int j) +{ + if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set"); + + cutghost[i][j] = cutmax ; + cutghost[j][i] = cutghost[i][j]; + + return cutmax; +} + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::read_file(char *file) +{ + int params_per_line = 17; + char **words = new char*[params_per_line+1]; + + memory->sfree(params); + params = NULL; + nparams = maxparam = 0; + + // open file on proc 0 + + FILE *fp; + if (comm->me == 0) { + fp = force->open_potential(file); + if (fp == NULL) { + char str[128]; + sprintf(str,"Cannot open ExTeP potential file %s",file); + error->one(FLERR,str); + } + } + + // read each line out of file, skipping blank lines or leading '#' + // store line of params if all 3 element tags are in element list + + int n,nwords,ielement,jelement,kelement; + char line[MAXLINE],*ptr; + int eof = 0; + + while (1) { + if (comm->me == 0) { + ptr = fgets(line,MAXLINE,fp); + if (ptr == NULL) { + eof = 1; + fclose(fp); + } else n = strlen(line) + 1; + } + MPI_Bcast(&eof,1,MPI_INT,0,world); + if (eof) break; + MPI_Bcast(&n,1,MPI_INT,0,world); + MPI_Bcast(line,n,MPI_CHAR,0,world); + + // strip comment, skip line if blank + + if ((ptr = strchr(line,'#'))) *ptr = '\0'; + nwords = atom->count_words(line); + if (nwords == 0) continue; + + // concatenate additional lines until have params_per_line words + + while (nwords < params_per_line) { + n = strlen(line); + if (comm->me == 0) { + ptr = fgets(&line[n],MAXLINE-n,fp); + if (ptr == NULL) { + eof = 1; + fclose(fp); + } else n = strlen(line) + 1; + } + MPI_Bcast(&eof,1,MPI_INT,0,world); + if (eof) break; + MPI_Bcast(&n,1,MPI_INT,0,world); + MPI_Bcast(line,n,MPI_CHAR,0,world); + if ((ptr = strchr(line,'#'))) *ptr = '\0'; + nwords = atom->count_words(line); + } + + if (nwords != params_per_line) + error->all(FLERR,"Insufficient spline parameters in potential file"); + + // words = ptrs to all words in line + + nwords = 0; + words[nwords++] = strtok(line," \t\n\r\f"); + while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + + // ielement,jelement,kelement = 1st args + // if all 3 args are in element list, then parse this line + // else skip to next line + + for (ielement = 0; ielement < nelements; ielement++) + if (strcmp(words[0],elements[ielement]) == 0) break; + if (ielement == nelements) continue; + for (jelement = 0; jelement < nelements; jelement++) + if (strcmp(words[1],elements[jelement]) == 0) break; + if (jelement == nelements) continue; + for (kelement = 0; kelement < nelements; kelement++) + if (strcmp(words[2],elements[kelement]) == 0) break; + if (kelement == nelements) continue; + + // load up parameter settings and error check their values + + if (nparams == maxparam) { + maxparam += DELTA; + params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), + "pair:params"); + } + + params[nparams].ielement = ielement; + params[nparams].jelement = jelement; + params[nparams].kelement = kelement; + params[nparams].powerm = atof(words[3]); + params[nparams].gamma = atof(words[4]); + params[nparams].lam3 = atof(words[5]); + params[nparams].c = atof(words[6]); + params[nparams].d = atof(words[7]); + params[nparams].h = atof(words[8]); + params[nparams].powern = atof(words[9]); + params[nparams].beta = atof(words[10]); + params[nparams].lam2 = atof(words[11]); + params[nparams].bigb = atof(words[12]); + params[nparams].bigr = atof(words[13]); + params[nparams].bigd = atof(words[14]); + params[nparams].lam1 = atof(words[15]); + params[nparams].biga = atof(words[16]); + + // currently only allow m exponent of 1 or 3 + + params[nparams].powermint = int(params[nparams].powerm); + + if (params[nparams].c < 0.0 || params[nparams].d < 0.0 || + params[nparams].powern < 0.0 || params[nparams].beta < 0.0 || + params[nparams].lam2 < 0.0 || params[nparams].bigb < 0.0 || + params[nparams].bigr < 0.0 ||params[nparams].bigd < 0.0 || + params[nparams].bigd > params[nparams].bigr || + params[nparams].lam1 < 0.0 || params[nparams].biga < 0.0 || + params[nparams].powerm - params[nparams].powermint != 0.0 || + (params[nparams].powermint != 3 && params[nparams].powermint != 1) || + params[nparams].gamma < 0.0) + error->all(FLERR,"Illegal ExTeP parameter"); + + nparams++; + if(nparams >= pow(atom->ntypes,3)) break; + } + + // deallocate words array + delete [] words; + + /* F_IJ (3) */ + // read the spline coefficients + params_per_line = 8; + // reallocate with new size + words = new char*[params_per_line+1]; + + // intialize F_corr_data to all zeros + for(int iel=0;ielntypes;iel++) + for(int jel=0;jelntypes;jel++) + for(int in=0;in<4;in++) + for(int jn=0;jn<4;jn++) + for(int ivar=0;ivar<3;ivar++) + F_corr_data[iel][jel][in][jn][ivar]=0; + + // loop until EOF + while (1) { + if (comm->me == 0) { + ptr = fgets(line,MAXLINE,fp); + //fputs(line,stdout); + if (ptr == NULL) { + eof = 1; + fclose(fp); + } else n = strlen(line) + 1; + } + MPI_Bcast(&eof,1,MPI_INT,0,world); + if (eof) break; + MPI_Bcast(&n,1,MPI_INT,0,world); + MPI_Bcast(line,n,MPI_CHAR,0,world); + + // strip comment, skip line if blank + + if ((ptr = strchr(line,'#'))) *ptr = '\0'; + nwords = atom->count_words(line); + if (nwords == 0) continue; + + if (nwords != params_per_line) + error->all(FLERR,"Incorrect format in ExTeP potential file"); + + // words = ptrs to all words in line + + nwords = 0; + words[nwords++] = strtok(line," \t\n\r\f"); + while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + + // ielement,jelement = 1st args + // if all 3 args are in element list, then parse this line + // else skip to next line + // these lines set ielement and jelement to the integers matching the strings from the input + + for (ielement = 0; ielement < nelements; ielement++) + if (strcmp(words[0],elements[ielement]) == 0) break; + if (ielement == nelements) continue; + for (jelement = 0; jelement < nelements; jelement++) + if (strcmp(words[1],elements[jelement]) == 0) break; + if (jelement == nelements) continue; + + int Ni = atoi(words[2]); + int Nj = atoi(words[3]); + double spline_val = atof(words[4]); + double spline_derx = atof(words[5]); + double spline_dery = atof(words[6]); + + // Set value for all pairs of ielement,jelement (any kelement) + for(int iparam = 0; iparam < nparams; iparam++) { + if( ielement == params[iparam].ielement && jelement == params[iparam].jelement) { + F_corr_data[ielement][jelement][Ni][Nj][0] = spline_val; + F_corr_data[ielement][jelement][Ni][Nj][1] = spline_derx; + F_corr_data[ielement][jelement][Ni][Nj][2] = spline_dery; + + F_corr_data[jelement][ielement][Nj][Ni][0] = spline_val; + F_corr_data[jelement][ielement][Nj][Ni][1] = spline_dery; + F_corr_data[jelement][ielement][Nj][Ni][2] = spline_derx; + } + } + } + + delete [] words; + /* END F_IJ (3) */ + +} + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::setup() +{ + int i,j,k,m,n; + + // set elem2param for all element triplet combinations + // must be a single exact match to lines read from file + // do not allow for ACB in place of ABC + + memory->destroy(elem2param); + memory->create(elem2param,nelements,nelements,nelements,"pair:elem2param"); + + for (i = 0; i < nelements; i++) + for (j = 0; j < nelements; j++) + for (k = 0; k < nelements; k++) { + n = -1; + for (m = 0; m < nparams; m++) { + if (i == params[m].ielement && j == params[m].jelement && + k == params[m].kelement) { + if (n >= 0) error->all(FLERR,"Potential file has duplicate entry"); + n = m; + } + } + if (n < 0) error->all(FLERR,"Potential file is missing an entry"); + elem2param[i][j][k] = n; + } + + + // compute parameter values derived from inputs + + for (m = 0; m < nparams; m++) { + params[m].cut = params[m].bigr + params[m].bigd; + params[m].cutsq = params[m].cut*params[m].cut; + + params[m].c1 = pow(2.0*params[m].powern*1.0e-16,-1.0/params[m].powern); + params[m].c2 = pow(2.0*params[m].powern*1.0e-8,-1.0/params[m].powern); + params[m].c3 = 1.0/params[m].c2; + params[m].c4 = 1.0/params[m].c1; + } + + // set cutmax to max of all params + + cutmax = 0.0; + for (m = 0; m < nparams; m++) + if (params[m].cut > cutmax) cutmax = params[m].cut; +} + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::repulsive(Param *param, double rsq, double &fforce, + int eflag, double &eng) +{ + double r,tmp_fc,tmp_fc_d,tmp_exp; + + r = sqrt(rsq); + tmp_fc = ters_fc(r,param); + tmp_fc_d = ters_fc_d(r,param); + tmp_exp = exp(-param->lam1 * r); + fforce = -param->biga * tmp_exp * (tmp_fc_d - tmp_fc*param->lam1) / r; + if (eflag) eng = tmp_fc * param->biga * tmp_exp; +} + +/* ---------------------------------------------------------------------- */ + +double PairExTeP::zeta(Param *param, double rij, double rik, + double *delrij, double *delrik) +{ + double costheta,arg,ex_delr; + + costheta = (delrij[0]*delrik[0] + delrij[1]*delrik[1] + + delrij[2]*delrik[2]) / (rij*rik); + + if (param->powermint == 3) arg = pow(param->lam3 * (rij-rik),3.0); + else arg = param->lam3 * (rij-rik); + + if (arg > 69.0776) ex_delr = 1.e30; + else if (arg < -69.0776) ex_delr = 0.0; + else ex_delr = exp(arg); + + return ters_fc(rik,param) * ters_gijk(costheta,param) * ex_delr; +} + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::force_zeta(Param *param, double r, double zeta_ij, + double &fforce, double &prefactor, + int eflag, double &eng) +{ + double fa,fa_d,bij; + + fa = ters_fa(r,param); + fa_d = ters_fa_d(r,param); + bij = ters_bij(zeta_ij,param); + fforce = 0.5*bij*fa_d / r; + prefactor = -0.5*fa * ( ters_bij_d(zeta_ij,param) ); + if (eflag) eng = 0.5*bij*fa; +} + +/* ---------------------------------------------------------------------- + attractive term + use param_ij cutoff for rij test + use param_ijk cutoff for rik test +------------------------------------------------------------------------- */ + +void PairExTeP::attractive(Param *param, double prefactor, + double rsqij, double rsqik, + double *delrij, double *delrik, + double *fi, double *fj, double *fk) +{ + double rij_hat[3],rik_hat[3]; + double rij,rijinv,rik,rikinv; + + rij = sqrt(rsqij); + rijinv = 1.0/rij; + vec3_scale(rijinv,delrij,rij_hat); + + rik = sqrt(rsqik); + rikinv = 1.0/rik; + vec3_scale(rikinv,delrik,rik_hat); + + ters_zetaterm_d(prefactor,rij_hat,rij,rik_hat,rik,fi,fj,fk,param); +} + +/* ---------------------------------------------------------------------- */ + +double PairExTeP::ters_fc(double r, Param *param) +{ + double ters_R = param->bigr; + double ters_D = param->bigd; + + if (r < ters_R-ters_D) return 1.0; + if (r > ters_R+ters_D) return 0.0; + return 0.5*(1.0 - sin(MY_PI2*(r - ters_R)/ters_D)); +} + +/* ---------------------------------------------------------------------- */ + +double PairExTeP::ters_fc_d(double r, Param *param) +{ + double ters_R = param->bigr; + double ters_D = param->bigd; + + if (r < ters_R-ters_D) return 0.0; + if (r > ters_R+ters_D) return 0.0; + return -(MY_PI4/ters_D) * cos(MY_PI2*(r - ters_R)/ters_D); +} + +/* ---------------------------------------------------------------------- */ + +double PairExTeP::ters_fa(double r, Param *param) +{ + if (r > param->bigr + param->bigd) return 0.0; + return -param->bigb * exp(-param->lam2 * r) * ters_fc(r,param); +} + +/* ---------------------------------------------------------------------- */ + +double PairExTeP::ters_fa_d(double r, Param *param) +{ + if (r > param->bigr + param->bigd) return 0.0; + return param->bigb * exp(-param->lam2 * r) * + (param->lam2 * ters_fc(r,param) - ters_fc_d(r,param)); +} + +/* ---------------------------------------------------------------------- */ + +double PairExTeP::ters_bij(double zeta, Param *param) +{ + double tmp = param->beta * zeta; + if (tmp > param->c1) return 1.0/sqrt(tmp); + if (tmp > param->c2) + return (1.0 - pow(tmp,-param->powern) / (2.0*param->powern))/sqrt(tmp); + if (tmp < param->c4) return 1.0; + if (tmp < param->c3) + return 1.0 - pow(tmp,param->powern)/(2.0*param->powern); + return pow(1.0 + pow(tmp,param->powern), -1.0/(2.0*param->powern)); +} + +/* ---------------------------------------------------------------------- */ + +double PairExTeP::ters_bij_d(double zeta, Param *param) +{ + double tmp = param->beta * zeta; + if (tmp > param->c1) return param->beta * -0.5*pow(tmp,-1.5); + if (tmp > param->c2) + return param->beta * (-0.5*pow(tmp,-1.5) * + (1.0 - 0.5*(1.0 + 1.0/(2.0*param->powern)) * + pow(tmp,-param->powern))); + if (tmp < param->c4) return 0.0; + if (tmp < param->c3) + return -0.5*param->beta * pow(tmp,param->powern-1.0); + + double tmp_n = pow(tmp,param->powern); + return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*param->powern)))*tmp_n / zeta; +} + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::ters_zetaterm_d(double prefactor, + double *rij_hat, double rij, + double *rik_hat, double rik, + double *dri, double *drj, double *drk, + Param *param) +{ + double gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp; + double dcosdri[3],dcosdrj[3],dcosdrk[3]; + + fc = ters_fc(rik,param); + dfc = ters_fc_d(rik,param); + if (param->powermint == 3) tmp = pow(param->lam3 * (rij-rik),3.0); + else tmp = param->lam3 * (rij-rik); + + if (tmp > 69.0776) ex_delr = 1.e30; + else if (tmp < -69.0776) ex_delr = 0.0; + else ex_delr = exp(tmp); + + if (param->powermint == 3) + ex_delr_d = 3.0*pow(param->lam3,3.0) * pow(rij-rik,2.0)*ex_delr; + else ex_delr_d = param->lam3 * ex_delr; + + cos_theta = vec3_dot(rij_hat,rik_hat); + gijk = ters_gijk(cos_theta,param); + gijk_d = ters_gijk_d(cos_theta,param); + costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk); + + // compute the derivative wrt Ri + // dri = -dfc*gijk*ex_delr*rik_hat; + // dri += fc*gijk_d*ex_delr*dcosdri; + // dri += fc*gijk*ex_delr_d*(rik_hat - rij_hat); + + vec3_scale(-dfc*gijk*ex_delr,rik_hat,dri); + vec3_scaleadd(fc*gijk_d*ex_delr,dcosdri,dri,dri); + vec3_scaleadd(fc*gijk*ex_delr_d,rik_hat,dri,dri); + vec3_scaleadd(-fc*gijk*ex_delr_d,rij_hat,dri,dri); + vec3_scale(prefactor,dri,dri); + + // compute the derivative wrt Rj + // drj = fc*gijk_d*ex_delr*dcosdrj; + // drj += fc*gijk*ex_delr_d*rij_hat; + + vec3_scale(fc*gijk_d*ex_delr,dcosdrj,drj); + vec3_scaleadd(fc*gijk*ex_delr_d,rij_hat,drj,drj); + vec3_scale(prefactor,drj,drj); + + // compute the derivative wrt Rk + // drk = dfc*gijk*ex_delr*rik_hat; + // drk += fc*gijk_d*ex_delr*dcosdrk; + // drk += -fc*gijk*ex_delr_d*rik_hat; + + vec3_scale(dfc*gijk*ex_delr,rik_hat,drk); + vec3_scaleadd(fc*gijk_d*ex_delr,dcosdrk,drk,drk); + vec3_scaleadd(-fc*gijk*ex_delr_d,rik_hat,drk,drk); + vec3_scale(prefactor,drk,drk); +} + +/* ---------------------------------------------------------------------- */ + +void PairExTeP::costheta_d(double *rij_hat, double rij, + double *rik_hat, double rik, + double *dri, double *drj, double *drk) +{ + // first element is devative wrt Ri, second wrt Rj, third wrt Rk + + double cos_theta = vec3_dot(rij_hat,rik_hat); + + vec3_scaleadd(-cos_theta,rij_hat,rik_hat,drj); + vec3_scale(1.0/rij,drj,drj); + vec3_scaleadd(-cos_theta,rik_hat,rij_hat,drk); + vec3_scale(1.0/rik,drk,drk); + vec3_add(drj,drk,dri); + vec3_scale(-1.0,dri,dri); +} + + +/* ---------------------------------------------------------------------- */ + +/* F_IJ (4) */ +// initialize spline for F_corr (based on PairLCBOP::F_conj) + +void PairExTeP::spline_init() { + for( size_t iel=0; ielntypes; iel++) { + for( size_t jel=0; jelntypes; jel++) { + for( size_t N_ij=0; N_ij<4; N_ij++ ) { + for( size_t N_ji=0; N_ji<4; N_ji++ ) { + TF_corr_param &f = F_corr_param[iel][jel][N_ij][N_ji]; + + // corner points for each spline function + f.f_00 = F_corr_data[iel][jel][N_ij ][N_ji ][0]; + f.f_01 = F_corr_data[iel][jel][N_ij ][N_ji+1][0]; + f.f_10 = F_corr_data[iel][jel][N_ij+1][N_ji ][0]; + f.f_11 = F_corr_data[iel][jel][N_ij+1][N_ji+1][0]; + + // compute f tilde according to [Los & Fasolino, PRB 68, 024107 2003] + f.f_x_00 = F_corr_data[iel][jel][N_ij ][N_ji ][1] - f.f_10 + f.f_00; + f.f_x_01 = F_corr_data[iel][jel][N_ij ][N_ji+1][1] - f.f_11 + f.f_01; + f.f_x_10 = -(F_corr_data[iel][jel][N_ij+1][N_ji ][1] - f.f_10 + f.f_00); + f.f_x_11 = -(F_corr_data[iel][jel][N_ij+1][N_ji+1][1] - f.f_11 + f.f_01); + + f.f_y_00 = F_corr_data[iel][jel][N_ij ][N_ji ][2] - f.f_01 + f.f_00; + f.f_y_01 = -(F_corr_data[iel][jel][N_ij ][N_ji+1][2] - f.f_01 + f.f_00); + f.f_y_10 = F_corr_data[iel][jel][N_ij+1][N_ji ][2] - f.f_11 + f.f_10; + f.f_y_11 = -(F_corr_data[iel][jel][N_ij+1][N_ji+1][2] - f.f_11 + f.f_10); + + } + } + } + } +} + +double PairExTeP::envelop_function(double x, double y, double *func_der) { + double fx,fy,fxy,dfx,dfxydx; + double del, delsq; + + fxy = 1.0; + dfxydx = 0.0; + + if (x <= 3.0) { + fx = 1.0; + dfx = 0.0; + if(x < 1.0 && y < 1.0) { + double gx=(1.0-x); + double gy=(1.0-y); + double gxsq=gx*gx; + double gysq=gy*gy; + fxy = 1.0 - gxsq*gysq; + dfxydx = 2.0*gx*gysq; + } + } else if (x < 4.0) { + del = 4.0-x; + delsq = del*del; + fx = (3.0-2.0*del)*delsq; + dfx = - 6.0*del*(1.0-del); + } else { + fx = 0.0; + dfx = 0.0; + } + if (y <= 3.0) { + fy = 1.0; + } else if (y < 4.0) { + del = 4.0-y; + delsq = del*del; + fy = (3.0-2.0*del)*delsq; + } else { + fy = 0.0; + } + + double func_val = fxy*fx*fy; + *func_der = dfxydx*fx*fy+fxy*dfx*fy; + + return func_val; +} + +double PairExTeP::F_corr(int iel, int jel, double Ndij, double Ndji, double *dFN_x, double *dFN_y ) { + + // compute F_XY + + size_t Ndij_int = static_cast( floor( Ndij ) ); + size_t Ndji_int = static_cast( floor( Ndji ) ); + double x = Ndij - Ndij_int; + double y = Ndji - Ndji_int; + const TF_corr_param &f = F_corr_param[iel][jel][Ndij_int][Ndji_int]; + double F = 0; + double dF_dx = 0, dF_dy = 0; + double l, r; + if(Ndij_int < 4 && Ndji_int < 4) { + l = (1-y)* (1-x); r = ( f.f_00 + x* x* f.f_x_10 + y* y* f.f_y_01 ); F += l*r; dF_dx += -(1-y)*r +l*2*x* f.f_x_10; dF_dy += -(1-x)*r +l*2*y* f.f_y_01; + l = (1-y)* x; r = ( f.f_10 + (1-x)*(1-x)*f.f_x_00 + y* y* f.f_y_11 ); F += l*r; dF_dx += (1-y)*r -l*2*(1-x)*f.f_x_00; dF_dy += -x* r +l*2*y* f.f_y_11; + l = y* (1-x); r = ( f.f_01 + x* x* f.f_x_11 + (1-y)*(1-y)*f.f_y_00 ); F += l*r; dF_dx += -y* r +l*2*x* f.f_x_11; dF_dy += (1-x)*r -l*2*(1-y)*f.f_y_00; + l = y* x; r = ( f.f_11 + (1-x)*(1-x)*f.f_x_01 + (1-y)*(1-y)*f.f_y_10 ); F += l*r; dF_dx += y* r -l*2*(1-x)*f.f_x_01; dF_dy += x* r -l*2*(1-y)*f.f_y_10; + } + double result = F; + *dFN_x = dF_dx; + *dFN_y = dF_dy; + + return result; +} +/* F_IJ (4) */ + diff --git a/src/USER-MISC/pair_extep.h b/src/USER-MISC/pair_extep.h new file mode 100755 index 0000000000..bad433455e --- /dev/null +++ b/src/USER-MISC/pair_extep.h @@ -0,0 +1,225 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS + +PairStyle(extep,PairExTeP) + +#else + +#ifndef LMP_PAIR_EXTEP_H +#define LMP_PAIR_EXTEP_H + +#include "pair.h" +#include "my_page.h" + +#define MAXTYPES 8 +#define NSPLINE 5 + +namespace LAMMPS_NS { + +class PairExTeP : public Pair { + public: + PairExTeP(class LAMMPS *); + virtual ~PairExTeP(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + void init_style(); + double init_one(int, int); + + protected: + struct Param { + double lam1,lam2,lam3; + double c,d,h; + double gamma,powerm; + double powern,beta; + double biga,bigb,bigd,bigr; + double cut,cutsq; + double c1,c2,c3,c4; + int ielement,jelement,kelement; + int powermint; + double Z_i,Z_j; // added for ExTePZBL + double ZBLcut,ZBLexpscale; + double c5,ca1,ca4; // added for ExTePMOD + double powern_del; + }; + + Param *params; // parameter set for an I-J-K interaction + char **elements; // names of unique elements + int ***elem2param; // mapping from element triplets to parameters + int *map; // mapping from atom types to elements + double cutmax; // max cutoff for all elements + int nelements; // # of unique elements + int nparams; // # of stored parameter sets + int maxparam; // max # of parameter sets + + int maxlocal; // size of numneigh, firstneigh arrays + int maxpage; // # of pages currently allocated + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *SR_numneigh; // # of pair neighbors for each atom + int **SR_firstneigh; // ptr to 1st neighbor of each atom + + double *Nt, *Nd; // sum of cutoff fns ( f_C ) with SR neighs + + void allocate(); + void spline_init(); + virtual void read_file(char *); + virtual void setup(); + virtual void repulsive(Param *, double, double &, int, double &); + virtual double zeta(Param *, double, double, double *, double *); + virtual void force_zeta(Param *, double, double, double &, + double &, int, double &); + void attractive(Param *, double, double, double, double *, double *, + double *, double *, double *); + + virtual double ters_fc(double, Param *); + virtual double ters_fc_d(double, Param *); + virtual double ters_fa(double, Param *); + virtual double ters_fa_d(double, Param *); + virtual double ters_bij(double, Param *); + virtual double ters_bij_d(double, Param *); + + virtual void ters_zetaterm_d(double, double *, double, double *, double, + double *, double *, double *, Param *); + void costheta_d(double *, double, double *, double, + double *, double *, double *); + + // inlined functions for efficiency + + inline double ters_gijk(const double costheta, + const Param * const param) const { + const double ters_c = param->c * param->c; + const double ters_d = param->d * param->d; + const double hcth = param->h - costheta; + + return param->gamma*(1.0 + ters_c/ters_d - ters_c / (ters_d + hcth*hcth)); + } + + inline double ters_gijk_d(const double costheta, + const Param * const param) const { + const double ters_c = param->c * param->c; + const double ters_d = param->d * param->d; + const double hcth = param->h - costheta; + const double numerator = -2.0 * ters_c * hcth; + const double denominator = 1.0/(ters_d + hcth*hcth); + return param->gamma*numerator*denominator*denominator; + } + + inline double vec3_dot(const double x[3], const double y[3]) const { + return x[0]*y[0] + x[1]*y[1] + x[2]*y[2]; + } + + inline void vec3_add(const double x[3], const double y[3], + double * const z) const { + z[0] = x[0]+y[0]; z[1] = x[1]+y[1]; z[2] = x[2]+y[2]; + } + + inline void vec3_scale(const double k, const double x[3], + double y[3]) const { + y[0] = k*x[0]; y[1] = k*x[1]; y[2] = k*x[2]; + } + + inline void vec3_scaleadd(const double k, const double x[3], + const double y[3], double * const z) const { + z[0] = k*x[0]+y[0]; + z[1] = k*x[1]+y[1]; + z[2] = k*x[2]+y[2]; + } + + // splines parameters + // F[Ni=0-1, 1-2, 2-3, + // Nj=..., + struct TF_corr_param { + double + f_00, + f_01, + f_10, + f_11, + f_x_00, + f_x_01, + f_x_10, + f_x_11, + f_y_00, + f_y_01, + f_y_10, + f_y_11; + } F_corr_param[MAXTYPES][MAXTYPES][NSPLINE][NSPLINE]; + + double F_corr_data[MAXTYPES][MAXTYPES][NSPLINE][NSPLINE][3]; + + double F_corr( int, int, double, double, double*, double* ); + void SR_neigh(); + + double envelop_function(double, double, double*); + +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +E: Pair style ExTeP requires atom IDs + +This is a requirement to use the ExTeP potential. + +E: Pair style ExTeP requires newton pair on + +See the newton command. This is a restriction to use the ExTeP +potential. + +E: All pair coeffs are not set + +All pair coefficients must be set in the data file or by the +pair_coeff command before running a simulation. + +E: Cannot open ExTeP potential file %s + +The specified potential file cannot be opened. Check that the path +and name are correct. + +E: Incorrect format in ExTeP potential file + +Incorrect number of words per line in the potential file. + +E: Illegal ExTeP parameter + +One or more of the coefficients defined in the potential file is +invalid. + +E: Potential file has duplicate entry + +The potential file for a SW or ExTeP potential has more than +one entry for the same 3 ordered elements. + +E: Potential file is missing an entry + +The potential file for a SW or ExTeP potential does not have a +needed entry. + +*/ From 39d24ab7ebc91461d86fe0ad7f98afc89559ee64 Mon Sep 17 00:00:00 2001 From: Jaap Kroes Date: Mon, 27 Nov 2017 21:25:23 +0100 Subject: [PATCH 09/34] ExTeP potential file header update --- potentials/BN.extep | 90 +++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/potentials/BN.extep b/potentials/BN.extep index 13e87d885b..fd5e653fb5 100644 --- a/potentials/BN.extep +++ b/potentials/BN.extep @@ -1,42 +1,28 @@ -# B and N mixture, parameterized for Tersoff potential -# values are from Albe et.al - Rad. Eff. Def. Sol. 141 (1997) 85. - -#values are calculated from Albe et. al from -# m = 3 -# gamma = 1 -# c = c, d=d -# cos(thetat0) = h -# n = n -# beta = gamma_albe -# lambda1=beta_albe*sqrt(2*S_albe) -# lambda2=beta_albe*sqrt(2/S_albe) -# lambda3=lambda3 -# A=D0/(S-1)*exp(lambda1*r0) -# B=S*D0/(S-1)*exp(lambda2*r0) -# R = R, D=D - -# Tersoff parameters for various elements and mixtures -# multiple entries can be added to this file, LAMMPS reads the ones it needs -# these entries are in LAMMPS "metal" units: -# A,B = eV; lambda1,lambda2,lambda3 = 1/Angstroms; R,D = Angstroms -# other quantities are unitless - -# format of a single entry (one or more lines): -#I J K m, gamma*, lambda3, c, d, h, n, gamma, lambda2, B, R, D, lambda1, A -B B B 3 1.0 0.0 26617.3000 141.2000 -0.1300 1.1422470 0.01498959 2.5211820 2768.7363631 2.0 0.2 2.6857244 3376.3350735 -N N N 3 1.0 0.0 23.5000 3.7500 -0.4000 0.6650000 0.01925100 2.6272721 2563.5603417 2.0 0.2 2.8293093 2978.9527928 -B B N 3 1.0 0.0 26617.3000 141.2000 -0.1300 1.1422470 0.01498959 2.5211820 2768.7363631 2.0 0.2 2.6857244 3376.3350735 -N N B 3 1.0 0.0 23.5000 3.7500 -0.4000 0.6650000 0.01925100 2.6272721 2563.5603417 2.0 0.2 2.8293093 2978.9527928 -B N B 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 -B N N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 -N B B 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 -N B N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 -# -# 1.9925 Bicubic Splines Parameters -# -# F_corr [ B, B] -# -#t1 t2 i j val dx dy dxy +# B and N mixture, parameterized for Tersoff potential +# values are from Los et al. PhysRevB.96.184108 (2017) + +# Tersoff parameters for various elements and mixtures +# multiple entries can be added to this file, LAMMPS reads the ones it needs +# these entries are in LAMMPS "metal" units: +# A,B = eV; lambda1,lambda2,lambda3 = 1/Angstroms; R,D = Angstroms +# other quantities are unitless + +# format of a single entry (one or more lines): +#I J K m, gamma*, lambda3, c, d, h, n, gamma, lambda2, B, R, D, lambda1, A +B B B 3 1.0 0.0 26617.3000 141.2000 -0.1300 1.1422470 0.01498959 2.5211820 2768.7363631 2.0 0.2 2.6857244 3376.3350735 +N N N 3 1.0 0.0 23.5000 3.7500 -0.4000 0.6650000 0.01925100 2.6272721 2563.5603417 2.0 0.2 2.8293093 2978.9527928 +B B N 3 1.0 0.0 26617.3000 141.2000 -0.1300 1.1422470 0.01498959 2.5211820 2768.7363631 2.0 0.2 2.6857244 3376.3350735 +N N B 3 1.0 0.0 23.5000 3.7500 -0.4000 0.6650000 0.01925100 2.6272721 2563.5603417 2.0 0.2 2.8293093 2978.9527928 +B N B 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +B N N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +N B B 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +N B N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0.0027024851d0 2.69335d0 2595.6860833266d0 2.d0 0.2d0 2.95d0 3330.0655849887d0 +# +# 1.9925 Bicubic Splines Parameters +# +# F_corr [ B, B] +# +#t1 t2 i j val dx dy dxy B B 0 0 0.0000 0.0000 0.0000 0.0000 B B 0 1 0.0054 0.0000 0.0000 0.0000 B B 0 2 0.0182 0.0000 0.0000 0.0000 @@ -62,10 +48,10 @@ N B N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0 B B 4 2 -0.0390 -0.0727 0.0000 0.0000 B B 4 3 -0.1300 0.0000 0.0000 0.0000 B B 4 4 -0.1300 0.0000 0.0000 0.0000 -# -# F_corr [ B, N] -# -#t1 t2 i j val dx dy dxy +# +# F_corr [ B, N] +# +#t1 t2 i j val dx dy dxy B N 0 0 0.0170 0.0000 0.0000 0.0000 B N 0 1 0.0078 0.0000 0.0000 0.0000 B N 0 2 0.0000 0.0000 0.0000 0.0000 @@ -91,10 +77,10 @@ N B N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0 B N 4 2 -0.0138 0.0084 0.0000 0.0000 B N 4 3 0.0000 0.0000 0.0000 0.0000 B N 4 4 0.0000 0.0000 0.0000 0.0000 -# -# F_corr [ N, N] -# -#t1 t2 i j val dx dy dxy +# +# F_corr [ N, N] +# +#t1 t2 i j val dx dy dxy N N 0 0 0.0000 0.0000 0.0000 0.0000 N N 0 1 -0.0282 0.0000 0.0000 0.0000 N N 0 2 -0.0018 0.0000 0.0000 0.0000 @@ -120,8 +106,8 @@ N B N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0 N N 4 2 0.0060 -0.0073 0.0000 0.0000 N N 4 3 0.0000 0.0000 0.0000 0.0000 N N 4 4 0.0000 0.0000 0.0000 0.0000 - -# Elastic properties -# ================== -# hBN: B=164 N/M; C11=290 N/M; kappa=0.64 eV -# cBN: B=402 GPa; C11=567 GPa; C66=533 GPa + +# Elastic properties +# ================== +# hBN: B=164 N/M; C11=290 N/M; kappa=0.64 eV +# cBN: B=402 GPa; C11=567 GPa; C66=533 GPa From e1189381e041a351885f34b9407188c83df6c2c0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Nov 2017 11:19:19 -0500 Subject: [PATCH 10/34] correct documentation for create_atoms rotate This closes #736 --- doc/src/create_atoms.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/src/create_atoms.txt b/doc/src/create_atoms.txt index e14dd8c85e..ad13879c6d 100644 --- a/doc/src/create_atoms.txt +++ b/doc/src/create_atoms.txt @@ -36,9 +36,9 @@ keyword = {mol} or {basis} or {remap} or {var} or {set} or {units} :l {set} values = dim name dim = {x} or {y} or {z} name = name of variable to set with x, y, or z atom position - {rotate} values = Rx Ry Rz theta - Rx,Ry,Rz = rotation vector for single molecule + {rotate} values = theta Rx Ry Rz theta = rotation angle for single molecule (degrees) + Rx,Ry,Rz = rotation vector for single molecule {units} value = {lattice} or {box} {lattice} = the geometry is defined in lattice units {box} = the geometry is defined in simulation box units :pre @@ -242,15 +242,15 @@ write_dump all atom sinusoid.lammpstrj :pre :c,image(JPG/sinusoid_small.jpg,JPG/sinusoid.jpg) -The {rotate} keyword can be used with the {single} style, when adding -a single molecule to specify the orientation at which the molecule is -inserted. The axis of rotation is determined by the rotation vector -(Rx,Ry,Rz) that goes through the insertion point. The specified -{theta} determines the angle of rotation around that axis. Note that -the direction of rotation for the atoms around the rotation axis is -consistent with the right-hand rule: if your right-hand's thumb points -along {R}, then your fingers wrap around the axis in the direction of -rotation. +The {rotate} keyword can only be used with the {single} style and +when adding a single molecule. It allows to specify the orientation +at which the molecule is inserted. The axis of rotation is +determined by the rotation vector (Rx,Ry,Rz) that goes through the +insertion point. The specified {theta} determines the angle of +rotation around that axis. Note that the direction of rotation for +the atoms around the rotation axis is consistent with the right-hand +rule: if your right-hand's thumb points along {R}, then your fingers +wrap around the axis in the direction of rotation. The {units} keyword determines the meaning of the distance units used to specify the coordinates of the one particle created by the {single} From fa6fc947f231d639672457bcdf79bc3e65a54931 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Nov 2017 11:28:15 -0500 Subject: [PATCH 11/34] fix issues in FixNeighHistory and FixNeighHistoryOMP reported in https://sourceforge.net/p/lammps/mailman/message/36138319/ This supersedes and closes PR #734 --- src/USER-OMP/fix_neigh_history_omp.cpp | 2 +- src/fix_neigh_history.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/USER-OMP/fix_neigh_history_omp.cpp b/src/USER-OMP/fix_neigh_history_omp.cpp index ecc3147ed5..1b212732de 100644 --- a/src/USER-OMP/fix_neigh_history_omp.cpp +++ b/src/USER-OMP/fix_neigh_history_omp.cpp @@ -356,7 +356,7 @@ void FixNeighHistoryOMP::pre_exchange_newton() #endif { maxpartner = MAX(m,maxpartner); - comm->maxexchange_fix = MAX(comm->maxexchange_fix,4*maxpartner+1); + comm->maxexchange_fix = MAX(comm->maxexchange_fix,(dnum+1)*maxpartner+1); } } diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 322c8d5561..623fbff756 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -35,7 +35,7 @@ enum{DEFAULT,NPARTNER,PERPARTNER}; // also set in fix neigh/history/omp FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - npartner(NULL), partner(NULL), valuepartner(NULL), pair(NULL), + npartner(NULL), partner(NULL), valuepartner(NULL), pair(NULL), ipage_atom(NULL), dpage_atom(NULL), ipage_neigh(NULL), dpage_neigh(NULL) { if (narg != 4) error->all(FLERR,"Illegal fix NEIGH_HISTORY command"); @@ -295,7 +295,7 @@ void FixNeighHistory::pre_exchange_onesided() // set maxpartner = max # of partners of any owned atom // bump up comm->maxexchange_fix if necessary - + maxpartner = 0; for (i = 0; i < nlocal_neigh; i++) maxpartner = MAX(maxpartner,npartner[i]); comm->maxexchange_fix = MAX(comm->maxexchange_fix,(dnum+1)*maxpartner+1); @@ -318,7 +318,7 @@ void FixNeighHistory::pre_exchange_newton() int *allflags; double *allvalues,*onevalues,*jvalues; - // NOTE: all operations until very end are with + // NOTE: all operations until very end are with // nlocal_neigh <= current nlocal and nall_neigh // b/c previous neigh list was built with nlocal_neigh & nghost_neigh // nlocal can be larger if other fixes added atoms at this pre_exchange() @@ -424,7 +424,7 @@ void FixNeighHistory::pre_exchange_newton() maxpartner = 0; for (i = 0; i < nlocal_neigh; i++) maxpartner = MAX(maxpartner,npartner[i]); - comm->maxexchange_fix = MAX(comm->maxexchange_fix,4*maxpartner+1); + comm->maxexchange_fix = MAX(comm->maxexchange_fix,(dnum+1)*maxpartner+1); // zero npartner values from previous nlocal_neigh to current nlocal @@ -526,7 +526,7 @@ void FixNeighHistory::pre_exchange_no_newton() // set maxpartner = max # of partners of any owned atom // bump up comm->maxexchange_fix if necessary - + maxpartner = 0; for (i = 0; i < nlocal_neigh; i++) maxpartner = MAX(maxpartner,npartner[i]); comm->maxexchange_fix = MAX(comm->maxexchange_fix,(dnum+1)*maxpartner+1); @@ -571,9 +571,9 @@ void FixNeighHistory::post_neighbor() memory->sfree(firstflag); memory->sfree(firstvalue); maxatom = nall; - firstflag = (int **) + firstflag = (int **) memory->smalloc(maxatom*sizeof(int *),"neighbor_history:firstflag"); - firstvalue = (double **) + firstvalue = (double **) memory->smalloc(maxatom*sizeof(double *),"neighbor_history:firstvalue"); } @@ -720,7 +720,7 @@ int FixNeighHistory::pack_reverse_comm_size(int n, int first) last = first + n; for (i = first; i < last; i++) - m += 1 + 4*npartner[i]; + m += 1 + (dnum+1)*npartner[i]; return m; } From e4b14213b4b99e07973a91545dcaf17d95bd059a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Nov 2017 11:35:49 -0500 Subject: [PATCH 12/34] delete old log files. new log files are approved by @athomps --- examples/gcmc/log.6Jul17.gcmc.co2.g++.1 | 193 ---------------- examples/gcmc/log.6Jul17.gcmc.co2.g++.4 | 193 ---------------- examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 | 294 ------------------------ examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 | 294 ------------------------ examples/gcmc/log.6Jul17.gcmc.lj.g++.1 | 137 ----------- examples/gcmc/log.6Jul17.gcmc.lj.g++.4 | 137 ----------- 6 files changed, 1248 deletions(-) delete mode 100644 examples/gcmc/log.6Jul17.gcmc.co2.g++.1 delete mode 100644 examples/gcmc/log.6Jul17.gcmc.co2.g++.4 delete mode 100644 examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 delete mode 100644 examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 delete mode 100644 examples/gcmc/log.6Jul17.gcmc.lj.g++.1 delete mode 100644 examples/gcmc/log.6Jul17.gcmc.lj.g++.4 diff --git a/examples/gcmc/log.6Jul17.gcmc.co2.g++.1 b/examples/gcmc/log.6Jul17.gcmc.co2.g++.1 deleted file mode 100644 index 38bfa0bb87..0000000000 --- a/examples/gcmc/log.6Jul17.gcmc.co2.g++.1 +++ /dev/null @@ -1,193 +0,0 @@ -LAMMPS (22 Sep 2017) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) - using 1 OpenMP thread(s) per MPI task -# GCMC for CO2 molecular fluid, rigid/small/nvt dynamics -# Rigid CO2 TraPPE model -# [Potoff and J.I. Siepmann, Vapor-liquid equilibria of -# mixtures containing alkanes, carbon dioxide and -# nitrogen AIChE J., 47,1676-1682 (2001)]. - -# variables available on command line - -variable mu index -8.1 -variable disp index 0.5 -variable temp index 338.0 -variable lbox index 10.0 -variable spacing index 5.0 - -# global model settings - -units real -atom_style full -boundary p p p -pair_style lj/cut/coul/long 14 -pair_modify mix arithmetic tail yes -kspace_style ewald 0.0001 -bond_style harmonic -angle_style harmonic - -# box, start molecules on simple cubic lattice - -lattice sc ${spacing} -lattice sc 5.0 -Lattice spacing in x,y,z = 5 5 5 -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 10.0 units box -create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 -Created orthogonal box = (0 0 0) to (10 10 10) - 1 by 1 by 1 MPI processor grid -molecule co2mol CO2.txt -Read molecule co2mol: - 3 atoms with 2 types - 2 bonds with 1 types - 1 angles with 1 types - 0 dihedrals with 0 types - 0 impropers with 0 types -create_atoms 0 box mol co2mol 464563 units box -Created 24 atoms - Time spent = 0.00136113 secs - -# rigid CO2 TraPPE model - -pair_coeff 1 1 0.053649 2.8 -pair_coeff 2 2 0.156973 3.05 -bond_coeff 1 0 1.16 -angle_coeff 1 0 180 - -# masses - -mass 1 12.0107 -mass 2 15.9994 - -# MD settings - -group co2 type 1 2 -24 atoms in group co2 -neighbor 2.0 bin -neigh_modify every 1 delay 10 check yes -velocity all create ${temp} 54654 -velocity all create 338.0 54654 -timestep 1.0 - -# rigid constraints with thermostat - -fix myrigidnvt all rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol -fix myrigidnvt all rigid/nvt/small molecule temp 338.0 ${temp} 100 mol co2mol -fix myrigidnvt all rigid/nvt/small molecule temp 338.0 338.0 100 mol co2mol -8 rigid bodies with 24 atoms - 1.16 = max distance from body owner to body atom -fix_modify myrigidnvt dynamic/dof no - -# gcmc - -variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) -fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt - -# atom counts - -variable carbon atom "type==1" -variable oxygen atom "type==2" -group carbon dynamic all var carbon -dynamic group carbon defined -group oxygen dynamic all var oxygen -dynamic group oxygen defined -variable nC equal count(carbon) -variable nO equal count(oxygen) - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) -variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) -compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO -thermo 1000 - -# run - -run 20000 -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.164636 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) -0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc -0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 16 - ghost atom cutoff = 16 - binsize = 8, bins = 2 2 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut/coul/long, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 15.62 | 15.62 | 15.62 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO - 0 364.27579 4238.8631 -9.6809388 13.391989 0.5846359 24 0 0 0 0 8 16 -WARNING: Using kspace solver on system with no charge (../kspace.cpp:289) - 1000 420.43475 1722.4052 -9.6956122 15.456579 0.5846359 24 0.20879341 0.20713005 0 0 8 16 - 2000 302.29516 -547.83642 -22.017674 14.11699 0.73079488 30 0.1742478 0.1678018 0 0 10 20 - 3000 316.6934 -1080.2673 -8.2218902 10.069364 0.51155641 21 0.13544917 0.13720634 0 0 7 14 - 4000 246.81614 -679.83628 -14.57724 10.299968 0.65771539 27 0.1568939 0.15860229 0 0 9 18 - 5000 260.23291 -896.27949 -16.097524 10.859868 0.65771539 27 0.13138744 0.13547049 0 0 9 18 - 6000 291.64889 -1524.1007 -22.306243 13.619816 0.73079488 30 0.12615476 0.12717694 0 0 10 20 - 7000 235.90417 -565.40879 -27.600934 13.360525 0.87695385 36 0.119703 0.12145398 0 0 12 24 - 8000 483.381 2017.6258 -7.1315833 15.369247 0.51155641 21 0.10942279 0.11082908 0 0 7 14 - 9000 468.87446 -285.22545 -0.22330095 0.93175047 0.073079488 3 0.13029748 0.13349433 0 0 1 2 - 10000 245.34708 -254.65444 -16.192443 11.457551 0.73079488 30 0.15023549 0.15176828 0 0 10 20 - 11000 233.27704 523.81197 -24.29051 12.052812 0.80387436 33 0.1438083 0.14547187 0 0 11 22 - 12000 230.75966 -2161.9134 -23.812352 11.922746 0.80387436 33 0.1338274 0.13534617 0 0 11 22 - 13000 216.09982 -930.72014 -23.138263 11.16531 0.80387436 33 0.12480714 0.12612138 0 0 11 22 - 14000 343.12403 -327.36241 -16.995149 16.023672 0.73079488 30 0.12006081 0.12108416 0 0 10 20 - 15000 369.60805 581.40471 -11.495738 13.588021 0.5846359 24 0.11372814 0.11534691 0 0 8 16 - 16000 221.23125 -918.58249 -30.702491 12.529519 0.87695385 36 0.11489536 0.11560548 0 0 12 24 - 17000 301.82269 -450.56586 -14.373996 12.595466 0.65771539 27 0.11226626 0.11350321 0 0 9 18 - 18000 1065.1385 474.31881 -0.45476519 7.4082761 0.14615898 6 0.11419593 0.11580815 0 0 2 4 - 19000 217.29422 -1111.0114 -12.048289 7.988458 0.5846359 24 0.12564213 0.1261457 0 0 8 16 - 20000 353.35515 465.29269 -6.8428553 9.4795613 0.43847693 18 0.12529827 0.12590018 0 0 6 12 -Loop time of 14.604 on 1 procs for 20000 steps with 18 atoms - -Performance: 118.323 ns/day, 0.203 hours/ns, 1369.484 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 1.8966 | 1.8966 | 1.8966 | 0.0 | 12.99 -Bond | 0.019538 | 0.019538 | 0.019538 | 0.0 | 0.13 -Kspace | 0.14784 | 0.14784 | 0.14784 | 0.0 | 1.01 -Neigh | 0.070002 | 0.070002 | 0.070002 | 0.0 | 0.48 -Comm | 0.15055 | 0.15055 | 0.15055 | 0.0 | 1.03 -Output | 0.0017672 | 0.0017672 | 0.0017672 | 0.0 | 0.01 -Modify | 12.287 | 12.287 | 12.287 | 0.0 | 84.13 -Other | | 0.03089 | | | 0.21 - -Nlocal: 18 ave 18 max 18 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1335 ave 1335 max 1335 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2797 ave 2797 max 2797 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2797 -Ave neighs/atom = 155.389 -Ave special neighs/atom = 2 -Neighbor list builds = 20401 -Dangerous builds = 0 - -Total wall time: 0:00:14 diff --git a/examples/gcmc/log.6Jul17.gcmc.co2.g++.4 b/examples/gcmc/log.6Jul17.gcmc.co2.g++.4 deleted file mode 100644 index 6b39fda263..0000000000 --- a/examples/gcmc/log.6Jul17.gcmc.co2.g++.4 +++ /dev/null @@ -1,193 +0,0 @@ -LAMMPS (22 Sep 2017) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) - using 1 OpenMP thread(s) per MPI task -# GCMC for CO2 molecular fluid, rigid/small/nvt dynamics -# Rigid CO2 TraPPE model -# [Potoff and J.I. Siepmann, Vapor-liquid equilibria of -# mixtures containing alkanes, carbon dioxide and -# nitrogen AIChE J., 47,1676-1682 (2001)]. - -# variables available on command line - -variable mu index -8.1 -variable disp index 0.5 -variable temp index 338.0 -variable lbox index 10.0 -variable spacing index 5.0 - -# global model settings - -units real -atom_style full -boundary p p p -pair_style lj/cut/coul/long 14 -pair_modify mix arithmetic tail yes -kspace_style ewald 0.0001 -bond_style harmonic -angle_style harmonic - -# box, start molecules on simple cubic lattice - -lattice sc ${spacing} -lattice sc 5.0 -Lattice spacing in x,y,z = 5 5 5 -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 10.0 units box -create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 -Created orthogonal box = (0 0 0) to (10 10 10) - 1 by 2 by 2 MPI processor grid -molecule co2mol CO2.txt -Read molecule co2mol: - 3 atoms with 2 types - 2 bonds with 1 types - 1 angles with 1 types - 0 dihedrals with 0 types - 0 impropers with 0 types -create_atoms 0 box mol co2mol 464563 units box -Created 24 atoms - Time spent = 0.00223303 secs - -# rigid CO2 TraPPE model - -pair_coeff 1 1 0.053649 2.8 -pair_coeff 2 2 0.156973 3.05 -bond_coeff 1 0 1.16 -angle_coeff 1 0 180 - -# masses - -mass 1 12.0107 -mass 2 15.9994 - -# MD settings - -group co2 type 1 2 -24 atoms in group co2 -neighbor 2.0 bin -neigh_modify every 1 delay 10 check yes -velocity all create ${temp} 54654 -velocity all create 338.0 54654 -timestep 1.0 - -# rigid constraints with thermostat - -fix myrigidnvt all rigid/nvt/small molecule temp ${temp} ${temp} 100 mol co2mol -fix myrigidnvt all rigid/nvt/small molecule temp 338.0 ${temp} 100 mol co2mol -fix myrigidnvt all rigid/nvt/small molecule temp 338.0 338.0 100 mol co2mol -8 rigid bodies with 24 atoms - 1.16 = max distance from body owner to body atom -fix_modify myrigidnvt dynamic/dof no - -# gcmc - -variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) -fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert ${tfac} group co2 rigid myrigidnvt -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol co2mol tfac_insert 1.66666666666667 group co2 rigid myrigidnvt - -# atom counts - -variable carbon atom "type==1" -variable oxygen atom "type==2" -group carbon dynamic all var carbon -dynamic group carbon defined -group oxygen dynamic all var oxygen -dynamic group oxygen defined -variable nC equal count(carbon) -variable nO equal count(oxygen) - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) -variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) -compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO -thermo 1000 - -# run - -run 20000 -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.164636 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) -0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc -0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 16 - ghost atom cutoff = 16 - binsize = 8, bins = 2 2 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut/coul/long, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 15.41 | 15.41 | 15.41 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nC v_nO - 0 386.52184 23582.465 -3.2433417 14.209828 0.5846359 24 0 0 0 0 8 16 -WARNING: Using kspace solver on system with no charge (../kspace.cpp:289) - 1000 335.66829 -3.7743052 -4.6268612 7.3374649 0.36539744 15 0.20601899 0.20787963 0 0 5 10 - 2000 459.73529 238.91592 -0.42937831 5.4815343 0.21923846 9 0.30392058 0.30105616 0 0 3 6 - 3000 255.47773 -479.67802 -36.850434 15.738299 0.95003334 39 0.22220744 0.2197582 0 0 13 26 - 4000 182.70803 -1059.2265 -43.04484 12.163134 1.0231128 42 0.16781689 0.16716177 0 0 14 28 - 5000 234.00901 -1821.0459 -46.047939 15.578313 1.0231128 42 0.13498091 0.13704201 0 0 14 28 - 6000 163.42358 -774.64962 -49.686149 11.691232 1.0961923 45 0.11401677 0.11296973 0 0 15 30 - 7000 171.36765 -359.28792 -49.34022 12.259546 1.0961923 45 0.098302308 0.098552065 0 0 15 30 - 8000 215.2905 -905.73479 -38.206404 13.262629 0.95003334 39 0.086608098 0.086135456 0 0 13 26 - 9000 185.19905 -2320.8255 -52.964346 13.249037 1.0961923 45 0.077379246 0.077059206 0 0 15 30 - 10000 241.5783 -1410.8134 -51.37248 17.282377 1.0961923 45 0.069600048 0.069395413 0 0 15 30 - 11000 153.38332 -2647.9572 -53.967244 10.972957 1.0961923 45 0.063207938 0.06315287 0 0 15 30 - 12000 188.93059 -1639.9304 -52.218219 13.515989 1.0961923 45 0.05816163 0.058001715 0 0 15 30 - 13000 243.39974 -1127.2881 -44.54519 16.203468 1.0231128 42 0.053682268 0.053700858 0 0 14 28 - 14000 200.88474 -272.11992 -41.725507 13.373183 1.0231128 42 0.050212054 0.050071222 0 0 14 28 - 15000 204.6505 -1616.9057 -44.631997 13.623875 1.0231128 42 0.046944632 0.046920585 0 0 14 28 - 16000 169.22546 105.40991 -42.46103 11.26558 1.0231128 42 0.044460451 0.044287314 0 0 14 28 - 17000 163.55389 -783.34837 -36.841459 10.075477 0.95003334 39 0.042304052 0.042283048 0 0 13 26 - 18000 499.48334 -503.24838 -8.94456 15.881226 0.51155641 21 0.04035334 0.040870565 0 0 7 14 - 19000 658.81004 391.68747 -2.6979013 11.12813 0.29231795 12 0.055391781 0.056188676 0 0 4 8 - 20000 489.87356 -122.40743 -13.636951 18.00938 0.5846359 24 0.061378424 0.061821941 0 0 8 16 -Loop time of 17.1274 on 4 procs for 20000 steps with 24 atoms - -Performance: 100.891 ns/day, 0.238 hours/ns, 1167.718 timesteps/s -99.7% 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.81646 | 1.1504 | 1.4937 | 23.0 | 6.72 -Bond | 0.011878 | 0.012255 | 0.013296 | 0.5 | 0.07 -Kspace | 0.23802 | 0.58086 | 0.91304 | 32.3 | 3.39 -Neigh | 0.04321 | 0.043291 | 0.043372 | 0.0 | 0.25 -Comm | 0.90855 | 0.90959 | 0.91112 | 0.1 | 5.31 -Output | 0.0011697 | 0.0012506 | 0.001482 | 0.4 | 0.01 -Modify | 14.362 | 14.365 | 14.367 | 0.1 | 83.87 -Other | | 0.06436 | | | 0.38 - -Nlocal: 6 ave 8 max 4 min -Histogram: 1 0 1 0 0 0 0 1 0 1 -Nghost: 1465.25 ave 1556 max 1376 min -Histogram: 1 0 1 0 0 0 0 1 0 1 -Neighs: 1243.5 ave 1726 max 748 min -Histogram: 1 0 0 1 0 0 1 0 0 1 - -Total # of neighbors = 4974 -Ave neighs/atom = 207.25 -Ave special neighs/atom = 2 -Neighbor list builds = 20375 -Dangerous builds = 0 - -Total wall time: 0:00:17 diff --git a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 b/examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 deleted file mode 100644 index a40760d25f..0000000000 --- a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.1 +++ /dev/null @@ -1,294 +0,0 @@ -LAMMPS (22 Sep 2017) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) - using 1 OpenMP thread(s) per MPI task -# fix gcmc example with fix shake - -# variables available on command line - -variable mu index -8.1 -variable disp index 0.5 -variable temp index 338.0 -variable lbox index 10.0 -variable spacing index 5.0 - -# global model settings - -units real -atom_style full -boundary p p p -pair_style lj/cut/coul/long 14 -pair_modify mix arithmetic tail yes -kspace_style ewald 0.0001 -bond_style harmonic -angle_style harmonic - -# box, start molecules on simple cubic lattice - -lattice sc ${spacing} -lattice sc 5.0 -Lattice spacing in x,y,z = 5 5 5 -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 10.0 units box -create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 -Created orthogonal box = (0 0 0) to (10 10 10) - 1 by 1 by 1 MPI processor grid - -# we can load multiple molecule templates, but don't have to use them all -molecule co2mol CO2.txt -Read molecule co2mol: - 3 atoms with 2 types - 2 bonds with 1 types - 1 angles with 1 types - 0 dihedrals with 0 types - 0 impropers with 0 types -molecule h2omol H2O.txt -Read molecule h2omol: - 3 atoms with 2 types - 2 bonds with 1 types - 1 angles with 1 types - 0 dihedrals with 0 types - 0 impropers with 0 types -create_atoms 0 box mol h2omol 464563 units box -Created 24 atoms - Time spent = 0.00136209 secs - -# rigid SPC/E water model - -pair_coeff 1 1 0.15535 3.166 -pair_coeff * 2 0.0000 0.0000 - -bond_coeff 1 1000 1.0 -angle_coeff 1 100 109.47 - -# masses - -mass 1 15.9994 -mass 2 1.0 - -# MD settings - -group h2o type 1 2 -24 atoms in group h2o -neighbor 2.0 bin -neigh_modify every 1 delay 1 check yes -velocity all create ${temp} 54654 -velocity all create 338.0 54654 -timestep 1.0 - -minimize 0.0 0.0 100 1000 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:168) -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 16 - ghost atom cutoff = 16 - binsize = 8, bins = 2 2 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut/coul/long, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 11.88 | 11.88 | 11.88 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 338 -4.1890564 9.2628112e-06 18.98377 739.06991 - 100 338 -27.771871 0.61137788 -3.9876753 -2259.9107 -Loop time of 0.0333829 on 1 procs for 100 steps with 24 atoms - -99.8% CPU use with 1 MPI tasks x 1 OpenMP threads - -Minimization stats: - Stopping criterion = max iterations - Energy initial, next-to-last, final = - -4.18904713252 -26.8589493819 -27.1604926722 - Force two-norm initial, final = 18.0027 28.6823 - Force max component initial, final = 5.8993 11.77 - Final line search alpha, max atom move = 0.00301381 0.0354725 - Iterations, force evaluations = 100 239 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.028252 | 0.028252 | 0.028252 | 0.0 | 84.63 -Bond | 0.00025415 | 0.00025415 | 0.00025415 | 0.0 | 0.76 -Kspace | 0.0017328 | 0.0017328 | 0.0017328 | 0.0 | 5.19 -Neigh | 0.00038004 | 0.00038004 | 0.00038004 | 0.0 | 1.14 -Comm | 0.0022359 | 0.0022359 | 0.0022359 | 0.0 | 6.70 -Output | 2.1935e-05 | 2.1935e-05 | 2.1935e-05 | 0.0 | 0.07 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.0005062 | | | 1.52 - -Nlocal: 24 ave 24 max 24 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 2047 ave 2047 max 2047 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 4939 ave 4939 max 4939 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 4939 -Ave neighs/atom = 205.792 -Ave special neighs/atom = 2 -Neighbor list builds = 2 -Dangerous builds = 0 -reset_timestep 0 -# rigid constraints with thermostat - -fix mynvt all nvt temp ${temp} ${temp} 100 -fix mynvt all nvt temp 338.0 ${temp} 100 -fix mynvt all nvt temp 338.0 338.0 100 -fix wshake all shake 0.0001 50 0 b 1 a 1 mol h2omol - 0 = # of size 2 clusters - 0 = # of size 3 clusters - 0 = # of size 4 clusters - 8 = # of frozen angles -# gcmc - - - -run 1000 -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 518.26667 -27.771871 0 -4.5990532 3.1322213 - 1000 277.5448 -45.272615 0 -32.86299 -1575.2641 -Loop time of 0.101694 on 1 procs for 1000 steps with 24 atoms - -Performance: 849.609 ns/day, 0.028 hours/ns, 9833.435 timesteps/s -99.2% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.078345 | 0.078345 | 0.078345 | 0.0 | 77.04 -Bond | 0.00010109 | 0.00010109 | 0.00010109 | 0.0 | 0.10 -Kspace | 0.0079424 | 0.0079424 | 0.0079424 | 0.0 | 7.81 -Neigh | 0.003454 | 0.003454 | 0.003454 | 0.0 | 3.40 -Comm | 0.0080469 | 0.0080469 | 0.0080469 | 0.0 | 7.91 -Output | 1.9073e-05 | 1.9073e-05 | 1.9073e-05 | 0.0 | 0.02 -Modify | 0.0026064 | 0.0026064 | 0.0026064 | 0.0 | 2.56 -Other | | 0.001179 | | | 1.16 - -Nlocal: 24 ave 24 max 24 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1688 ave 1688 max 1688 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 4952 ave 4952 max 4952 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 4952 -Ave neighs/atom = 206.333 -Ave special neighs/atom = 2 -Neighbor list builds = 26 -Dangerous builds = 0 - -variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) -fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake - -# atom counts - -variable oxygen atom "type==1" -variable hydrogen atom "type==2" -group oxygen dynamic all var oxygen -dynamic group oxygen defined -group hydrogen dynamic all var hydrogen -dynamic group hydrogen defined -variable nO equal count(oxygen) -variable nH equal count(hydrogen) - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) -variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) -compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH -thermo 1000 - -# run - -run 20000 -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) -0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc -0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) -Per MPI rank memory allocation (min/avg/max) = 11.63 | 11.63 | 11.63 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH - 1000 277.5448 -1575.1516 -45.272615 12.409625 0.23910963 24 0 0 0 0 8 16 - 2000 84.31104 -7419.6538 -330.36966 13.319705 0.80699501 81 0.048183096 0.0099581757 0 0 27 54 - 3000 79.654082 -7034.6542 -345.84563 13.058853 0.83688372 84 0.027492109 0.0068755525 0 0 28 56 - 4000 73.831702 -3905.1456 -380.27757 12.984619 0.89666113 90 0.020637774 0.0060076096 0 0 30 60 - 5000 95.397292 -3523.6886 -414.9618 18.483479 0.98632724 99 0.016897769 0.0045269353 0 0 33 66 - 6000 74.46018 -4913.3009 -425.33102 14.426857 0.98632724 99 0.013390571 0.0036569014 0 0 33 66 - 7000 59.601812 -3108.7781 -425.91441 11.548009 0.98632724 99 0.01160439 0.0033510941 0 0 33 66 - 8000 74.104787 -1710.7687 -444.03326 14.799784 1.0162159 102 0.010174953 0.0028884203 0 0 34 68 - 9000 92.497957 -1255.2193 -435.57266 18.473162 1.0162159 102 0.0089594585 0.0025112378 0 0 34 68 - 10000 71.075249 -3191.4633 -454.19438 14.618465 1.0461046 105 0.0081585853 0.0022395915 0 0 35 70 - 11000 60.402203 -2011.6602 -461.68383 12.423277 1.0461046 105 0.0073396679 0.0020164949 0 0 35 70 - 12000 92.903919 -3023.4452 -462.20701 19.108096 1.0461046 105 0.0066641451 0.0018355023 0 0 35 70 - 13000 51.285407 -1016.3672 -466.29402 10.548172 1.0461046 105 0.0061145907 0.0016809265 0 0 35 70 - 14000 72.733554 -3284.3632 -463.38578 14.959539 1.0461046 105 0.0056427384 0.0015520479 0 0 35 70 - 15000 76.324778 -1795.0839 -477.59722 16.153186 1.0759934 108 0.005391524 0.0014384143 0 0 36 72 - 16000 78.185379 345.92387 -481.1903 16.546959 1.0759934 108 0.0050257238 0.0013442486 0 0 36 72 - 17000 79.868226 -3095.839 -478.59141 16.903113 1.0759934 108 0.0047204383 0.0012578458 0 0 36 72 - 18000 69.578814 -1884.4164 -482.28013 14.725487 1.0759934 108 0.0044407568 0.0011843991 0 0 36 72 - 19000 73.973471 -1943.8906 -480.82986 15.655561 1.0759934 108 0.0042016342 0.0011165574 0 0 36 72 - 20000 59.614528 -2439.1076 -485.78451 12.616671 1.0759934 108 0.0040927265 0.0011614279 0 0 36 72 - 21000 89.393596 -728.94872 -484.62787 18.919038 1.0759934 108 0.0038871336 0.0011036309 0 0 36 72 -Loop time of 148.361 on 1 procs for 20000 steps with 108 atoms - -Performance: 11.647 ns/day, 2.061 hours/ns, 134.806 timesteps/s -99.9% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 26.404 | 26.404 | 26.404 | 0.0 | 17.80 -Bond | 0.058909 | 0.058909 | 0.058909 | 0.0 | 0.04 -Kspace | 0.58222 | 0.58222 | 0.58222 | 0.0 | 0.39 -Neigh | 0.81976 | 0.81976 | 0.81976 | 0.0 | 0.55 -Comm | 0.60514 | 0.60514 | 0.60514 | 0.0 | 0.41 -Output | 0.00070596 | 0.00070596 | 0.00070596 | 0.0 | 0.00 -Modify | 119.77 | 119.77 | 119.77 | 0.0 | 80.73 -Other | | 0.1157 | | | 0.08 - -Nlocal: 108 ave 108 max 108 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7908 ave 7908 max 7908 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 99854 ave 99854 max 99854 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 99854 -Ave neighs/atom = 924.574 -Ave special neighs/atom = 2 -Neighbor list builds = 20442 -Dangerous builds = 0 - -Total wall time: 0:02:28 diff --git a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 b/examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 deleted file mode 100644 index 9dcc60f849..0000000000 --- a/examples/gcmc/log.6Jul17.gcmc.h2o.g++.4 +++ /dev/null @@ -1,294 +0,0 @@ -LAMMPS (22 Sep 2017) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) - using 1 OpenMP thread(s) per MPI task -# fix gcmc example with fix shake - -# variables available on command line - -variable mu index -8.1 -variable disp index 0.5 -variable temp index 338.0 -variable lbox index 10.0 -variable spacing index 5.0 - -# global model settings - -units real -atom_style full -boundary p p p -pair_style lj/cut/coul/long 14 -pair_modify mix arithmetic tail yes -kspace_style ewald 0.0001 -bond_style harmonic -angle_style harmonic - -# box, start molecules on simple cubic lattice - -lattice sc ${spacing} -lattice sc 5.0 -Lattice spacing in x,y,z = 5 5 5 -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 ${lbox} 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 ${lbox} units box -region box block 0 10.0 0 10.0 0 10.0 units box -create_box 2 box bond/types 1 angle/types 1 extra/bond/per/atom 2 extra/angle/per/atom 1 extra/special/per/atom 2 -Created orthogonal box = (0 0 0) to (10 10 10) - 1 by 2 by 2 MPI processor grid - -# we can load multiple molecule templates, but don't have to use them all -molecule co2mol CO2.txt -Read molecule co2mol: - 3 atoms with 2 types - 2 bonds with 1 types - 1 angles with 1 types - 0 dihedrals with 0 types - 0 impropers with 0 types -molecule h2omol H2O.txt -Read molecule h2omol: - 3 atoms with 2 types - 2 bonds with 1 types - 1 angles with 1 types - 0 dihedrals with 0 types - 0 impropers with 0 types -create_atoms 0 box mol h2omol 464563 units box -Created 24 atoms - Time spent = 0.00236797 secs - -# rigid SPC/E water model - -pair_coeff 1 1 0.15535 3.166 -pair_coeff * 2 0.0000 0.0000 - -bond_coeff 1 1000 1.0 -angle_coeff 1 100 109.47 - -# masses - -mass 1 15.9994 -mass 2 1.0 - -# MD settings - -group h2o type 1 2 -24 atoms in group h2o -neighbor 2.0 bin -neigh_modify every 1 delay 1 check yes -velocity all create ${temp} 54654 -velocity all create 338.0 54654 -timestep 1.0 - -minimize 0.0 0.0 100 1000 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:168) -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 16 - ghost atom cutoff = 16 - binsize = 8, bins = 2 2 2 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut/coul/long, perpetual - attributes: half, newton on - pair build: half/bin/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 11.85 | 11.85 | 11.85 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 338 -4.9610706 9.2628112e-06 18.211756 730.90791 - 100 338 -15.815905 0.10936727 7.4662793 -278.75864 -Loop time of 0.0389402 on 4 procs for 100 steps with 24 atoms - -99.0% CPU use with 4 MPI tasks x 1 OpenMP threads - -Minimization stats: - Stopping criterion = max iterations - Energy initial, next-to-last, final = - -4.96106135393 -15.696637101 -15.7065379926 - Force two-norm initial, final = 15.474 4.38071 - Force max component initial, final = 5.80042 2.01432 - Final line search alpha, max atom move = 0.00468711 0.00944132 - Iterations, force evaluations = 100 346 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.0067904 | 0.012084 | 0.019882 | 4.5 | 31.03 -Bond | 0.0001657 | 0.00019389 | 0.00022459 | 0.0 | 0.50 -Kspace | 0.0032685 | 0.010629 | 0.015032 | 4.4 | 27.30 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0.013826 | 0.014182 | 0.015051 | 0.4 | 36.42 -Output | 2.0027e-05 | 2.2769e-05 | 3.0994e-05 | 0.0 | 0.06 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 0.001829 | | | 4.70 - -Nlocal: 6 ave 8 max 3 min -Histogram: 1 0 0 0 1 0 0 0 0 2 -Nghost: 1722 ave 1725 max 1720 min -Histogram: 2 0 0 0 0 0 1 0 0 1 -Neighs: 1256.75 ave 2101 max 667 min -Histogram: 1 0 1 0 1 0 0 0 0 1 - -Total # of neighbors = 5027 -Ave neighs/atom = 209.458 -Ave special neighs/atom = 2 -Neighbor list builds = 0 -Dangerous builds = 0 -reset_timestep 0 -# rigid constraints with thermostat - -fix mynvt all nvt temp ${temp} ${temp} 100 -fix mynvt all nvt temp 338.0 ${temp} 100 -fix mynvt all nvt temp 338.0 338.0 100 -fix wshake all shake 0.0001 50 0 b 1 a 1 mol h2omol - 0 = # of size 2 clusters - 0 = # of size 3 clusters - 0 = # of size 4 clusters - 8 = # of frozen angles -# gcmc - - - -run 1000 -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 518.26667 -15.815905 0 7.3569121 -385.7767 - 1000 240.84589 -44.723106 0 -33.954368 61.365522 -Loop time of 0.0971818 on 4 procs for 1000 steps with 24 atoms - -Performance: 889.055 ns/day, 0.027 hours/ns, 10289.993 timesteps/s -99.8% 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.010939 | 0.020819 | 0.033432 | 5.8 | 21.42 -Bond | 9.5129e-05 | 0.00010997 | 0.0001266 | 0.0 | 0.11 -Kspace | 0.0058987 | 0.017954 | 0.027383 | 5.9 | 18.47 -Neigh | 0.0018289 | 0.001851 | 0.0018759 | 0.0 | 1.90 -Comm | 0.033144 | 0.033717 | 0.034395 | 0.3 | 34.69 -Output | 1.3113e-05 | 1.6809e-05 | 2.5988e-05 | 0.0 | 0.02 -Modify | 0.020795 | 0.020843 | 0.020866 | 0.0 | 21.45 -Other | | 0.001872 | | | 1.93 - -Nlocal: 6 ave 9 max 1 min -Histogram: 1 0 0 0 0 0 1 0 1 1 -Nghost: 1375.25 ave 1495 max 1251 min -Histogram: 1 0 0 1 0 0 1 0 0 1 -Neighs: 1263.25 ave 2045 max 122 min -Histogram: 1 0 0 0 0 0 2 0 0 1 - -Total # of neighbors = 5053 -Ave neighs/atom = 210.542 -Ave special neighs/atom = 2 -Neighbor list builds = 30 -Dangerous builds = 0 - -variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans) -fix mygcmc all gcmc 100 100 0 0 54341 ${temp} ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 ${mu} ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 ${disp} mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert ${tfac} group h2o shake wshake -fix mygcmc all gcmc 100 100 0 0 54341 338.0 -8.1 0.5 mol h2omol tfac_insert 1.66666666666667 group h2o shake wshake - -# atom counts - -variable oxygen atom "type==1" -variable hydrogen atom "type==2" -group oxygen dynamic all var oxygen -dynamic group oxygen defined -group hydrogen dynamic all var hydrogen -dynamic group hydrogen defined -variable nO equal count(oxygen) -variable nH equal count(hydrogen) - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+0.1) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+0.1) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+0.1) -variable racc equal f_mygcmc[8]/(f_mygcmc[7]+0.1) -compute_modify thermo_temp dynamic/dof yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH -thermo 1000 - -# run - -run 20000 -Ewald initialization ... -WARNING: Using 12-bit tables for long-range coulomb (../kspace.cpp:321) - G vector (1/distance) = 0.170448 - estimated absolute RMS force accuracy = 0.0332064 - estimated relative force accuracy = 0.0001 - KSpace vectors: actual max1d max3d = 16 2 62 - kxmax kymax kzmax = 2 2 2 -WARNING: Fix gcmc using full_energy option (../fix_gcmc.cpp:445) -0 atoms in group FixGCMC:gcmc_exclusion_group:mygcmc -0 atoms in group FixGCMC:rotation_gas_atoms:mygcmc -WARNING: Neighbor exclusions used with KSpace solver may give inconsistent Coulombic energies (../neighbor.cpp:476) -Per MPI rank memory allocation (min/avg/max) = 11.6 | 11.6 | 11.6 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_racc v_nO v_nH - 1000 240.84589 61.724018 -44.723106 10.768738 0.23910963 24 0 0 0 0 8 16 - 2000 90.409434 -6561.5238 -333.25624 14.822134 0.83688372 84 0.050190725 0.0099581757 0 0 28 56 - 3000 67.305679 -341.32154 -396.19372 12.238152 0.92654983 93 0.030546787 0.0068755525 0 0 31 62 - 4000 70.339514 -2575.9146 -419.94752 13.628467 0.98632724 99 0.021303508 0.0046725853 0 0 33 66 - 5000 85.676845 -3904.0268 -427.45932 17.110889 1.0162159 102 0.016400775 0.0035209497 0 0 34 68 - 6000 55.817537 -2067.5498 -448.02732 11.147559 1.0162159 102 0.012996731 0.0028442566 0 0 34 68 - 7000 87.59123 -3931.0089 -442.0299 17.493219 1.0162159 102 0.01160439 0.0030159847 0 0 34 68 - 8000 77.695862 -1684.9299 -461.16897 15.980166 1.0461046 105 0.010174953 0.0025995783 0 0 35 70 - 9000 70.375873 -6250.5951 -467.15813 14.474621 1.0461046 105 0.0089594585 0.002260114 0 0 35 70 - 10000 85.004974 -3406.0315 -464.23871 17.483474 1.0461046 105 0.007938083 0.0020156323 0 0 35 70 - 11000 55.459986 -3437.3858 -470.38117 11.406782 1.0461046 105 0.0071412985 0.0018148454 0 0 35 70 - 12000 80.59057 -2145.2149 -464.5658 16.575538 1.0461046 105 0.0064840331 0.0016519521 0 0 35 70 - 13000 52.183725 -3956.875 -470.42779 10.732934 1.0461046 105 0.0059493315 0.0015128339 0 0 35 70 - 14000 78.482417 -4895.8977 -465.0452 16.141941 1.0461046 105 0.005490232 0.0013968431 0 0 35 70 - 15000 61.802226 -6148.8506 -469.41496 12.711228 1.0461046 105 0.0051077595 0.0012945729 0 0 35 70 - 16000 69.59917 -5755.4737 -462.37636 14.314872 1.0461046 105 0.004761212 0.0012098238 0 0 35 70 - 17000 78.44382 -4103.8449 -461.5505 16.134003 1.0461046 105 0.0044719941 0.0011320612 0 0 35 70 - 18000 76.04971 -3994.5995 -464.26842 15.641592 1.0461046 105 0.0042070328 0.0010659592 0 0 35 70 - 19000 70.676514 -4558.507 -463.40477 14.536455 1.0461046 105 0.0039804956 0.0010049017 0 0 35 70 - 20000 79.682951 -3876.5977 -462.70391 16.388862 1.0461046 105 0.0037779014 0.00095025921 0 0 35 70 - 21000 56.755378 -4224.8128 -465.66199 11.673213 1.0461046 105 0.0035881233 0.00090297077 0 0 35 70 -Loop time of 63.5274 on 4 procs for 20000 steps with 105 atoms - -Performance: 27.201 ns/day, 0.882 hours/ns, 314.825 timesteps/s -99.5% CPU use with 4 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 6.7399 | 8.4644 | 10.565 | 49.0 | 13.32 -Bond | 0.021824 | 0.024522 | 0.0278 | 1.4 | 0.04 -Kspace | 0.47207 | 2.5646 | 4.286 | 88.8 | 4.04 -Neigh | 0.25299 | 0.2535 | 0.25374 | 0.1 | 0.40 -Comm | 2.011 | 2.0187 | 2.0311 | 0.5 | 3.18 -Output | 0.00063848 | 0.00072688 | 0.00099015 | 0.0 | 0.00 -Modify | 50.025 | 50.035 | 50.051 | 0.1 | 78.76 -Other | | 0.166 | | | 0.26 - -Nlocal: 26.25 ave 30 max 24 min -Histogram: 1 1 0 1 0 0 0 0 0 1 -Nghost: 5965 ave 6026 max 5911 min -Histogram: 1 0 0 1 0 1 0 0 0 1 -Neighs: 23614.8 ave 29343 max 16281 min -Histogram: 1 0 0 0 0 1 1 0 0 1 - -Total # of neighbors = 94459 -Ave neighs/atom = 899.61 -Ave special neighs/atom = 2 -Neighbor list builds = 20437 -Dangerous builds = 0 - -Total wall time: 0:01:03 diff --git a/examples/gcmc/log.6Jul17.gcmc.lj.g++.1 b/examples/gcmc/log.6Jul17.gcmc.lj.g++.1 deleted file mode 100644 index 7ff7e02f86..0000000000 --- a/examples/gcmc/log.6Jul17.gcmc.lj.g++.1 +++ /dev/null @@ -1,137 +0,0 @@ -LAMMPS (22 Sep 2017) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) - using 1 OpenMP thread(s) per MPI task -# GCMC for LJ simple fluid, no dynamics -# T = 2.0 -# rho ~ 0.5 -# p ~ 1.5 -# mu_ex ~ 0.0 -# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 - -# variables modifiable using -var command line switch - -variable mu index -1.25 -variable temp index 2.0 -variable disp index 1.0 -variable lbox index 5.0 - -# global model settings - -units lj -atom_style atomic -pair_style lj/cut 3.0 -pair_modify tail no # turn of to avoid triggering full_energy - -# box - -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 5.0 0 ${lbox} -region box block 0 5.0 0 5.0 0 5.0 -create_box 1 box -Created orthogonal box = (0 0 0) to (5 5 5) - 1 by 1 by 1 MPI processor grid - -# lj parameters - -pair_coeff * * 1.0 1.0 -mass * 1.0 - -# gcmc - -fix mygcmc all gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} -fix mygcmc all gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} -fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} -fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 1.0 - -# atom count - -variable type1 atom "type==1" -group type1 dynamic all var type1 -dynamic group type1 defined -variable n1 equal count(type1) - -# averaging - -variable rho equal density -variable p equal press -variable nugget equal 1.0e-8 -variable lambda equal 1.0 -variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+1e-08) -fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat -variable rhoav equal f_ave[1] -variable pav equal f_ave[2] -variable muexav equal f_ave[3] -variable n1av equal f_ave[4] - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) -compute_modify thermo_temp dynamic yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av -thermo 1000 - -# run - -run 10000 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 3.3 - ghost atom cutoff = 3.3 - binsize = 1.65, bins = 4 4 4 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, 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) = 0.433 | 0.433 | 0.433 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av - 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - 1000 2.4038954 2.1735585 -2.7041368 3.5476844 0.496 62 0.064790036 0.06313096 0.1081294 0.54304 1.4513524 -0.025479219 64.98 - 2000 2.0461168 1.1913842 -2.9880181 3.0212194 0.512 64 0.067416408 0.066335853 0.11306166 0.52736 1.3274665 0.034690004 62.97 - 3000 1.7930436 1.3788681 -3.2212667 2.6505861 0.552 69 0.067733191 0.066877836 0.1133516 0.5344 1.3834744 0.0070582537 63.5 - 4000 1.981449 1.2541054 -2.8222868 2.9217977 0.472 59 0.068546991 0.067856412 0.11442807 0.52504 1.3815629 0.043309657 62.17 - 5000 2.0946818 1.0701629 -3.5213291 3.0977688 0.568 71 0.06813743 0.067567891 0.11342906 0.53824 1.4049567 -0.0054539777 64.15 - 6000 1.9793484 0.68224187 -3.410211 2.9247088 0.536 67 0.067797628 0.067420108 0.11295333 0.5384 1.401683 -0.0066894359 64.37 - 7000 2.1885798 1.6745012 -3.185499 3.2345922 0.544 68 0.068630201 0.068261832 0.11403705 0.5244 1.449239 0.045987399 62.33 - 8000 2.2175324 1.5897263 -3.078898 3.2759002 0.528 66 0.068180395 0.067899629 0.11332691 0.53928 1.5488388 -0.01075766 64.29 - 9000 1.8610779 1.0396231 -2.923262 2.7465908 0.496 62 0.068346453 0.068028117 0.1134132 0.52912 1.4352871 0.027082544 62.87 - 10000 2.1079271 1.1746643 -2.9112062 3.1091925 0.48 60 0.068352878 0.068054948 0.11335434 0.5316 1.4462327 0.018503094 63.2 -Loop time of 13.1886 on 1 procs for 10000 steps with 60 atoms - -Performance: 327555.715 tau/day, 758.231 timesteps/s -100.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.37102 | 0.37102 | 0.37102 | 0.0 | 2.81 -Neigh | 0.86986 | 0.86986 | 0.86986 | 0.0 | 6.60 -Comm | 0.10394 | 0.10394 | 0.10394 | 0.0 | 0.79 -Output | 0.00025702 | 0.00025702 | 0.00025702 | 0.0 | 0.00 -Modify | 11.833 | 11.833 | 11.833 | 0.0 | 89.72 -Other | | 0.01084 | | | 0.08 - -Nlocal: 60 ave 60 max 60 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 663 ave 663 max 663 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 2133 ave 2133 max 2133 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 2133 -Ave neighs/atom = 35.55 -Neighbor list builds = 10000 -Dangerous builds = 0 -Total wall time: 0:00:13 diff --git a/examples/gcmc/log.6Jul17.gcmc.lj.g++.4 b/examples/gcmc/log.6Jul17.gcmc.lj.g++.4 deleted file mode 100644 index 59ed0462dc..0000000000 --- a/examples/gcmc/log.6Jul17.gcmc.lj.g++.4 +++ /dev/null @@ -1,137 +0,0 @@ -LAMMPS (22 Sep 2017) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90) - using 1 OpenMP thread(s) per MPI task -# GCMC for LJ simple fluid, no dynamics -# T = 2.0 -# rho ~ 0.5 -# p ~ 1.5 -# mu_ex ~ 0.0 -# comparable to Frenkel and Smit GCMC Case Study, Figure 5.8 - -# variables modifiable using -var command line switch - -variable mu index -1.25 -variable temp index 2.0 -variable disp index 1.0 -variable lbox index 5.0 - -# global model settings - -units lj -atom_style atomic -pair_style lj/cut 3.0 -pair_modify tail no # turn of to avoid triggering full_energy - -# box - -region box block 0 ${lbox} 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 ${lbox} 0 ${lbox} -region box block 0 5.0 0 5.0 0 ${lbox} -region box block 0 5.0 0 5.0 0 5.0 -create_box 1 box -Created orthogonal box = (0 0 0) to (5 5 5) - 1 by 2 by 2 MPI processor grid - -# lj parameters - -pair_coeff * * 1.0 1.0 -mass * 1.0 - -# gcmc - -fix mygcmc all gcmc 1 100 100 1 29494 ${temp} ${mu} ${disp} -fix mygcmc all gcmc 1 100 100 1 29494 2.0 ${mu} ${disp} -fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 ${disp} -fix mygcmc all gcmc 1 100 100 1 29494 2.0 -1.25 1.0 - -# atom count - -variable type1 atom "type==1" -group type1 dynamic all var type1 -dynamic group type1 defined -variable n1 equal count(type1) - -# averaging - -variable rho equal density -variable p equal press -variable nugget equal 1.0e-8 -variable lambda equal 1.0 -variable muex equal ${mu}-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-${temp}*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*${lambda}+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+${nugget}) -variable muex equal -1.25-2.0*ln(density*1+1e-08) -fix ave all ave/time 10 100 1000 v_rho v_p v_muex v_n1 ave one file rho_vs_p.dat -variable rhoav equal f_ave[1] -variable pav equal f_ave[2] -variable muexav equal f_ave[3] -variable n1av equal f_ave[4] - -# output - -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+${nugget}) -variable tacc equal f_mygcmc[2]/(f_mygcmc[1]+1e-08) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+${nugget}) -variable iacc equal f_mygcmc[4]/(f_mygcmc[3]+1e-08) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+${nugget}) -variable dacc equal f_mygcmc[6]/(f_mygcmc[5]+1e-08) -compute_modify thermo_temp dynamic yes -thermo_style custom step temp press pe ke density atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av -thermo 1000 - -# run - -run 10000 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 3.3 - ghost atom cutoff = 3.3 - binsize = 1.65, bins = 4 4 4 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, 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) = 0.4477 | 0.4477 | 0.4477 Mbytes -Step Temp Press PotEng KinEng Density Atoms v_iacc v_dacc v_tacc v_rhoav v_pav v_muexav v_n1av - 0 0 0 0 -0 0 0 0 0 0 0 0 0 0 - 1000 1.956397 1.7699101 -2.7889468 2.8864874 0.488 61 0.068894746 0.067229075 0.1141726 0.53288 1.3832798 0.013392866 63.44 - 2000 2.040943 0.56060899 -2.8001647 3.0077055 0.456 57 0.069858594 0.068831934 0.11629114 0.5232 1.3587174 0.049995794 62.19 - 3000 2.0004866 1.5736515 -3.3098044 2.9572411 0.552 69 0.069594029 0.068727791 0.11592543 0.53096 1.4129434 0.020022578 63.23 - 4000 2.1127942 2.642809 -2.8865084 3.1211733 0.528 66 0.070268697 0.069533235 0.11693806 0.52424 1.3444615 0.046884078 62.57 - 5000 2.3663648 1.354269 -3.1917346 3.4957662 0.528 66 0.070519633 0.069960064 0.11710321 0.52688 1.3595814 0.036270867 62.56 - 6000 1.9224136 0.82756699 -3.1965 2.839257 0.52 65 0.06985018 0.069474645 0.11628632 0.536 1.47062 0.00141549 63.76 - 7000 2.0266192 1.5593811 -2.9972341 2.9931606 0.52 65 0.070244693 0.069880791 0.11666541 0.52528 1.3246332 0.040754793 62.2 - 8000 1.7790467 1.8680568 -2.8028819 2.6275151 0.52 65 0.070454494 0.070172368 0.11736806 0.524 1.4213649 0.047985191 62.03 - 9000 1.7968847 1.3195587 -3.261001 2.6550983 0.536 67 0.069952011 0.069618327 0.11650087 0.53904 1.4624201 -0.01069837 64.36 - 10000 2.1566109 1.1015729 -3.4999837 3.1880335 0.552 69 0.069603309 0.069284134 0.11625548 0.53128 1.3587249 0.02075238 63.24 -Loop time of 13.089 on 4 procs for 10000 steps with 69 atoms - -Performance: 330047.561 tau/day, 763.999 timesteps/s -99.8% 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.088209 | 0.093632 | 0.098849 | 1.4 | 0.72 -Neigh | 0.25982 | 0.26669 | 0.27885 | 1.5 | 2.04 -Comm | 0.27092 | 0.28815 | 0.29998 | 2.1 | 2.20 -Output | 0.00030112 | 0.00035518 | 0.00037479 | 0.0 | 0.00 -Modify | 12.432 | 12.433 | 12.433 | 0.0 | 94.98 -Other | | 0.007692 | | | 0.06 - -Nlocal: 17.25 ave 23 max 10 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Nghost: 506.5 ave 519 max 490 min -Histogram: 1 0 1 0 0 0 0 0 0 2 -Neighs: 705.75 ave 998 max 369 min -Histogram: 1 0 0 0 0 1 1 0 0 1 - -Total # of neighbors = 2823 -Ave neighs/atom = 40.913 -Neighbor list builds = 10000 -Dangerous builds = 0 -Total wall time: 0:00:13 From 56475229060040c22a53a60c5e042dc5d55cd355 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 28 Nov 2017 12:34:23 -0500 Subject: [PATCH 13/34] various small cosmetic adjustments to increase conformance with LAMMPS programming conventions --- .../USER/misc/extep/{input => in.extep-bn} | 2 +- .../misc/extep/log.23Oct17.extep-bn.g++.1 | 180 ++++++++++++++++++ .../misc/extep/log.23Oct17.extep-bn.g++.4 | 180 ++++++++++++++++++ potentials/BN.extep | 7 +- src/.gitignore | 6 + src/USER-MISC/README | 1 + src/USER-MISC/pair_extep.cpp | 139 ++++++++------ src/USER-MISC/pair_extep.h | 0 8 files changed, 449 insertions(+), 66 deletions(-) rename examples/USER/misc/extep/{input => in.extep-bn} (98%) create mode 100644 examples/USER/misc/extep/log.23Oct17.extep-bn.g++.1 create mode 100644 examples/USER/misc/extep/log.23Oct17.extep-bn.g++.4 mode change 100755 => 100644 src/USER-MISC/pair_extep.cpp mode change 100755 => 100644 src/USER-MISC/pair_extep.h diff --git a/examples/USER/misc/extep/input b/examples/USER/misc/extep/in.extep-bn similarity index 98% rename from examples/USER/misc/extep/input rename to examples/USER/misc/extep/in.extep-bn index d5e81eb82b..bb7ed0ea28 100644 --- a/examples/USER/misc/extep/input +++ b/examples/USER/misc/extep/in.extep-bn @@ -19,7 +19,7 @@ pair_coeff * * ../../../../potentials/BN.extep B N # Output thermo 10 -thermo_style custom step time etotal pe temp lx ly lz pxx pyy pzz spcpu +thermo_style custom step time etotal pe temp lx ly lz pxx pyy pzz thermo_modify line one format float %14.8g # Setup NPT MD run diff --git a/examples/USER/misc/extep/log.23Oct17.extep-bn.g++.1 b/examples/USER/misc/extep/log.23Oct17.extep-bn.g++.1 new file mode 100644 index 0000000000..392e5c4f0e --- /dev/null +++ b/examples/USER/misc/extep/log.23Oct17.extep-bn.g++.1 @@ -0,0 +1,180 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# Initialization +units metal +boundary p p p +atom_style atomic +processors * * 1 + +# System and atom definition +read_data BN.data # read lammps data file + orthogonal box = (0 0 0) to (21.75 12.5574 50) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 100 atoms + +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 +neigh_modify delay 0 +neigh_modify check yes + +# Potential +pair_style extep +pair_coeff * * ../../../../potentials/BN.extep B N +Reading potential file ../../../../potentials/BN.extep with DATE: 2017-11-28 + +# Output +thermo 10 +thermo_style custom step time etotal pe temp lx ly lz pxx pyy pzz +thermo_modify line one format float %14.8g + +# Setup NPT MD run +timestep 0.0001 # ps +velocity all create 300.0 12345 +fix thermos all npt temp 300 300 1.0 x 0 0 1.0 y 0 0 1.0 +run 1000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.2 + ghost atom cutoff = 4.2 + binsize = 2.1, bins = 11 6 24 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair extep, perpetual + attributes: full, newton on, ghost + pair build: full/bin/ghost + stencil: full/ghost/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.97 | 2.97 | 2.97 Mbytes +Step Time TotEng PotEng Temp Lx Ly Lz Pxx Pyy Pzz + 0 0 -665.11189 -668.95092 300 21.75 12.557368 50 -1638.8315 -1636.7368 321.73163 + 10 0.001 -665.11194 -668.81065 289.03491 21.749944 12.557333 50 -1391.3771 -1841.1723 316.66669 + 20 0.002 -665.1121 -668.4273 259.06599 21.749789 12.557222 50 -1137.0171 -1980.5977 301.79466 + 30 0.003 -665.11237 -667.90117 217.93027 21.749552 12.557029 50 -912.51949 -2055.822 278.00774 + 40 0.004 -665.11278 -667.36471 175.97662 21.74925 12.556752 50 -755.38643 -2078.0669 246.62816 + 50 0.005 -665.11333 -666.94254 142.94321 21.748894 12.556389 50 -694.93153 -2062.1349 209.26356 + 60 0.006 -665.11405 -666.71476 125.08741 21.748487 12.55594 50 -744.6962 -2019.9093 167.70563 + 70 0.007 -665.11494 -666.69555 123.51632 21.748026 12.555408 50 -898.67863 -1956.2845 123.88845 + 80 0.008 -665.116 -666.83408 134.25892 21.7475 12.554796 50 -1132.5952 -1868.738 79.87581 + 90 0.009 -665.1172 -667.03647 149.98053 21.746893 12.554106 50 -1409.6896 -1750.4875 37.821017 + 100 0.01 -665.11853 -667.20002 162.65705 21.746185 12.553344 50 -1689.1599 -1595.9411 -0.14399002 + 110 0.011 -665.11997 -667.24752 166.25742 21.745356 12.552516 50 -1934.6334 -1406.3665 -32.091026 + 120 0.012 -665.12148 -667.15088 158.58671 21.744389 12.55163 50 -2120.4014 -1193.6117 -56.50543 + 130 0.013 -665.12306 -666.93754 141.7922 21.743271 12.550694 50 -2234.0841 -980.32815 -72.45885 + 140 0.014 -665.1247 -666.67903 121.4631 21.741993 12.549719 50 -2275.5656 -796.26701 -79.693692 + 150 0.015 -665.1264 -666.46562 104.65306 21.740553 12.54871 50 -2253.08 -671.5409 -78.603431 + 160 0.016 -665.1282 -666.37541 97.462619 21.738952 12.547674 50 -2178.0108 -628.83531 -70.130423 + 170 0.017 -665.13011 -666.44775 102.96665 21.737195 12.546611 50 -2060.2073 -677.02227 -55.623931 + 180 0.018 -665.13215 -666.67004 120.17784 21.735292 12.54552 50 -1905.36 -808.22824 -36.699042 + 190 0.019 -665.13431 -666.98201 144.38814 21.733253 12.544396 50 -1715.2526 -999.2481 -15.117617 + 200 0.02 -665.13656 -667.29591 168.74214 21.731091 12.543231 50 -1490.6934 -1216.735 7.3107732 + 210 0.021 -665.13885 -667.52511 186.47391 21.728823 12.542015 50 -1235.9283 -1424.4324 28.822782 + 220 0.022 -665.14112 -667.61153 193.0492 21.726467 12.540741 50 -962.70697 -1590.2885 47.801678 + 230 0.023 -665.14332 -667.54317 187.53534 21.724043 12.539402 50 -692.12856 -1691.6537 62.881768 + 240 0.024 -665.1454 -667.35665 172.79772 21.72157 12.537993 50 -453.02755 -1717.6064 73.041858 + 250 0.025 -665.14735 -667.12424 154.48373 21.719064 12.536514 50 -276.81709 -1668.3598 77.670868 + 260 0.026 -665.14918 -666.92939 139.11409 21.716539 12.534967 50 -190.03656 -1552.4049 76.59734 + 270 0.027 -665.15091 -666.83859 131.88391 21.714 12.533357 50 -206.85537 -1382.4915 70.085105 + 280 0.028 -665.15258 -666.87889 134.90214 21.711446 12.53169 50 -324.01795 -1171.7578 58.801327 + 290 0.029 -665.15421 -667.02881 146.49028 21.708869 12.529975 50 -520.0146 -931.26466 43.758636 + 300 0.03 -665.1558 -667.22646 161.81084 21.706255 12.528222 50 -758.87113 -669.74523 26.225956 + 310 0.031 -665.15734 -667.39183 174.61368 21.703587 12.526442 50 -997.42782 -395.56111 7.601897 + 320 0.032 -665.15878 -667.45546 179.47345 21.700849 12.524646 50 -1193.9402 -119.86797 -10.744258 + 330 0.033 -665.16008 -667.38312 173.71901 21.698026 12.522846 50 -1315.6446 140.7451 -27.638433 + 340 0.034 -665.16118 -667.18792 158.37888 21.695112 12.521051 50 -1343.5396 363.95099 -42.231049 + 350 0.035 -665.16207 -666.92571 137.81938 21.692103 12.519271 50 -1273.6625 524.73453 -54.046178 + 360 0.036 -665.16274 -666.67543 118.20885 21.689004 12.517514 50 -1115.1514 601.37143 -62.932702 + 370 0.037 -665.1632 -666.5115 105.36258 21.685827 12.515781 50 -886.11568 582.42087 -68.942158 + 380 0.038 -665.16348 -666.47849 102.76116 21.682589 12.514072 50 -608.71321 472.04732 -72.193259 + 390 0.039 -665.1636 -666.57728 110.47178 21.679308 12.512382 50 -304.85697 291.41908 -72.787214 + 400 0.04 -665.16356 -666.76741 125.33244 21.676006 12.510704 50 6.3732307 75.407852 -70.806087 + 410 0.041 -665.16336 -666.98363 142.24457 21.672705 12.50903 50 309.23046 -134.40319 -66.378966 + 420 0.042 -665.16298 -667.15939 156.00935 21.669426 12.507351 50 590.16982 -298.16702 -59.767469 + 430 0.043 -665.16239 -667.24843 163.01313 21.66619 12.50566 50 836.19535 -385.22443 -51.420249 + 440 0.044 -665.16157 -667.23746 162.2204 21.663014 12.503955 50 1033.943 -378.7816 -41.969885 + 450 0.045 -665.1605 -667.14707 155.24066 21.659911 12.502234 50 1170.3399 -277.11556 -32.175503 + 460 0.046 -665.15917 -667.0218 145.55489 21.656891 12.500503 50 1234.9026 -91.620499 -22.833423 + 470 0.047 -665.15761 -666.91366 137.22578 21.65396 12.498768 50 1222.9519 157.31306 -14.680548 + 480 0.048 -665.15585 -666.86462 133.53159 21.651114 12.497041 50 1138.5551 445.2926 -8.3071781 + 490 0.049 -665.15393 -666.89359 135.9458 21.64835 12.495333 50 996.00682 748.51842 -4.0872169 + 500 0.05 -665.15188 -666.99142 143.75058 21.645657 12.493655 50 819.08561 1046.9785 -2.1306918 + 510 0.051 -665.14975 -667.12519 154.36991 21.643022 12.49202 50 637.99022 1325.7112 -2.2650822 + 520 0.052 -665.14756 -667.25 164.29491 21.640432 12.49044 50 484.54509 1574.1916 -4.0528391 + 530 0.053 -665.14531 -667.32459 170.29969 21.637878 12.488923 50 386.77357 1784.4858 -6.8479114 + 540 0.054 -665.143 -667.32552 170.55254 21.635352 12.48748 50 364.14599 1949.2189 -9.8841824 + 550 0.055 -665.14064 -667.25527 165.24765 21.632853 12.486117 50 424.6565 2060.4607 -12.37851 + 560 0.056 -665.13822 -667.14127 156.52756 21.630385 12.484837 50 564.3912 2110.2547 -13.62742 + 570 0.057 -665.13576 -667.0259 147.70502 21.627958 12.483643 50 769.54354 2092.8157 -13.082914 + 580 0.058 -665.13327 -666.95107 142.05154 21.625586 12.482535 50 1020.1218 2007.6508 -10.405617 + 590 0.059 -665.13079 -666.94279 141.59877 21.623287 12.481508 50 1294.1274 1862.3568 -5.5031153 + 600 0.06 -665.12832 -667.00189 146.40928 21.621079 12.480557 50 1570.9478 1673.8456 1.4410957 + 610 0.061 -665.12591 -667.10417 154.59072 21.618982 12.479674 50 1833.1388 1467.2639 9.9561573 + 620 0.062 -665.12355 -667.20973 163.02368 21.617015 12.478851 50 2066.4951 1272.6732 19.310607 + 630 0.063 -665.12128 -667.27744 168.49239 21.615193 12.47808 50 2259.0193 1120.2758 28.59477 + 640 0.064 -665.11911 -667.27898 168.7823 21.613531 12.477355 50 2399.792 1035.3525 36.8539 + 650 0.065 -665.11707 -667.20773 163.37438 21.612037 12.476673 50 2478.6675 1034.0481 43.239368 + 660 0.066 -665.11518 -667.0802 153.55598 21.610718 12.476033 50 2487.2505 1120.8274 47.131883 + 670 0.067 -665.11345 -666.93026 141.97434 21.609573 12.475439 50 2420.9786 1288.0136 48.201717 + 680 0.068 -665.11191 -666.79864 131.80955 21.608598 12.474897 50 2281.6131 1517.4002 46.399066 + 690 0.069 -665.11056 -666.72065 125.82027 21.607784 12.474418 50 2079.2055 1783.5346 41.895586 + 700 0.07 -665.10941 -666.71578 125.5291 21.607116 12.474011 50 1832.7039 2057.9076 35.011051 + 710 0.071 -665.10848 -666.78203 130.77932 21.606577 12.473687 50 1568.7275 2313.0601 26.153491 + 720 0.072 -665.10776 -666.89681 139.80468 21.606148 12.473458 50 1318.5189 2525.6808 15.783637 + 730 0.073 -665.10727 -667.0243 149.80574 21.605812 12.47333 50 1113.5537 2678.1859 4.3967762 + 740 0.074 -665.10701 -667.12698 157.85016 21.605555 12.473311 50 980.633 2758.9123 -7.4930622 + 750 0.075 -665.10697 -667.17729 161.78497 21.605368 12.473404 50 937.45086 2761.5936 -19.376492 + 760 0.076 -665.10714 -667.1654 160.84249 21.605247 12.473609 50 989.5724 2684.9256 -30.776106 + 770 0.077 -665.1075 -667.10061 155.75086 21.605196 12.473922 50 1129.4775 2532.7048 -41.263677 + 780 0.078 -665.10803 -667.00654 148.35835 21.605226 12.474338 50 1337.8663 2314.4556 -50.455407 + 790 0.079 -665.10869 -666.91242 140.9515 21.605349 12.474848 50 1586.9099 2045.9808 -57.988114 + 800 0.08 -665.10946 -666.84375 135.52533 21.605585 12.475441 50 1844.7038 1749.1281 -63.495405 + 810 0.081 -665.11032 -666.81538 133.24173 21.60595 12.476105 50 2079.9601 1450.3113 -66.60795 + 820 0.082 -665.11127 -666.82877 134.21424 21.606461 12.476828 50 2266.0059 1177.7937 -66.990929 + 830 0.083 -665.1123 -666.87353 137.6312 21.607131 12.477599 50 2383.4351 958.19752 -64.411861 + 840 0.084 -665.11343 -666.93214 142.12323 21.607968 12.478409 50 2421.1969 812.91475 -58.816538 + 850 0.085 -665.11467 -666.98597 146.2321 21.608975 12.479253 50 2376.3483 755.06052 -50.389393 + 860 0.086 -665.11603 -667.02075 148.84448 21.610149 12.480128 50 2252.9811 787.43069 -39.585062 + 870 0.087 -665.1175 -667.03045 149.48743 21.611481 12.481034 50 2060.884 901.76342 -27.129117 + 880 0.088 -665.11907 -667.01838 148.42091 21.612958 12.481978 50 1814.3354 1079.4855 -13.988401 + 890 0.089 -665.12073 -666.99552 146.50471 21.614562 12.482966 50 1531.1565 1293.9709 -1.305884 + 900 0.09 -665.12247 -666.97639 144.87389 21.616275 12.484007 50 1231.9005 1514.0741 9.7083525 + 910 0.091 -665.12426 -666.97371 144.52455 21.618074 12.485109 50 938.90089 1708.364 17.929974 + 920 0.092 -665.12609 -666.99389 145.95889 21.61994 12.486281 50 674.90767 1849.2415 22.497207 + 930 0.093 -665.12794 -667.03498 149.02559 21.621853 12.487528 50 461.18604 1916.1468 22.971745 + 940 0.094 -665.12977 -667.08777 153.00718 21.6238 12.488852 50 315.19601 1897.3867 19.43758 + 950 0.095 -665.13156 -667.13925 156.8903 21.62577 12.490254 50 248.20946 1790.5667 12.504818 + 960 0.096 -665.13326 -667.17668 159.68273 21.627757 12.491728 50 263.35912 1601.9528 3.2123256 + 970 0.097 -665.13485 -667.19079 160.6611 21.629764 12.493267 50 354.58496 1345.1489 -7.1487162 + 980 0.098 -665.13628 -667.17758 159.5175 21.631796 12.494862 50 506.7626 1039.346 -17.249179 + 990 0.099 -665.13753 -667.13942 156.43758 21.633864 12.496499 50 697.06054 707.26671 -25.92737 + 1000 0.1 -665.13859 -667.0853 152.12472 21.635982 12.498164 50 897.38498 372.94791 -32.344697 +Loop time of 0.463574 on 1 procs for 1000 steps with 100 atoms + +Performance: 18.638 ns/day, 1.288 hours/ns, 2157.152 timesteps/s +99.0% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.44776 | 0.44776 | 0.44776 | 0.0 | 96.59 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0023057 | 0.0023057 | 0.0023057 | 0.0 | 0.50 +Output | 0.0015752 | 0.0015752 | 0.0015752 | 0.0 | 0.34 +Modify | 0.010602 | 0.010602 | 0.010602 | 0.0 | 2.29 +Other | | 0.001331 | | | 0.29 + +Nlocal: 100 ave 100 max 100 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 360 ave 360 max 360 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: 1800 ave 1800 max 1800 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1800 +Ave neighs/atom = 18 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/examples/USER/misc/extep/log.23Oct17.extep-bn.g++.4 b/examples/USER/misc/extep/log.23Oct17.extep-bn.g++.4 new file mode 100644 index 0000000000..c5c9236649 --- /dev/null +++ b/examples/USER/misc/extep/log.23Oct17.extep-bn.g++.4 @@ -0,0 +1,180 @@ +LAMMPS (23 Oct 2017) + using 1 OpenMP thread(s) per MPI task +# Initialization +units metal +boundary p p p +atom_style atomic +processors * * 1 + +# System and atom definition +read_data BN.data # read lammps data file + orthogonal box = (0 0 0) to (21.75 12.5574 50) + 2 by 2 by 1 MPI processor grid + reading atoms ... + 100 atoms + +# Neighbor update settings +neighbor 2.0 bin +neigh_modify every 1 +neigh_modify delay 0 +neigh_modify check yes + +# Potential +pair_style extep +pair_coeff * * ../../../../potentials/BN.extep B N +Reading potential file ../../../../potentials/BN.extep with DATE: 2017-11-28 + +# Output +thermo 10 +thermo_style custom step time etotal pe temp lx ly lz pxx pyy pzz +thermo_modify line one format float %14.8g + +# Setup NPT MD run +timestep 0.0001 # ps +velocity all create 300.0 12345 +fix thermos all npt temp 300 300 1.0 x 0 0 1.0 y 0 0 1.0 +run 1000 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 4.2 + ghost atom cutoff = 4.2 + binsize = 2.1, bins = 11 6 24 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair extep, perpetual + attributes: full, newton on, ghost + pair build: full/bin/ghost + stencil: full/ghost/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 2.943 | 2.943 | 2.943 Mbytes +Step Time TotEng PotEng Temp Lx Ly Lz Pxx Pyy Pzz + 0 0 -665.11189 -668.95092 300 21.75 12.557368 50 -1638.8315 -1636.7368 321.73163 + 10 0.001 -665.11194 -668.81065 289.03491 21.749944 12.557333 50 -1391.3771 -1841.1723 316.66669 + 20 0.002 -665.1121 -668.4273 259.06599 21.749789 12.557222 50 -1137.0171 -1980.5977 301.79466 + 30 0.003 -665.11237 -667.90117 217.93027 21.749552 12.557029 50 -912.51949 -2055.822 278.00774 + 40 0.004 -665.11278 -667.36471 175.97662 21.74925 12.556752 50 -755.38643 -2078.0669 246.62816 + 50 0.005 -665.11333 -666.94254 142.94321 21.748894 12.556389 50 -694.93153 -2062.1349 209.26356 + 60 0.006 -665.11405 -666.71476 125.08741 21.748487 12.55594 50 -744.6962 -2019.9093 167.70563 + 70 0.007 -665.11494 -666.69555 123.51632 21.748026 12.555408 50 -898.67863 -1956.2845 123.88845 + 80 0.008 -665.116 -666.83408 134.25892 21.7475 12.554796 50 -1132.5952 -1868.738 79.87581 + 90 0.009 -665.1172 -667.03647 149.98053 21.746893 12.554106 50 -1409.6896 -1750.4875 37.821017 + 100 0.01 -665.11853 -667.20002 162.65705 21.746185 12.553344 50 -1689.1599 -1595.9411 -0.14399002 + 110 0.011 -665.11997 -667.24752 166.25742 21.745356 12.552516 50 -1934.6334 -1406.3665 -32.091026 + 120 0.012 -665.12148 -667.15088 158.58671 21.744389 12.55163 50 -2120.4014 -1193.6117 -56.50543 + 130 0.013 -665.12306 -666.93754 141.7922 21.743271 12.550694 50 -2234.0841 -980.32815 -72.45885 + 140 0.014 -665.1247 -666.67903 121.4631 21.741993 12.549719 50 -2275.5656 -796.26701 -79.693692 + 150 0.015 -665.1264 -666.46562 104.65306 21.740553 12.54871 50 -2253.08 -671.5409 -78.603431 + 160 0.016 -665.1282 -666.37541 97.462619 21.738952 12.547674 50 -2178.0108 -628.83531 -70.130423 + 170 0.017 -665.13011 -666.44775 102.96665 21.737195 12.546611 50 -2060.2073 -677.02227 -55.623931 + 180 0.018 -665.13215 -666.67004 120.17784 21.735292 12.54552 50 -1905.36 -808.22824 -36.699042 + 190 0.019 -665.13431 -666.98201 144.38814 21.733253 12.544396 50 -1715.2526 -999.2481 -15.117617 + 200 0.02 -665.13656 -667.29591 168.74214 21.731091 12.543231 50 -1490.6934 -1216.735 7.3107732 + 210 0.021 -665.13885 -667.52511 186.47391 21.728823 12.542015 50 -1235.9283 -1424.4324 28.822782 + 220 0.022 -665.14112 -667.61153 193.0492 21.726467 12.540741 50 -962.70697 -1590.2885 47.801678 + 230 0.023 -665.14332 -667.54317 187.53534 21.724043 12.539402 50 -692.12856 -1691.6537 62.881768 + 240 0.024 -665.1454 -667.35665 172.79772 21.72157 12.537993 50 -453.02755 -1717.6064 73.041858 + 250 0.025 -665.14735 -667.12424 154.48373 21.719064 12.536514 50 -276.81709 -1668.3598 77.670868 + 260 0.026 -665.14918 -666.92939 139.11409 21.716539 12.534967 50 -190.03656 -1552.4049 76.59734 + 270 0.027 -665.15091 -666.83859 131.88391 21.714 12.533357 50 -206.85537 -1382.4915 70.085105 + 280 0.028 -665.15258 -666.87889 134.90214 21.711446 12.53169 50 -324.01795 -1171.7578 58.801327 + 290 0.029 -665.15421 -667.02881 146.49028 21.708869 12.529975 50 -520.0146 -931.26466 43.758636 + 300 0.03 -665.1558 -667.22646 161.81084 21.706255 12.528222 50 -758.87113 -669.74523 26.225956 + 310 0.031 -665.15734 -667.39183 174.61368 21.703587 12.526442 50 -997.42782 -395.56111 7.601897 + 320 0.032 -665.15878 -667.45546 179.47345 21.700849 12.524646 50 -1193.9402 -119.86797 -10.744258 + 330 0.033 -665.16008 -667.38312 173.71901 21.698026 12.522846 50 -1315.6446 140.7451 -27.638433 + 340 0.034 -665.16118 -667.18792 158.37888 21.695112 12.521051 50 -1343.5396 363.95099 -42.231049 + 350 0.035 -665.16207 -666.92571 137.81938 21.692103 12.519271 50 -1273.6625 524.73453 -54.046178 + 360 0.036 -665.16274 -666.67543 118.20885 21.689004 12.517514 50 -1115.1514 601.37143 -62.932702 + 370 0.037 -665.1632 -666.5115 105.36258 21.685827 12.515781 50 -886.11568 582.42087 -68.942158 + 380 0.038 -665.16348 -666.47849 102.76116 21.682589 12.514072 50 -608.71321 472.04732 -72.193259 + 390 0.039 -665.1636 -666.57728 110.47178 21.679308 12.512382 50 -304.85697 291.41908 -72.787214 + 400 0.04 -665.16356 -666.76741 125.33244 21.676006 12.510704 50 6.3732307 75.407852 -70.806087 + 410 0.041 -665.16336 -666.98363 142.24457 21.672705 12.50903 50 309.23046 -134.40319 -66.378966 + 420 0.042 -665.16298 -667.15939 156.00935 21.669426 12.507351 50 590.16982 -298.16702 -59.767469 + 430 0.043 -665.16239 -667.24843 163.01313 21.66619 12.50566 50 836.19535 -385.22443 -51.420249 + 440 0.044 -665.16157 -667.23746 162.2204 21.663014 12.503955 50 1033.943 -378.7816 -41.969885 + 450 0.045 -665.1605 -667.14707 155.24066 21.659911 12.502234 50 1170.3399 -277.11556 -32.175503 + 460 0.046 -665.15917 -667.0218 145.55489 21.656891 12.500503 50 1234.9026 -91.620499 -22.833423 + 470 0.047 -665.15761 -666.91366 137.22578 21.65396 12.498768 50 1222.9519 157.31306 -14.680548 + 480 0.048 -665.15585 -666.86462 133.53159 21.651114 12.497041 50 1138.5551 445.2926 -8.3071781 + 490 0.049 -665.15393 -666.89359 135.9458 21.64835 12.495333 50 996.00682 748.51842 -4.0872169 + 500 0.05 -665.15188 -666.99142 143.75058 21.645657 12.493655 50 819.08561 1046.9785 -2.1306918 + 510 0.051 -665.14975 -667.12519 154.36991 21.643022 12.49202 50 637.99022 1325.7112 -2.2650822 + 520 0.052 -665.14756 -667.25 164.29491 21.640432 12.49044 50 484.54509 1574.1916 -4.0528391 + 530 0.053 -665.14531 -667.32459 170.29969 21.637878 12.488923 50 386.77357 1784.4858 -6.8479114 + 540 0.054 -665.143 -667.32552 170.55254 21.635352 12.48748 50 364.14599 1949.2189 -9.8841824 + 550 0.055 -665.14064 -667.25527 165.24765 21.632853 12.486117 50 424.6565 2060.4607 -12.37851 + 560 0.056 -665.13822 -667.14127 156.52756 21.630385 12.484837 50 564.3912 2110.2547 -13.62742 + 570 0.057 -665.13576 -667.0259 147.70502 21.627958 12.483643 50 769.54354 2092.8157 -13.082914 + 580 0.058 -665.13327 -666.95107 142.05154 21.625586 12.482535 50 1020.1218 2007.6508 -10.405617 + 590 0.059 -665.13079 -666.94279 141.59877 21.623287 12.481508 50 1294.1274 1862.3568 -5.5031153 + 600 0.06 -665.12832 -667.00189 146.40928 21.621079 12.480557 50 1570.9478 1673.8456 1.4410957 + 610 0.061 -665.12591 -667.10417 154.59072 21.618982 12.479674 50 1833.1388 1467.2639 9.9561573 + 620 0.062 -665.12355 -667.20973 163.02368 21.617015 12.478851 50 2066.4951 1272.6732 19.310607 + 630 0.063 -665.12128 -667.27744 168.49239 21.615193 12.47808 50 2259.0193 1120.2758 28.59477 + 640 0.064 -665.11911 -667.27898 168.7823 21.613531 12.477355 50 2399.792 1035.3525 36.8539 + 650 0.065 -665.11707 -667.20773 163.37438 21.612037 12.476673 50 2478.6675 1034.0481 43.239368 + 660 0.066 -665.11518 -667.0802 153.55598 21.610718 12.476033 50 2487.2505 1120.8274 47.131883 + 670 0.067 -665.11345 -666.93026 141.97434 21.609573 12.475439 50 2420.9786 1288.0136 48.201717 + 680 0.068 -665.11191 -666.79864 131.80955 21.608598 12.474897 50 2281.6131 1517.4002 46.399066 + 690 0.069 -665.11056 -666.72065 125.82027 21.607784 12.474418 50 2079.2055 1783.5346 41.895586 + 700 0.07 -665.10941 -666.71578 125.5291 21.607116 12.474011 50 1832.7039 2057.9076 35.011051 + 710 0.071 -665.10848 -666.78203 130.77932 21.606577 12.473687 50 1568.7275 2313.0601 26.153491 + 720 0.072 -665.10776 -666.89681 139.80468 21.606148 12.473458 50 1318.5189 2525.6808 15.783637 + 730 0.073 -665.10727 -667.0243 149.80574 21.605812 12.47333 50 1113.5537 2678.1859 4.3967762 + 740 0.074 -665.10701 -667.12698 157.85016 21.605555 12.473311 50 980.633 2758.9123 -7.4930622 + 750 0.075 -665.10697 -667.17729 161.78497 21.605368 12.473404 50 937.45086 2761.5936 -19.376492 + 760 0.076 -665.10714 -667.1654 160.84249 21.605247 12.473609 50 989.5724 2684.9256 -30.776106 + 770 0.077 -665.1075 -667.10061 155.75086 21.605196 12.473922 50 1129.4775 2532.7048 -41.263677 + 780 0.078 -665.10803 -667.00654 148.35835 21.605226 12.474338 50 1337.8663 2314.4556 -50.455407 + 790 0.079 -665.10869 -666.91242 140.9515 21.605349 12.474848 50 1586.9099 2045.9808 -57.988114 + 800 0.08 -665.10946 -666.84375 135.52533 21.605585 12.475441 50 1844.7038 1749.1281 -63.495405 + 810 0.081 -665.11032 -666.81538 133.24173 21.60595 12.476105 50 2079.9601 1450.3113 -66.60795 + 820 0.082 -665.11127 -666.82877 134.21424 21.606461 12.476828 50 2266.0059 1177.7937 -66.990929 + 830 0.083 -665.1123 -666.87353 137.6312 21.607131 12.477599 50 2383.4351 958.19752 -64.411861 + 840 0.084 -665.11343 -666.93214 142.12323 21.607968 12.478409 50 2421.1969 812.91475 -58.816538 + 850 0.085 -665.11467 -666.98597 146.2321 21.608975 12.479253 50 2376.3483 755.06052 -50.389393 + 860 0.086 -665.11603 -667.02075 148.84448 21.610149 12.480128 50 2252.9811 787.43069 -39.585062 + 870 0.087 -665.1175 -667.03045 149.48743 21.611481 12.481034 50 2060.884 901.76342 -27.129117 + 880 0.088 -665.11907 -667.01838 148.42091 21.612958 12.481978 50 1814.3354 1079.4855 -13.988401 + 890 0.089 -665.12073 -666.99552 146.50471 21.614562 12.482966 50 1531.1565 1293.9709 -1.305884 + 900 0.09 -665.12247 -666.97639 144.87389 21.616275 12.484007 50 1231.9005 1514.0741 9.7083525 + 910 0.091 -665.12426 -666.97371 144.52455 21.618074 12.485109 50 938.90089 1708.364 17.929974 + 920 0.092 -665.12609 -666.99389 145.95889 21.61994 12.486281 50 674.90767 1849.2415 22.497207 + 930 0.093 -665.12794 -667.03498 149.02559 21.621853 12.487528 50 461.18604 1916.1468 22.971745 + 940 0.094 -665.12977 -667.08777 153.00718 21.6238 12.488852 50 315.19601 1897.3867 19.43758 + 950 0.095 -665.13156 -667.13925 156.8903 21.62577 12.490254 50 248.20946 1790.5667 12.504818 + 960 0.096 -665.13326 -667.17668 159.68273 21.627757 12.491728 50 263.35912 1601.9528 3.2123256 + 970 0.097 -665.13485 -667.19079 160.6611 21.629764 12.493267 50 354.58496 1345.1489 -7.1487162 + 980 0.098 -665.13628 -667.17758 159.5175 21.631796 12.494862 50 506.7626 1039.346 -17.249179 + 990 0.099 -665.13753 -667.13942 156.43758 21.633864 12.496499 50 697.06054 707.26671 -25.92737 + 1000 0.1 -665.13859 -667.0853 152.12472 21.635982 12.498164 50 897.38498 372.94791 -32.344697 +Loop time of 0.174508 on 4 procs for 1000 steps with 100 atoms + +Performance: 49.511 ns/day, 0.485 hours/ns, 5730.393 timesteps/s +98.8% 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.12409 | 0.12834 | 0.13408 | 1.1 | 73.54 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.016369 | 0.021358 | 0.025324 | 2.7 | 12.24 +Output | 0.0023892 | 0.0025101 | 0.0028272 | 0.4 | 1.44 +Modify | 0.01733 | 0.018302 | 0.018958 | 0.5 | 10.49 +Other | | 0.003995 | | | 2.29 + +Nlocal: 25 ave 26 max 24 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Nghost: 179 ave 180 max 178 min +Histogram: 2 0 0 0 0 0 0 0 0 2 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 450 ave 468 max 432 min +Histogram: 2 0 0 0 0 0 0 0 0 2 + +Total # of neighbors = 1800 +Ave neighs/atom = 18 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:00 diff --git a/potentials/BN.extep b/potentials/BN.extep index fd5e653fb5..1b9f46c768 100644 --- a/potentials/BN.extep +++ b/potentials/BN.extep @@ -1,7 +1,8 @@ -# B and N mixture, parameterized for Tersoff potential -# values are from Los et al. PhysRevB.96.184108 (2017) +# DATE: 2017-11-28 CONTRIBUTOR: J.H. Los, J.M.H. Kroes CITATION: Los et al. Phys. Rev. B 96, 184108 (2017) -# Tersoff parameters for various elements and mixtures +# B and N mixture, parameterized for ExTeP potential + +# ExTeP parameters for various elements and mixtures # multiple entries can be added to this file, LAMMPS reads the ones it needs # these entries are in LAMMPS "metal" units: # A,B = eV; lambda1,lambda2,lambda3 = 1/Angstroms; R,D = Angstroms diff --git a/src/.gitignore b/src/.gitignore index 8d99776096..13fb446225 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1083,10 +1083,16 @@ /pair_born_coul_long_cs.h /pair_born_coul_dsf_cs.cpp /pair_born_coul_dsf_cs.h +/pair_born_coul_wolf_cs.cpp +/pair_born_coul_wolf_cs.h /pair_buck_coul_long_cs.cpp /pair_buck_coul_long_cs.h /pair_coul_long_cs.cpp /pair_coul_long_cs.h +/pair_coul_wolf_cs.cpp +/pair_coul_wolf_cs.h +/pair_extep.cpp +/pair_extep.h /pair_lj_cut_thole_long.cpp /pair_lj_cut_thole_long.h /pair_plum_hb.cpp diff --git a/src/USER-MISC/README b/src/USER-MISC/README index 5af5b22eb7..a8c33fa380 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -63,6 +63,7 @@ pair_style coul/diel, Axel Kohlmeyer, akohlmey at gmail.com, 1 Dec 11 pair_style dipole/sf, Mario Orsi, orsimario at gmail.com, 8 Aug 11 pair_style edip, Luca Ferraro, luca.ferraro at caspur.it, 15 Sep 11 pair_style eam/cd, Alexander Stukowski, stukowski at mm.tu-darmstadt.de, 7 Nov 09 +pair_style extep, Jaap Kroes (Radboud U), jaapkroes at gmail dot com, 28 Nov 17 pair_style gauss/cut, Axel Kohlmeyer, akohlmey at gmail.com, 1 Dec 11 pair_style lennard/mdf, Paolo Raiteri, p.raiteri at curtin.edu.au, 2 Dec 15 pair_style list, Axel Kohlmeyer (Temple U), akohlmey at gmail.com, 1 Jun 13 diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp old mode 100755 new mode 100644 index 13ca404de3..cf859a28f8 --- a/src/USER-MISC/pair_extep.cpp +++ b/src/USER-MISC/pair_extep.cpp @@ -15,10 +15,10 @@ Contributing author: Jan Los ------------------------------------------------------------------------- */ -#include "math.h" -#include "stdio.h" -#include "stdlib.h" -#include "string.h" +#include +#include +#include +#include #include "pair_extep.h" #include "atom.h" #include "neighbor.h" @@ -100,7 +100,7 @@ PairExTeP::~PairExTeP() void PairExTeP::SR_neigh() { int i,j,ii,jj,n,allnum,jnum,itype,jtype,iparam_ij; - double xtmp,ytmp,ztmp,delx,dely,delz,rsq,dS; + double xtmp,ytmp,ztmp,delx,dely,delz,rsq; int *ilist,*jlist,*numneigh,**firstneigh; int *neighptr; @@ -140,7 +140,7 @@ void PairExTeP::SR_neigh() xtmp = x[i][0]; ytmp = x[i][1]; ztmp = x[i][2]; - + Nt[i] = 0.0; Nd[i] = 0.0; @@ -162,7 +162,7 @@ void PairExTeP::SR_neigh() neighptr[n++] = j; double tmp_fc = ters_fc(sqrt(rsq),¶ms[iparam_ij]); Nt[i] += tmp_fc; - if(itype!=jtype) { + if (itype!=jtype) { Nd[i] += tmp_fc; } } @@ -184,7 +184,7 @@ void PairExTeP::compute(int eflag, int vflag) int itype,jtype,ktype,iparam_ij,iparam_ijk; tagint itag,jtag; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; - double rsq,rsq1,rsq2,r,r2; + double rsq,rsq1,rsq2,r2; double delr1[3],delr2[3],fi[3],fj[3],fk[3]; double zeta_ij,prefactor; int *ilist,*jlist,*numneigh,**firstneigh; @@ -281,10 +281,10 @@ void PairExTeP::compute(int eflag, int vflag) zeta_ij = 0.0; /* F_IJ (1) */ - // compute correction to energy and forces - // dE/dr = -Fij(Zi,Zj) dV/dr - // - dFij/dZi dZi/dr V - // (conjugate term is computed when j is a central atom) + // compute correction to energy and forces + // dE/dr = -Fij(Zi,Zj) dV/dr + // - dFij/dZi dZi/dr V + // (conjugate term is computed when j is a central atom) double FXY, dFXY_dNdij, dFXY_dNdji, fa, fa_d, deng, fpair; double Ntij = Nt[i]; @@ -296,14 +296,14 @@ void PairExTeP::compute(int eflag, int vflag) Ntij -= fc_ij; Ntji -= fc_ij; - if(jtype!=itype) { + if (jtype!=itype) { Ndij -= fc_ij; Ndji -= fc_ij; } - if(Ntij<0) { Ntij=0.; } - if(Ndij<0) { Ndij=0.; } - if(Ntji<0) { Ntji=0.; } - if(Ndji<0) { Ndji=0.; } + if (Ntij<0) { Ntij=0.; } + if (Ndij<0) { Ndij=0.; } + if (Ntji<0) { Ntji=0.; } + if (Ndji<0) { Ndji=0.; } FXY = F_corr(itype, jtype, Ndij, Ndji, &dFXY_dNdij, &dFXY_dNdji); // envelop functions @@ -350,7 +350,7 @@ void PairExTeP::compute(int eflag, int vflag) /* F_IJ (2) */ // compute force components due to spline derivatives // uses only the part with FXY_x (FXY_y is done when i and j are inversed) - int iparam_ik = elem2param[itype][ktype][0]; + int iparam_ik = elem2param[itype][ktype][0]; double fc_ik_d = ters_fc_d(r2,¶ms[iparam_ik]); double fc_prefac_ik_0 = 1.0 * fc_ik_d * fa / r2; double fc_prefac_ik = dFc_dNtij * fc_prefac_ik_0; @@ -706,7 +706,7 @@ void PairExTeP::read_file(char *file) error->all(FLERR,"Illegal ExTeP parameter"); nparams++; - if(nparams >= pow(atom->ntypes,3)) break; + if (nparams >= pow(atom->ntypes,3)) break; } // deallocate words array @@ -719,18 +719,18 @@ void PairExTeP::read_file(char *file) words = new char*[params_per_line+1]; // intialize F_corr_data to all zeros - for(int iel=0;ielntypes;iel++) - for(int jel=0;jelntypes;jel++) - for(int in=0;in<4;in++) - for(int jn=0;jn<4;jn++) - for(int ivar=0;ivar<3;ivar++) + for (int iel=0;ielntypes;iel++) + for (int jel=0;jelntypes;jel++) + for (int in=0;in<4;in++) + for (int jn=0;jn<4;jn++) + for (int ivar=0;ivar<3;ivar++) F_corr_data[iel][jel][in][jn][ivar]=0; // loop until EOF while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - //fputs(line,stdout); + //fputs(line,stdout); if (ptr == NULL) { eof = 1; fclose(fp); @@ -759,7 +759,8 @@ void PairExTeP::read_file(char *file) // ielement,jelement = 1st args // if all 3 args are in element list, then parse this line // else skip to next line - // these lines set ielement and jelement to the integers matching the strings from the input + // these lines set ielement and jelement to the + // integers matching the strings from the input for (ielement = 0; ielement < nelements; ielement++) if (strcmp(words[0],elements[ielement]) == 0) break; @@ -775,8 +776,9 @@ void PairExTeP::read_file(char *file) double spline_dery = atof(words[6]); // Set value for all pairs of ielement,jelement (any kelement) - for(int iparam = 0; iparam < nparams; iparam++) { - if( ielement == params[iparam].ielement && jelement == params[iparam].jelement) { + for (int iparam = 0; iparam < nparams; iparam++) { + if ( ielement == params[iparam].ielement + && jelement == params[iparam].jelement) { F_corr_data[ielement][jelement][Ni][Nj][0] = spline_val; F_corr_data[ielement][jelement][Ni][Nj][1] = spline_derx; F_corr_data[ielement][jelement][Ni][Nj][2] = spline_dery; @@ -785,7 +787,7 @@ void PairExTeP::read_file(char *file) F_corr_data[jelement][ielement][Nj][Ni][1] = spline_dery; F_corr_data[jelement][ielement][Nj][Ni][2] = spline_derx; } - } + } } delete [] words; @@ -821,7 +823,6 @@ void PairExTeP::setup() elem2param[i][j][k] = n; } - // compute parameter values derived from inputs for (m = 0; m < nparams; m++) { @@ -993,10 +994,10 @@ double PairExTeP::ters_bij_d(double zeta, Param *param) /* ---------------------------------------------------------------------- */ void PairExTeP::ters_zetaterm_d(double prefactor, - double *rij_hat, double rij, - double *rik_hat, double rik, - double *dri, double *drj, double *drk, - Param *param) + double *rij_hat, double rij, + double *rik_hat, double rik, + double *dri, double *drj, double *drk, + Param *param) { double gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp; double dcosdri[3],dcosdrj[3],dcosdrk[3]; @@ -1052,8 +1053,8 @@ void PairExTeP::ters_zetaterm_d(double prefactor, /* ---------------------------------------------------------------------- */ void PairExTeP::costheta_d(double *rij_hat, double rij, - double *rik_hat, double rik, - double *dri, double *drj, double *drk) + double *rik_hat, double rik, + double *dri, double *drj, double *drk) { // first element is devative wrt Ri, second wrt Rj, third wrt Rk @@ -1074,10 +1075,10 @@ void PairExTeP::costheta_d(double *rij_hat, double rij, // initialize spline for F_corr (based on PairLCBOP::F_conj) void PairExTeP::spline_init() { - for( size_t iel=0; ielntypes; iel++) { - for( size_t jel=0; jelntypes; jel++) { - for( size_t N_ij=0; N_ij<4; N_ij++ ) { - for( size_t N_ji=0; N_ji<4; N_ji++ ) { + for ( size_t iel=0; ielntypes; iel++) { + for ( size_t jel=0; jelntypes; jel++) { + for ( size_t N_ij=0; N_ij<4; N_ij++ ) { + for ( size_t N_ji=0; N_ji<4; N_ji++ ) { TF_corr_param &f = F_corr_param[iel][jel][N_ij][N_ji]; // corner points for each spline function @@ -1096,7 +1097,6 @@ void PairExTeP::spline_init() { f.f_y_01 = -(F_corr_data[iel][jel][N_ij ][N_ji+1][2] - f.f_01 + f.f_00); f.f_y_10 = F_corr_data[iel][jel][N_ij+1][N_ji ][2] - f.f_11 + f.f_10; f.f_y_11 = -(F_corr_data[iel][jel][N_ij+1][N_ji+1][2] - f.f_11 + f.f_10); - } } } @@ -1113,7 +1113,7 @@ double PairExTeP::envelop_function(double x, double y, double *func_der) { if (x <= 3.0) { fx = 1.0; dfx = 0.0; - if(x < 1.0 && y < 1.0) { + if (x < 1.0 && y < 1.0) { double gx=(1.0-x); double gy=(1.0-y); double gxsq=gx*gx; @@ -1122,22 +1122,22 @@ double PairExTeP::envelop_function(double x, double y, double *func_der) { dfxydx = 2.0*gx*gysq; } } else if (x < 4.0) { - del = 4.0-x; - delsq = del*del; - fx = (3.0-2.0*del)*delsq; - dfx = - 6.0*del*(1.0-del); - } else { - fx = 0.0; - dfx = 0.0; + del = 4.0-x; + delsq = del*del; + fx = (3.0-2.0*del)*delsq; + dfx = - 6.0*del*(1.0-del); + } else { + fx = 0.0; + dfx = 0.0; } if (y <= 3.0) { fy = 1.0; } else if (y < 4.0) { - del = 4.0-y; - delsq = del*del; - fy = (3.0-2.0*del)*delsq; - } else { - fy = 0.0; + del = 4.0-y; + delsq = del*del; + fy = (3.0-2.0*del)*delsq; + } else { + fy = 0.0; } double func_val = fxy*fx*fy; @@ -1147,22 +1147,38 @@ double PairExTeP::envelop_function(double x, double y, double *func_der) { } double PairExTeP::F_corr(int iel, int jel, double Ndij, double Ndji, double *dFN_x, double *dFN_y ) { - + // compute F_XY size_t Ndij_int = static_cast( floor( Ndij ) ); size_t Ndji_int = static_cast( floor( Ndji ) ); double x = Ndij - Ndij_int; double y = Ndji - Ndji_int; - const TF_corr_param &f = F_corr_param[iel][jel][Ndij_int][Ndji_int]; + TF_corr_param &f = F_corr_param[iel][jel][Ndij_int][Ndji_int]; double F = 0; double dF_dx = 0, dF_dy = 0; double l, r; - if(Ndij_int < 4 && Ndji_int < 4) { - l = (1-y)* (1-x); r = ( f.f_00 + x* x* f.f_x_10 + y* y* f.f_y_01 ); F += l*r; dF_dx += -(1-y)*r +l*2*x* f.f_x_10; dF_dy += -(1-x)*r +l*2*y* f.f_y_01; - l = (1-y)* x; r = ( f.f_10 + (1-x)*(1-x)*f.f_x_00 + y* y* f.f_y_11 ); F += l*r; dF_dx += (1-y)*r -l*2*(1-x)*f.f_x_00; dF_dy += -x* r +l*2*y* f.f_y_11; - l = y* (1-x); r = ( f.f_01 + x* x* f.f_x_11 + (1-y)*(1-y)*f.f_y_00 ); F += l*r; dF_dx += -y* r +l*2*x* f.f_x_11; dF_dy += (1-x)*r -l*2*(1-y)*f.f_y_00; - l = y* x; r = ( f.f_11 + (1-x)*(1-x)*f.f_x_01 + (1-y)*(1-y)*f.f_y_10 ); F += l*r; dF_dx += y* r -l*2*(1-x)*f.f_x_01; dF_dy += x* r -l*2*(1-y)*f.f_y_10; + if (Ndij_int < 4 && Ndji_int < 4) { + l = (1-y)* (1-x); + r = ( f.f_00 + x*x* f.f_x_10 + y*y* f.f_y_01 ); + F += l*r; + dF_dx += -(1-y)*r +l*2*x* f.f_x_10; + dF_dy += -(1-x)*r +l*2*y* f.f_y_01; + l = (1-y)*x; + r = ( f.f_10 + (1-x)*(1-x)*f.f_x_00 + y* y* f.f_y_11 ); + F += l*r; + dF_dx += (1-y)*r -l*2*(1-x)*f.f_x_00; + dF_dy += -x*r +l*2*y* f.f_y_11; + l = y* (1-x); + r = ( f.f_01 + x*x* f.f_x_11 + (1-y)*(1-y)*f.f_y_00 ); + F += l*r; + dF_dx += -y*r +l*2*x* f.f_x_11; + dF_dy += (1-x)*r -l*2*(1-y)*f.f_y_00; + l = y* x; + r = ( f.f_11 + (1-x)*(1-x)*f.f_x_01 + (1-y)*(1-y)*f.f_y_10 ); + F += l*r; + dF_dx += y*r -l*2*(1-x)*f.f_x_01; + dF_dy += x*r -l*2*(1-y)*f.f_y_10; } double result = F; *dFN_x = dF_dx; @@ -1171,4 +1187,3 @@ double PairExTeP::F_corr(int iel, int jel, double Ndij, double Ndji, double *dFN return result; } /* F_IJ (4) */ - diff --git a/src/USER-MISC/pair_extep.h b/src/USER-MISC/pair_extep.h old mode 100755 new mode 100644 From 6f7bd78ea2352a406e7627c229a47a365b25b60b Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Wed, 29 Nov 2017 01:02:04 -0500 Subject: [PATCH 14/34] Fixes issue #701 PyLammps now supports thermo_style entries such as c_msd[4] --- python/lammps.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/python/lammps.py b/python/lammps.py index 944eaeabf5..ee6e461d33 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -603,6 +603,30 @@ class Atom2D(Atom): self.lmp.eval("fy[%d]" % self.index)) +class variable_set: + def __init__(self, name, variable_dict): + self._name = name + array_pattern = re.compile(r"(?P.+)\[(?P[0-9]+)\]") + + for key, value in variable_dict.items(): + m = array_pattern.match(key) + if m: + g = m.groupdict() + varname = g['arr'] + idx = int(g['index']) + if varname not in self.__dict__: + self.__dict__[varname] = {} + self.__dict__[varname][idx] = value + else: + self.__dict__[key] = value + + def __str__(self): + return "{}({})".format(self._name, ','.join(["{}={}".format(k, self.__dict__[k]) for k in self.__dict__.keys() if not k.startswith('_')])) + + def __repr__(self): + return self.__str__() + + def get_thermo_data(output): """ traverse output of runs and extract thermo data columns """ if isinstance(output, str): @@ -630,7 +654,7 @@ def get_thermo_data(output): elif line.startswith("Loop time of "): in_run = False columns = None - thermo_data = namedtuple('ThermoData', list(current_run.keys()))(*list(current_run.values())) + thermo_data = variable_set('ThermoData', current_run) r = {'thermo' : thermo_data } runs.append(namedtuple('Run', list(r.keys()))(*list(r.values()))) elif in_run and len(columns) > 0: From 319508bd292b9c36c6fa4c30ea1220776f06ffb7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 30 Nov 2017 10:56:58 -0500 Subject: [PATCH 15/34] fix scoping ambiguity issue that confuses nvcc --- lib/atc/Matrix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/atc/Matrix.h b/lib/atc/Matrix.h index e467128fbc..e806ebd016 100644 --- a/lib/atc/Matrix.h +++ b/lib/atc/Matrix.h @@ -356,7 +356,7 @@ DenseMatrix Matrix::pow(double n) const int sz=this->size(); for(INDEX i=0; i Date: Fri, 1 Dec 2017 09:13:31 -0700 Subject: [PATCH 16/34] Make memory_kokkos its own class --- src/KOKKOS/Install.sh | 1 - src/KOKKOS/angle_charmm_kokkos.cpp | 14 +- src/KOKKOS/angle_class2_kokkos.cpp | 14 +- src/KOKKOS/angle_harmonic_kokkos.cpp | 14 +- src/KOKKOS/atom_kokkos.cpp | 134 +++++++++--------- src/KOKKOS/atom_vec_angle_kokkos.cpp | 38 ++--- src/KOKKOS/atom_vec_atomic_kokkos.cpp | 16 +-- src/KOKKOS/atom_vec_bond_kokkos.cpp | 28 ++-- src/KOKKOS/atom_vec_charge_kokkos.cpp | 18 +-- src/KOKKOS/atom_vec_dpd_kokkos.cpp | 32 ++--- src/KOKKOS/atom_vec_full_kokkos.cpp | 64 ++++----- src/KOKKOS/atom_vec_hybrid_kokkos.cpp | 2 +- src/KOKKOS/atom_vec_molecular_kokkos.cpp | 62 ++++---- src/KOKKOS/bond_class2_kokkos.cpp | 14 +- src/KOKKOS/bond_fene_kokkos.cpp | 14 +- src/KOKKOS/bond_harmonic_kokkos.cpp | 14 +- src/KOKKOS/comm_kokkos.cpp | 14 +- src/KOKKOS/comm_tiled_kokkos.cpp | 2 +- src/KOKKOS/dihedral_charmm_kokkos.cpp | 14 +- src/KOKKOS/dihedral_class2_kokkos.cpp | 14 +- src/KOKKOS/dihedral_opls_kokkos.cpp | 14 +- src/KOKKOS/fix_eos_table_rx_kokkos.cpp | 14 +- src/KOKKOS/fix_langevin_kokkos.cpp | 30 ++-- src/KOKKOS/fix_nh_kokkos.cpp | 2 +- src/KOKKOS/fix_property_atom_kokkos.cpp | 4 +- src/KOKKOS/fix_qeq_reax_kokkos.cpp | 2 +- src/KOKKOS/fix_reaxc_bonds_kokkos.cpp | 6 +- src/KOKKOS/fix_reaxc_species_kokkos.cpp | 2 +- src/KOKKOS/fix_rx_kokkos.cpp | 60 ++++---- src/KOKKOS/fix_setforce_kokkos.cpp | 10 +- src/KOKKOS/fix_shardlow_kokkos.cpp | 2 +- src/KOKKOS/gridcomm_kokkos.cpp | 6 +- src/KOKKOS/improper_class2_kokkos.cpp | 14 +- src/KOKKOS/improper_harmonic_kokkos.cpp | 14 +- src/KOKKOS/kokkos.cpp | 3 + src/KOKKOS/memory_kokkos.h | 19 +++ src/KOKKOS/nbin_ssa_kokkos.cpp | 2 +- src/KOKKOS/neigh_bond_kokkos.cpp | 26 ++-- src/KOKKOS/neigh_list_kokkos.cpp | 2 +- src/KOKKOS/neighbor_kokkos.cpp | 56 ++++---- src/KOKKOS/pair_buck_coul_cut_kokkos.cpp | 20 +-- src/KOKKOS/pair_buck_coul_long_kokkos.cpp | 20 +-- src/KOKKOS/pair_buck_kokkos.cpp | 16 +-- src/KOKKOS/pair_coul_cut_kokkos.cpp | 14 +- src/KOKKOS/pair_coul_debye_kokkos.cpp | 14 +- src/KOKKOS/pair_coul_dsf_kokkos.cpp | 14 +- src/KOKKOS/pair_coul_long_kokkos.cpp | 18 +-- src/KOKKOS/pair_coul_wolf_kokkos.cpp | 14 +- src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp | 34 ++--- src/KOKKOS/pair_eam_alloy_kokkos.cpp | 14 +- src/KOKKOS/pair_eam_fs_kokkos.cpp | 14 +- src/KOKKOS/pair_eam_kokkos.cpp | 14 +- src/KOKKOS/pair_exp6_rx_kokkos.cpp | 30 ++-- src/KOKKOS/pair_hybrid_kokkos.cpp | 2 +- ..._lj_charmm_coul_charmm_implicit_kokkos.cpp | 20 +-- .../pair_lj_charmm_coul_charmm_kokkos.cpp | 20 +-- .../pair_lj_charmm_coul_long_kokkos.cpp | 20 +-- src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp | 22 +-- .../pair_lj_class2_coul_long_kokkos.cpp | 20 +-- src/KOKKOS/pair_lj_class2_kokkos.cpp | 12 +- src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp | 22 +-- src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp | 22 +-- src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp | 22 +-- src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp | 24 ++-- src/KOKKOS/pair_lj_cut_kokkos.cpp | 16 +-- src/KOKKOS/pair_lj_expand_kokkos.cpp | 12 +- .../pair_lj_gromacs_coul_gromacs_kokkos.cpp | 20 +-- src/KOKKOS/pair_lj_gromacs_kokkos.cpp | 20 +-- src/KOKKOS/pair_lj_sdk_kokkos.cpp | 12 +- src/KOKKOS/pair_morse_kokkos.cpp | 16 +-- src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp | 38 ++--- src/KOKKOS/pair_reaxc_kokkos.cpp | 26 ++-- src/KOKKOS/pair_sw_kokkos.cpp | 16 +-- src/KOKKOS/pair_table_kokkos.cpp | 60 ++++---- src/KOKKOS/pair_table_rx_kokkos.cpp | 68 ++++----- src/KOKKOS/pair_tersoff_kokkos.cpp | 14 +- src/KOKKOS/pair_tersoff_mod_kokkos.cpp | 14 +- src/KOKKOS/pair_tersoff_zbl_kokkos.cpp | 14 +- src/KOKKOS/pair_vashishta_kokkos.cpp | 16 +-- src/KOKKOS/pppm_kokkos.cpp | 28 ++-- src/KOKKOS/verlet_kokkos.cpp | 2 +- src/accelerator_kokkos.h | 9 ++ src/lammps.cpp | 3 + src/lammps.h | 1 + src/memory.h | 13 -- src/pointers.h | 2 + src/special.cpp | 3 +- 87 files changed, 850 insertions(+), 826 deletions(-) diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index df5fc3e5f1..f86ef990d5 100644 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -29,7 +29,6 @@ action () { # force rebuild of files with LMP_KOKKOS switch touch ../accelerator_kokkos.h -touch ../memory.h # list of files with optional dependcies diff --git a/src/KOKKOS/angle_charmm_kokkos.cpp b/src/KOKKOS/angle_charmm_kokkos.cpp index 401a00c856..59a20c25df 100644 --- a/src/KOKKOS/angle_charmm_kokkos.cpp +++ b/src/KOKKOS/angle_charmm_kokkos.cpp @@ -24,7 +24,7 @@ #include "comm.h" #include "force.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -51,8 +51,8 @@ template AngleCharmmKokkos::~AngleCharmmKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -71,15 +71,15 @@ void AngleCharmmKokkos::compute(int eflag_in, int vflag_in) if (eflag_atom) { //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); d_vatom = k_vatom.template view(); //} } diff --git a/src/KOKKOS/angle_class2_kokkos.cpp b/src/KOKKOS/angle_class2_kokkos.cpp index e851e9d500..108b4f48f2 100644 --- a/src/KOKKOS/angle_class2_kokkos.cpp +++ b/src/KOKKOS/angle_class2_kokkos.cpp @@ -24,7 +24,7 @@ #include "comm.h" #include "force.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -51,8 +51,8 @@ template AngleClass2Kokkos::~AngleClass2Kokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -70,13 +70,13 @@ void AngleClass2Kokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"angle:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"angle:eatom"); d_eatom = k_eatom.template view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"angle:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"angle:vatom"); d_vatom = k_vatom.template view(); } diff --git a/src/KOKKOS/angle_harmonic_kokkos.cpp b/src/KOKKOS/angle_harmonic_kokkos.cpp index 9fd237ddb3..dd5a1e26c7 100644 --- a/src/KOKKOS/angle_harmonic_kokkos.cpp +++ b/src/KOKKOS/angle_harmonic_kokkos.cpp @@ -24,7 +24,7 @@ #include "comm.h" #include "force.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -51,8 +51,8 @@ template AngleHarmonicKokkos::~AngleHarmonicKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -70,13 +70,13 @@ void AngleHarmonicKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"angle:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"angle:eatom"); d_eatom = k_eatom.template view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"angle:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"angle:vatom"); d_vatom = k_vatom.template view(); } diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index 31b33dbdc9..4ecead5b1d 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -19,7 +19,7 @@ #include "update.h" #include "domain.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "kokkos.h" @@ -33,59 +33,59 @@ AtomKokkos::AtomKokkos(LAMMPS *lmp) : Atom(lmp) {} AtomKokkos::~AtomKokkos() { - memory->destroy_kokkos(k_tag, tag); - memory->destroy_kokkos(k_mask, mask); - memory->destroy_kokkos(k_type, type); - memory->destroy_kokkos(k_image, image); - memory->destroy_kokkos(k_molecule, molecule); + memoryKK->destroy_kokkos(k_tag, tag); + memoryKK->destroy_kokkos(k_mask, mask); + memoryKK->destroy_kokkos(k_type, type); + memoryKK->destroy_kokkos(k_image, image); + memoryKK->destroy_kokkos(k_molecule, molecule); - memory->destroy_kokkos(k_x, x); - memory->destroy_kokkos(k_v, v); - memory->destroy_kokkos(k_f, f); + memoryKK->destroy_kokkos(k_x, x); + memoryKK->destroy_kokkos(k_v, v); + memoryKK->destroy_kokkos(k_f, f); - memory->destroy_kokkos(k_mass, mass); - memory->destroy_kokkos(k_q, q); + memoryKK->destroy_kokkos(k_mass, mass); + memoryKK->destroy_kokkos(k_q, q); - memory->destroy_kokkos(k_radius, radius); - memory->destroy_kokkos(k_rmass, rmass); - memory->destroy_kokkos(k_omega, omega); - memory->destroy_kokkos(k_angmom, angmom); - memory->destroy_kokkos(k_torque, torque); + memoryKK->destroy_kokkos(k_radius, radius); + memoryKK->destroy_kokkos(k_rmass, rmass); + memoryKK->destroy_kokkos(k_omega, omega); + memoryKK->destroy_kokkos(k_angmom, angmom); + memoryKK->destroy_kokkos(k_torque, torque); - memory->destroy_kokkos(k_nspecial, nspecial); - memory->destroy_kokkos(k_special, special); - memory->destroy_kokkos(k_num_bond, num_bond); - memory->destroy_kokkos(k_bond_type, bond_type); - memory->destroy_kokkos(k_bond_atom, bond_atom); - memory->destroy_kokkos(k_num_angle, num_angle); - memory->destroy_kokkos(k_angle_type, angle_type); - memory->destroy_kokkos(k_angle_atom1, angle_atom1); - memory->destroy_kokkos(k_angle_atom2, angle_atom2); - memory->destroy_kokkos(k_angle_atom3, angle_atom3); - memory->destroy_kokkos(k_num_dihedral, num_dihedral); - memory->destroy_kokkos(k_dihedral_type, dihedral_type); - memory->destroy_kokkos(k_dihedral_atom1, dihedral_atom1); - memory->destroy_kokkos(k_dihedral_atom2, dihedral_atom2); - memory->destroy_kokkos(k_dihedral_atom3, dihedral_atom3); - memory->destroy_kokkos(k_dihedral_atom4, dihedral_atom4); - memory->destroy_kokkos(k_num_improper, num_improper); - memory->destroy_kokkos(k_improper_type, improper_type); - memory->destroy_kokkos(k_improper_atom1, improper_atom1); - memory->destroy_kokkos(k_improper_atom2, improper_atom2); - memory->destroy_kokkos(k_improper_atom3, improper_atom3); - memory->destroy_kokkos(k_improper_atom4, improper_atom4); + memoryKK->destroy_kokkos(k_nspecial, nspecial); + memoryKK->destroy_kokkos(k_special, special); + memoryKK->destroy_kokkos(k_num_bond, num_bond); + memoryKK->destroy_kokkos(k_bond_type, bond_type); + memoryKK->destroy_kokkos(k_bond_atom, bond_atom); + memoryKK->destroy_kokkos(k_num_angle, num_angle); + memoryKK->destroy_kokkos(k_angle_type, angle_type); + memoryKK->destroy_kokkos(k_angle_atom1, angle_atom1); + memoryKK->destroy_kokkos(k_angle_atom2, angle_atom2); + memoryKK->destroy_kokkos(k_angle_atom3, angle_atom3); + memoryKK->destroy_kokkos(k_num_dihedral, num_dihedral); + memoryKK->destroy_kokkos(k_dihedral_type, dihedral_type); + memoryKK->destroy_kokkos(k_dihedral_atom1, dihedral_atom1); + memoryKK->destroy_kokkos(k_dihedral_atom2, dihedral_atom2); + memoryKK->destroy_kokkos(k_dihedral_atom3, dihedral_atom3); + memoryKK->destroy_kokkos(k_dihedral_atom4, dihedral_atom4); + memoryKK->destroy_kokkos(k_num_improper, num_improper); + memoryKK->destroy_kokkos(k_improper_type, improper_type); + memoryKK->destroy_kokkos(k_improper_atom1, improper_atom1); + memoryKK->destroy_kokkos(k_improper_atom2, improper_atom2); + memoryKK->destroy_kokkos(k_improper_atom3, improper_atom3); + memoryKK->destroy_kokkos(k_improper_atom4, improper_atom4); // USER-DPD package - memory->destroy_kokkos(k_uCond,uCond); - memory->destroy_kokkos(k_uMech,uMech); - memory->destroy_kokkos(k_uChem,uChem); - memory->destroy_kokkos(k_uCG,uCG); - memory->destroy_kokkos(k_uCGnew,uCGnew); - memory->destroy_kokkos(k_rho,rho); - memory->destroy_kokkos(k_dpdTheta,dpdTheta); - memory->destroy_kokkos(k_duChem,duChem); + memoryKK->destroy_kokkos(k_uCond,uCond); + memoryKK->destroy_kokkos(k_uMech,uMech); + memoryKK->destroy_kokkos(k_uChem,uChem); + memoryKK->destroy_kokkos(k_uCG,uCG); + memoryKK->destroy_kokkos(k_uCGnew,uCGnew); + memoryKK->destroy_kokkos(k_rho,rho); + memoryKK->destroy_kokkos(k_dpdTheta,dpdTheta); + memoryKK->destroy_kokkos(k_duChem,duChem); - memory->destroy_kokkos(k_dvector,dvector); + memoryKK->destroy_kokkos(k_dvector,dvector); dvector = NULL; } @@ -232,10 +232,10 @@ void AtomKokkos::sort() void AtomKokkos::grow(unsigned int mask){ if (mask & SPECIAL_MASK){ - memory->destroy_kokkos(k_special, special); + memoryKK->destroy_kokkos(k_special, special); sync(Device, mask); modified(Device, mask); - memory->grow_kokkos(k_special,special,nmax,maxspecial,"atom:special"); + memoryKK->grow_kokkos(k_special,special,nmax,maxspecial,"atom:special"); avec->grow_reset(); sync(Host, mask); } @@ -270,7 +270,7 @@ int AtomKokkos::add_custom(const char *name, int flag) int n = strlen(name) + 1; dname[index] = new char[n]; strcpy(dname[index],name); - memory->grow_kokkos(k_dvector,dvector,ndvector,nmax, + memoryKK->grow_kokkos(k_dvector,dvector,ndvector,nmax, "atom:dvector"); } @@ -291,7 +291,7 @@ void AtomKokkos::remove_custom(int flag, int index) delete [] iname[index]; iname[index] = NULL; } else { - //memory->destroy_kokkos(dvector); + //memoryKK->destroy_kokkos(dvector); dvector[index] = NULL; delete [] dname[index]; dname[index] = NULL; @@ -302,25 +302,25 @@ void AtomKokkos::remove_custom(int flag, int index) void AtomKokkos::deallocate_topology() { - memory->destroy_kokkos(k_bond_type, bond_type); - memory->destroy_kokkos(k_bond_atom, bond_atom); + memoryKK->destroy_kokkos(k_bond_type, bond_type); + memoryKK->destroy_kokkos(k_bond_atom, bond_atom); - memory->destroy_kokkos(k_angle_type, angle_type); - memory->destroy_kokkos(k_angle_atom1, angle_atom1); - memory->destroy_kokkos(k_angle_atom2, angle_atom2); - memory->destroy_kokkos(k_angle_atom3, angle_atom3); + memoryKK->destroy_kokkos(k_angle_type, angle_type); + memoryKK->destroy_kokkos(k_angle_atom1, angle_atom1); + memoryKK->destroy_kokkos(k_angle_atom2, angle_atom2); + memoryKK->destroy_kokkos(k_angle_atom3, angle_atom3); - memory->destroy_kokkos(k_dihedral_type, dihedral_type); - memory->destroy_kokkos(k_dihedral_atom1, dihedral_atom1); - memory->destroy_kokkos(k_dihedral_atom2, dihedral_atom2); - memory->destroy_kokkos(k_dihedral_atom3, dihedral_atom3); - memory->destroy_kokkos(k_dihedral_atom4, dihedral_atom4); + memoryKK->destroy_kokkos(k_dihedral_type, dihedral_type); + memoryKK->destroy_kokkos(k_dihedral_atom1, dihedral_atom1); + memoryKK->destroy_kokkos(k_dihedral_atom2, dihedral_atom2); + memoryKK->destroy_kokkos(k_dihedral_atom3, dihedral_atom3); + memoryKK->destroy_kokkos(k_dihedral_atom4, dihedral_atom4); - memory->destroy_kokkos(k_improper_type, improper_type); - memory->destroy_kokkos(k_improper_atom1, improper_atom1); - memory->destroy_kokkos(k_improper_atom2, improper_atom2); - memory->destroy_kokkos(k_improper_atom3, improper_atom3); - memory->destroy_kokkos(k_improper_atom4, improper_atom4); + memoryKK->destroy_kokkos(k_improper_type, improper_type); + memoryKK->destroy_kokkos(k_improper_atom1, improper_atom1); + memoryKK->destroy_kokkos(k_improper_atom2, improper_atom2); + memoryKK->destroy_kokkos(k_improper_atom3, improper_atom3); + memoryKK->destroy_kokkos(k_improper_atom4, improper_atom4); } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index 05414cf2e4..a9e55f530a 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "fix.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -68,33 +68,33 @@ void AtomVecAngleKokkos::grow(int n) sync(Device,ALL_MASK); modified(Device,ALL_MASK); - memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); - memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); - memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); - memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); + memoryKK->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); + memoryKK->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); + memoryKK->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); + memoryKK->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); - memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); - memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); - memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); + memoryKK->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); + memoryKK->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); + memoryKK->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); - memory->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); - memory->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); - memory->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial, + memoryKK->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); + memoryKK->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); + memoryKK->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial, "atom:special"); - memory->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); - memory->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom, + memoryKK->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); + memoryKK->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom, "atom:bond_type"); - memory->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom, + memoryKK->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom, "atom:bond_atom"); - memory->grow_kokkos(atomKK->k_num_angle,atomKK->num_angle,nmax,"atom:num_angle"); - memory->grow_kokkos(atomKK->k_angle_type,atomKK->angle_type,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_num_angle,atomKK->num_angle,nmax,"atom:num_angle"); + memoryKK->grow_kokkos(atomKK->k_angle_type,atomKK->angle_type,nmax,atomKK->angle_per_atom, "atom:angle_type"); - memory->grow_kokkos(atomKK->k_angle_atom1,atomKK->angle_atom1,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom1,atomKK->angle_atom1,nmax,atomKK->angle_per_atom, "atom:angle_atom1"); - memory->grow_kokkos(atomKK->k_angle_atom2,atomKK->angle_atom2,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom2,atomKK->angle_atom2,nmax,atomKK->angle_per_atom, "atom:angle_atom2"); - memory->grow_kokkos(atomKK->k_angle_atom3,atomKK->angle_atom3,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom3,atomKK->angle_atom3,nmax,atomKK->angle_per_atom, "atom:angle_atom3"); grow_reset(); diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index 6c610c8c11..f021c45db6 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "fix.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -64,14 +64,14 @@ void AtomVecAtomicKokkos::grow(int n) sync(Device,ALL_MASK); modified(Device,ALL_MASK); - memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); - memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); - memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); - memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); + memoryKK->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); + memoryKK->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); + memoryKK->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); + memoryKK->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); - memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); - memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); - memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); + memoryKK->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); + memoryKK->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); + memoryKK->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); grow_reset(); sync(Host,ALL_MASK); diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index 076144420c..bf682c507f 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "fix.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -65,21 +65,21 @@ void AtomVecBondKokkos::grow(int n) sync(Device,ALL_MASK); modified(Device,ALL_MASK); - memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); - memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); - memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); - memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); + memoryKK->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); + memoryKK->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); + memoryKK->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); + memoryKK->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); - memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); - memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); - memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); + memoryKK->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); + memoryKK->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); + memoryKK->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); - memory->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); - memory->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); - memory->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial,"atom:special"); - memory->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); - memory->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom,"atom:bond_type"); - memory->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom,"atom:bond_atom"); + memoryKK->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); + memoryKK->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); + memoryKK->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial,"atom:special"); + memoryKK->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); + memoryKK->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom,"atom:bond_type"); + memoryKK->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom,"atom:bond_atom"); grow_reset(); sync(Host,ALL_MASK); diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 7b8b74b405..a9ae5cc2d1 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "fix.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -67,16 +67,16 @@ void AtomVecChargeKokkos::grow(int n) sync(Device,ALL_MASK); modified(Device,ALL_MASK); - memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); - memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); - memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); - memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); + memoryKK->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); + memoryKK->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); + memoryKK->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); + memoryKK->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); - memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); - memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); - memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); + memoryKK->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); + memoryKK->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); + memoryKK->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); - memory->grow_kokkos(atomKK->k_q,atomKK->q,nmax,"atom:q"); + memoryKK->grow_kokkos(atomKK->k_q,atomKK->q,nmax,"atom:q"); grow_reset(); sync(Host,ALL_MASK); diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index c4e493bd85..9c54ffccc5 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "fix.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -67,24 +67,24 @@ void AtomVecDPDKokkos::grow(int n) sync(Device,ALL_MASK); modified(Device,ALL_MASK); - memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); - memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); - memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); - memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); + memoryKK->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); + memoryKK->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); + memoryKK->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); + memoryKK->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); - memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); - memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); - memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); + memoryKK->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); + memoryKK->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); + memoryKK->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); - memory->grow_kokkos(atomKK->k_rho,atomKK->rho,nmax,"atom:rho"); - memory->grow_kokkos(atomKK->k_dpdTheta,atomKK->dpdTheta,nmax,"atom:dpdTheta"); - memory->grow_kokkos(atomKK->k_uCond,atomKK->uCond,nmax,"atom:uCond"); - memory->grow_kokkos(atomKK->k_uMech,atomKK->uMech,nmax,"atom:uMech"); - memory->grow_kokkos(atomKK->k_uChem,atomKK->uChem,nmax,"atom:uChem"); - memory->grow_kokkos(atomKK->k_uCG,atomKK->uCG,nmax,"atom:uCG"); - memory->grow_kokkos(atomKK->k_uCGnew,atomKK->uCGnew,nmax,"atom:uCGnew"); - memory->grow_kokkos(atomKK->k_duChem,atomKK->duChem,nmax,"atom:duChem"); + memoryKK->grow_kokkos(atomKK->k_rho,atomKK->rho,nmax,"atom:rho"); + memoryKK->grow_kokkos(atomKK->k_dpdTheta,atomKK->dpdTheta,nmax,"atom:dpdTheta"); + memoryKK->grow_kokkos(atomKK->k_uCond,atomKK->uCond,nmax,"atom:uCond"); + memoryKK->grow_kokkos(atomKK->k_uMech,atomKK->uMech,nmax,"atom:uMech"); + memoryKK->grow_kokkos(atomKK->k_uChem,atomKK->uChem,nmax,"atom:uChem"); + memoryKK->grow_kokkos(atomKK->k_uCG,atomKK->uCG,nmax,"atom:uCG"); + memoryKK->grow_kokkos(atomKK->k_uCGnew,atomKK->uCGnew,nmax,"atom:uCGnew"); + memoryKK->grow_kokkos(atomKK->k_duChem,atomKK->duChem,nmax,"atom:duChem"); if (atom->nextra_grow) for (int iextra = 0; iextra < atom->nextra_grow; iextra++) diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 8e9abe4067..9369d7e844 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "fix.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -67,59 +67,59 @@ void AtomVecFullKokkos::grow(int n) sync(Device,ALL_MASK); modified(Device,ALL_MASK); - memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); - memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); - memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); - memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); + memoryKK->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); + memoryKK->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); + memoryKK->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); + memoryKK->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); - memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); - memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); - memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); + memoryKK->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); + memoryKK->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); + memoryKK->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); - memory->grow_kokkos(atomKK->k_q,atomKK->q,nmax,"atom:q"); - memory->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); + memoryKK->grow_kokkos(atomKK->k_q,atomKK->q,nmax,"atom:q"); + memoryKK->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); - memory->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); - memory->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial, + memoryKK->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); + memoryKK->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial, "atom:special"); - memory->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); - memory->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom, + memoryKK->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); + memoryKK->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom, "atom:bond_type"); - memory->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom, + memoryKK->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom, "atom:bond_atom"); - memory->grow_kokkos(atomKK->k_num_angle,atomKK->num_angle,nmax,"atom:num_angle"); - memory->grow_kokkos(atomKK->k_angle_type,atomKK->angle_type,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_num_angle,atomKK->num_angle,nmax,"atom:num_angle"); + memoryKK->grow_kokkos(atomKK->k_angle_type,atomKK->angle_type,nmax,atomKK->angle_per_atom, "atom:angle_type"); - memory->grow_kokkos(atomKK->k_angle_atom1,atomKK->angle_atom1,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom1,atomKK->angle_atom1,nmax,atomKK->angle_per_atom, "atom:angle_atom1"); - memory->grow_kokkos(atomKK->k_angle_atom2,atomKK->angle_atom2,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom2,atomKK->angle_atom2,nmax,atomKK->angle_per_atom, "atom:angle_atom2"); - memory->grow_kokkos(atomKK->k_angle_atom3,atomKK->angle_atom3,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom3,atomKK->angle_atom3,nmax,atomKK->angle_per_atom, "atom:angle_atom3"); - memory->grow_kokkos(atomKK->k_num_dihedral,atomKK->num_dihedral,nmax,"atom:num_dihedral"); - memory->grow_kokkos(atomKK->k_dihedral_type,atomKK->dihedral_type,nmax, + memoryKK->grow_kokkos(atomKK->k_num_dihedral,atomKK->num_dihedral,nmax,"atom:num_dihedral"); + memoryKK->grow_kokkos(atomKK->k_dihedral_type,atomKK->dihedral_type,nmax, atomKK->dihedral_per_atom,"atom:dihedral_type"); - memory->grow_kokkos(atomKK->k_dihedral_atom1,atomKK->dihedral_atom1,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom1,atomKK->dihedral_atom1,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom1"); - memory->grow_kokkos(atomKK->k_dihedral_atom2,atomKK->dihedral_atom2,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom2,atomKK->dihedral_atom2,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom2"); - memory->grow_kokkos(atomKK->k_dihedral_atom3,atomKK->dihedral_atom3,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom3,atomKK->dihedral_atom3,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom3"); - memory->grow_kokkos(atomKK->k_dihedral_atom4,atomKK->dihedral_atom4,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom4,atomKK->dihedral_atom4,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom4"); - memory->grow_kokkos(atomKK->k_num_improper,atomKK->num_improper,nmax,"atom:num_improper"); - memory->grow_kokkos(atomKK->k_improper_type,atomKK->improper_type,nmax, + memoryKK->grow_kokkos(atomKK->k_num_improper,atomKK->num_improper,nmax,"atom:num_improper"); + memoryKK->grow_kokkos(atomKK->k_improper_type,atomKK->improper_type,nmax, atomKK->improper_per_atom,"atom:improper_type"); - memory->grow_kokkos(atomKK->k_improper_atom1,atomKK->improper_atom1,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom1,atomKK->improper_atom1,nmax, atomKK->improper_per_atom,"atom:improper_atom1"); - memory->grow_kokkos(atomKK->k_improper_atom2,atomKK->improper_atom2,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom2,atomKK->improper_atom2,nmax, atomKK->improper_per_atom,"atom:improper_atom2"); - memory->grow_kokkos(atomKK->k_improper_atom3,atomKK->improper_atom3,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom3,atomKK->improper_atom3,nmax, atomKK->improper_per_atom,"atom:improper_atom3"); - memory->grow_kokkos(atomKK->k_improper_atom4,atomKK->improper_atom4,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom4,atomKK->improper_atom4,nmax, atomKK->improper_per_atom,"atom:improper_atom4"); grow_reset(); diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index e5e361e70a..b5aadb18d6 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -18,7 +18,7 @@ #include "domain.h" #include "modify.h" #include "fix.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index dbf6a857b2..6f232a319b 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "fix.h" #include "atom_masks.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -67,57 +67,57 @@ void AtomVecMolecularKokkos::grow(int n) sync(Device,ALL_MASK); modified(Device,ALL_MASK); - memory->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); - memory->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); - memory->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); - memory->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); + memoryKK->grow_kokkos(atomKK->k_tag,atomKK->tag,nmax,"atom:tag"); + memoryKK->grow_kokkos(atomKK->k_type,atomKK->type,nmax,"atom:type"); + memoryKK->grow_kokkos(atomKK->k_mask,atomKK->mask,nmax,"atom:mask"); + memoryKK->grow_kokkos(atomKK->k_image,atomKK->image,nmax,"atom:image"); - memory->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); - memory->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); - memory->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); + memoryKK->grow_kokkos(atomKK->k_x,atomKK->x,nmax,3,"atom:x"); + memoryKK->grow_kokkos(atomKK->k_v,atomKK->v,nmax,3,"atom:v"); + memoryKK->grow_kokkos(atomKK->k_f,atomKK->f,nmax,3,"atom:f"); - memory->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); - memory->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); - memory->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial, + memoryKK->grow_kokkos(atomKK->k_molecule,atomKK->molecule,nmax,"atom:molecule"); + memoryKK->grow_kokkos(atomKK->k_nspecial,atomKK->nspecial,nmax,3,"atom:nspecial"); + memoryKK->grow_kokkos(atomKK->k_special,atomKK->special,nmax,atomKK->maxspecial, "atom:special"); - memory->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); - memory->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom, + memoryKK->grow_kokkos(atomKK->k_num_bond,atomKK->num_bond,nmax,"atom:num_bond"); + memoryKK->grow_kokkos(atomKK->k_bond_type,atomKK->bond_type,nmax,atomKK->bond_per_atom, "atom:bond_type"); - memory->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom, + memoryKK->grow_kokkos(atomKK->k_bond_atom,atomKK->bond_atom,nmax,atomKK->bond_per_atom, "atom:bond_atom"); - memory->grow_kokkos(atomKK->k_num_angle,atomKK->num_angle,nmax,"atom:num_angle"); - memory->grow_kokkos(atomKK->k_angle_type,atomKK->angle_type,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_num_angle,atomKK->num_angle,nmax,"atom:num_angle"); + memoryKK->grow_kokkos(atomKK->k_angle_type,atomKK->angle_type,nmax,atomKK->angle_per_atom, "atom:angle_type"); - memory->grow_kokkos(atomKK->k_angle_atom1,atomKK->angle_atom1,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom1,atomKK->angle_atom1,nmax,atomKK->angle_per_atom, "atom:angle_atom1"); - memory->grow_kokkos(atomKK->k_angle_atom2,atomKK->angle_atom2,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom2,atomKK->angle_atom2,nmax,atomKK->angle_per_atom, "atom:angle_atom2"); - memory->grow_kokkos(atomKK->k_angle_atom3,atomKK->angle_atom3,nmax,atomKK->angle_per_atom, + memoryKK->grow_kokkos(atomKK->k_angle_atom3,atomKK->angle_atom3,nmax,atomKK->angle_per_atom, "atom:angle_atom3"); - memory->grow_kokkos(atomKK->k_num_dihedral,atomKK->num_dihedral,nmax,"atom:num_dihedral"); - memory->grow_kokkos(atomKK->k_dihedral_type,atomKK->dihedral_type,nmax, + memoryKK->grow_kokkos(atomKK->k_num_dihedral,atomKK->num_dihedral,nmax,"atom:num_dihedral"); + memoryKK->grow_kokkos(atomKK->k_dihedral_type,atomKK->dihedral_type,nmax, atomKK->dihedral_per_atom,"atom:dihedral_type"); - memory->grow_kokkos(atomKK->k_dihedral_atom1,atomKK->dihedral_atom1,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom1,atomKK->dihedral_atom1,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom1"); - memory->grow_kokkos(atomKK->k_dihedral_atom2,atomKK->dihedral_atom2,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom2,atomKK->dihedral_atom2,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom2"); - memory->grow_kokkos(atomKK->k_dihedral_atom3,atomKK->dihedral_atom3,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom3,atomKK->dihedral_atom3,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom3"); - memory->grow_kokkos(atomKK->k_dihedral_atom4,atomKK->dihedral_atom4,nmax, + memoryKK->grow_kokkos(atomKK->k_dihedral_atom4,atomKK->dihedral_atom4,nmax, atomKK->dihedral_per_atom,"atom:dihedral_atom4"); - memory->grow_kokkos(atomKK->k_num_improper,atomKK->num_improper,nmax,"atom:num_improper"); - memory->grow_kokkos(atomKK->k_improper_type,atomKK->improper_type,nmax, + memoryKK->grow_kokkos(atomKK->k_num_improper,atomKK->num_improper,nmax,"atom:num_improper"); + memoryKK->grow_kokkos(atomKK->k_improper_type,atomKK->improper_type,nmax, atomKK->improper_per_atom,"atom:improper_type"); - memory->grow_kokkos(atomKK->k_improper_atom1,atomKK->improper_atom1,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom1,atomKK->improper_atom1,nmax, atomKK->improper_per_atom,"atom:improper_atom1"); - memory->grow_kokkos(atomKK->k_improper_atom2,atomKK->improper_atom2,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom2,atomKK->improper_atom2,nmax, atomKK->improper_per_atom,"atom:improper_atom2"); - memory->grow_kokkos(atomKK->k_improper_atom3,atomKK->improper_atom3,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom3,atomKK->improper_atom3,nmax, atomKK->improper_per_atom,"atom:improper_atom3"); - memory->grow_kokkos(atomKK->k_improper_atom4,atomKK->improper_atom4,nmax, + memoryKK->grow_kokkos(atomKK->k_improper_atom4,atomKK->improper_atom4,nmax, atomKK->improper_per_atom,"atom:improper_atom4"); grow_reset(); diff --git a/src/KOKKOS/bond_class2_kokkos.cpp b/src/KOKKOS/bond_class2_kokkos.cpp index b3c11c9a06..df2f2c1e9b 100644 --- a/src/KOKKOS/bond_class2_kokkos.cpp +++ b/src/KOKKOS/bond_class2_kokkos.cpp @@ -23,7 +23,7 @@ #include "domain.h" #include "comm.h" #include "force.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -47,8 +47,8 @@ template BondClass2Kokkos::~BondClass2Kokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -67,15 +67,15 @@ void BondClass2Kokkos::compute(int eflag_in, int vflag_in) if (eflag_atom) { //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); d_vatom = k_vatom.template view(); //} } diff --git a/src/KOKKOS/bond_fene_kokkos.cpp b/src/KOKKOS/bond_fene_kokkos.cpp index 8a716a98ef..20c2054208 100644 --- a/src/KOKKOS/bond_fene_kokkos.cpp +++ b/src/KOKKOS/bond_fene_kokkos.cpp @@ -23,7 +23,7 @@ #include "domain.h" #include "comm.h" #include "force.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -56,8 +56,8 @@ template BondFENEKokkos::~BondFENEKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -75,13 +75,13 @@ void BondFENEKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"bond:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"bond:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"bond:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"bond:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/bond_harmonic_kokkos.cpp b/src/KOKKOS/bond_harmonic_kokkos.cpp index da45c70d6c..c4e0c3a817 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.cpp +++ b/src/KOKKOS/bond_harmonic_kokkos.cpp @@ -23,7 +23,7 @@ #include "domain.h" #include "comm.h" #include "force.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -48,8 +48,8 @@ template BondHarmonicKokkos::~BondHarmonicKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -68,15 +68,15 @@ void BondHarmonicKokkos::compute(int eflag_in, int vflag_in) if (eflag_atom) { //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); d_vatom = k_vatom.template view(); //} } diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 5534341342..7bb416df93 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -20,7 +20,7 @@ #include "domain.h" #include "atom_masks.h" #include "error.h" -#include "memory.h" +#include "memory_kokkos.h" #include "force.h" #include "pair.h" #include "fix.h" @@ -71,7 +71,7 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) for (int i = 0; i < maxswap; i++) { maxsendlist[i] = BUFMIN; } - memory->create_kokkos(k_sendlist,sendlist,maxswap,BUFMIN,"comm:sendlist"); + memoryKK->create_kokkos(k_sendlist,sendlist,maxswap,BUFMIN,"comm:sendlist"); max_buf_pair = 0; k_buf_send_pair = DAT::tdual_xfloat_1d("comm:k_buf_send_pair",1); @@ -82,11 +82,11 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) CommKokkos::~CommKokkos() { - memory->destroy_kokkos(k_sendlist,sendlist); + memoryKK->destroy_kokkos(k_sendlist,sendlist); sendlist = NULL; - memory->destroy_kokkos(k_buf_send,buf_send); + memoryKK->destroy_kokkos(k_buf_send,buf_send); buf_send = NULL; - memory->destroy_kokkos(k_buf_recv,buf_recv); + memoryKK->destroy_kokkos(k_buf_recv,buf_recv); buf_recv = NULL; } @@ -1067,7 +1067,7 @@ void CommKokkos::grow_list(int iswap, int n) k_sendlist.modify(); } - memory->grow_kokkos(k_sendlist,sendlist,maxswap,size,"comm:sendlist"); + memoryKK->grow_kokkos(k_sendlist,sendlist,maxswap,size,"comm:sendlist"); for(int i=0;i()(i,0); @@ -1095,7 +1095,7 @@ void CommKokkos::grow_swap(int n) k_sendlist.modify(); } - memory->grow_kokkos(k_sendlist,sendlist,maxswap,size,"comm:sendlist"); + memoryKK->grow_kokkos(k_sendlist,sendlist,maxswap,size,"comm:sendlist"); memory->grow(maxsendlist,n,"comm:maxsendlist"); for (int i=0;i DihedralCharmmKokkos::~DihedralCharmmKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -81,8 +81,8 @@ void DihedralCharmmKokkos::compute(int eflag_in, int vflag_in) if (eflag_atom) { //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); d_eatom = k_eatom.template view(); k_eatom_pair = Kokkos::DualView("dihedral:eatom_pair",maxeatom); d_eatom_pair = k_eatom.template view(); @@ -90,8 +90,8 @@ void DihedralCharmmKokkos::compute(int eflag_in, int vflag_in) } if (vflag_atom) { //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"dihedral:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"dihedral:vatom"); d_vatom = k_vatom.template view(); k_vatom_pair = Kokkos::DualView("dihedral:vatom_pair",maxvatom); d_vatom_pair = k_vatom.template view(); diff --git a/src/KOKKOS/dihedral_class2_kokkos.cpp b/src/KOKKOS/dihedral_class2_kokkos.cpp index 89e42c6f83..d32ea4a461 100644 --- a/src/KOKKOS/dihedral_class2_kokkos.cpp +++ b/src/KOKKOS/dihedral_class2_kokkos.cpp @@ -24,7 +24,7 @@ #include "domain.h" #include "force.h" #include "update.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -56,8 +56,8 @@ template DihedralClass2Kokkos::~DihedralClass2Kokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -75,13 +75,13 @@ void DihedralClass2Kokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); d_eatom = k_eatom.template view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"dihedral:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"dihedral:vatom"); d_vatom = k_vatom.template view(); } diff --git a/src/KOKKOS/dihedral_opls_kokkos.cpp b/src/KOKKOS/dihedral_opls_kokkos.cpp index 0ee00ca8db..4349aff48d 100644 --- a/src/KOKKOS/dihedral_opls_kokkos.cpp +++ b/src/KOKKOS/dihedral_opls_kokkos.cpp @@ -24,7 +24,7 @@ #include "domain.h" #include "force.h" #include "update.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -56,8 +56,8 @@ template DihedralOPLSKokkos::~DihedralOPLSKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -75,13 +75,13 @@ void DihedralOPLSKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"dihedral:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"dihedral:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp index 552141ced2..5c106c19f3 100644 --- a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp +++ b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp @@ -21,7 +21,7 @@ #include "atom_kokkos.h" #include "error.h" #include "force.h" -#include "memory.h" +#include "memory_kokkos.h" #include "comm.h" #include #include "modify.h" @@ -517,14 +517,14 @@ void FixEOStableRXKokkos::create_kokkos_tables() { const int tlm1 = tablength-1; - memory->create_kokkos(d_table->lo,h_table->lo,ntables,"Table::lo"); - memory->create_kokkos(d_table->hi,h_table->hi,ntables,"Table::hi"); - memory->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); + memoryKK->create_kokkos(d_table->lo,h_table->lo,ntables,"Table::lo"); + memoryKK->create_kokkos(d_table->hi,h_table->hi,ntables,"Table::hi"); + memoryKK->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); if(tabstyle == LINEAR) { - memory->create_kokkos(d_table->r,h_table->r,ntables,tablength,"Table::r"); - memory->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); - memory->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); + memoryKK->create_kokkos(d_table->r,h_table->r,ntables,tablength,"Table::r"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); + memoryKK->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); } for(int i=0; i < ntables; i++) { diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index fb0f329a91..108c3b692a 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -21,7 +21,7 @@ #include "update.h" #include "respa.h" #include "error.h" -#include "memory.h" +#include "memory_kokkos.h" #include "group.h" #include "random_mars.h" #include "compute.h" @@ -49,9 +49,9 @@ FixLangevinKokkos::FixLangevinKokkos(LAMMPS *lmp, int narg, char **a int ntypes = atomKK->ntypes; // allocate per-type arrays for force prefactors - memory->create_kokkos(k_gfactor1,gfactor1,ntypes+1,"langevin:gfactor1"); - memory->create_kokkos(k_gfactor2,gfactor2,ntypes+1,"langevin:gfactor2"); - memory->create_kokkos(k_ratio,ratio,ntypes+1,"langevin:ratio"); + memoryKK->create_kokkos(k_gfactor1,gfactor1,ntypes+1,"langevin:gfactor1"); + memoryKK->create_kokkos(k_gfactor2,gfactor2,ntypes+1,"langevin:gfactor2"); + memoryKK->create_kokkos(k_ratio,ratio,ntypes+1,"langevin:ratio"); d_gfactor1 = k_gfactor1.template view(); h_gfactor1 = k_gfactor1.template view(); d_gfactor2 = k_gfactor2.template view(); @@ -92,12 +92,12 @@ FixLangevinKokkos::FixLangevinKokkos(LAMMPS *lmp, int narg, char **a template FixLangevinKokkos::~FixLangevinKokkos() { - memory->destroy_kokkos(k_gfactor1,gfactor1); - memory->destroy_kokkos(k_gfactor2,gfactor2); - memory->destroy_kokkos(k_ratio,ratio); - memory->destroy_kokkos(k_flangevin,flangevin); - if(gjfflag) memory->destroy_kokkos(k_franprev,franprev); - memory->destroy_kokkos(k_tforce,tforce); + memoryKK->destroy_kokkos(k_gfactor1,gfactor1); + memoryKK->destroy_kokkos(k_gfactor2,gfactor2); + memoryKK->destroy_kokkos(k_ratio,ratio); + memoryKK->destroy_kokkos(k_flangevin,flangevin); + if(gjfflag) memoryKK->destroy_kokkos(k_franprev,franprev); + memoryKK->destroy_kokkos(k_tforce,tforce); } /* ---------------------------------------------------------------------- */ @@ -121,7 +121,7 @@ void FixLangevinKokkos::init() template void FixLangevinKokkos::grow_arrays(int nmax) { - memory->grow_kokkos(k_franprev,franprev,nmax,3,"langevin:franprev"); + memoryKK->grow_kokkos(k_franprev,franprev,nmax,3,"langevin:franprev"); d_franprev = k_franprev.template view(); h_franprev = k_franprev.template view(); } @@ -167,9 +167,9 @@ void FixLangevinKokkos::post_force(int vflag) // reallocate flangevin if necessary if (tallyflag) { if (nlocal > maxatom1) { - memory->destroy_kokkos(k_flangevin,flangevin); + memoryKK->destroy_kokkos(k_flangevin,flangevin); maxatom1 = atomKK->nmax; - memory->create_kokkos(k_flangevin,flangevin,maxatom1,3,"langevin:flangevin"); + memoryKK->create_kokkos(k_flangevin,flangevin,maxatom1,3,"langevin:flangevin"); d_flangevin = k_flangevin.template view(); h_flangevin = k_flangevin.template view(); } @@ -671,8 +671,8 @@ void FixLangevinKokkos::compute_target() } else { if (atom->nmax > maxatom2) { maxatom2 = atom->nmax; - memory->destroy_kokkos(k_tforce,tforce); - memory->create_kokkos(k_tforce,tforce,maxatom2,"langevin:tforce"); + memoryKK->destroy_kokkos(k_tforce,tforce); + memoryKK->create_kokkos(k_tforce,tforce,maxatom2,"langevin:tforce"); d_tforce = k_tforce.template view(); h_tforce = k_tforce.template view(); } diff --git a/src/KOKKOS/fix_nh_kokkos.cpp b/src/KOKKOS/fix_nh_kokkos.cpp index 7136c776a1..345259e355 100644 --- a/src/KOKKOS/fix_nh_kokkos.cpp +++ b/src/KOKKOS/fix_nh_kokkos.cpp @@ -33,7 +33,7 @@ #include "update.h" #include "respa.h" #include "domain_kokkos.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" #include "atom_kokkos.h" diff --git a/src/KOKKOS/fix_property_atom_kokkos.cpp b/src/KOKKOS/fix_property_atom_kokkos.cpp index cb52988c31..fe2f101e56 100644 --- a/src/KOKKOS/fix_property_atom_kokkos.cpp +++ b/src/KOKKOS/fix_property_atom_kokkos.cpp @@ -16,7 +16,7 @@ #include "fix_property_atom_kokkos.h" #include "atom_kokkos.h" #include "comm.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "update.h" @@ -60,7 +60,7 @@ void FixPropertyAtomKokkos::grow_arrays(int nmax) size_t nbytes = (nmax-nmax_old) * sizeof(int); memset(&atom->ivector[index[m]][nmax_old],0,nbytes); } else if (style[m] == DOUBLE) { - memory->grow_kokkos(atomKK->k_dvector,atomKK->dvector,atomKK->k_dvector.dimension_0(),nmax, + memoryKK->grow_kokkos(atomKK->k_dvector,atomKK->dvector,atomKK->k_dvector.dimension_0(),nmax, "atom:dvector"); //memory->grow(atom->dvector[index[m]],nmax,"atom:dvector"); //size_t nbytes = (nmax-nmax_old) * sizeof(double); diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 5d2f6a0438..91a22361fc 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -35,7 +35,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "pair_reaxc_kokkos.h" diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp index 0d74a49ed3..586daadd55 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp @@ -31,7 +31,7 @@ #include "compute.h" #include "input.h" #include "variable.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "reaxc_list.h" #include "reaxc_types.h" @@ -95,7 +95,7 @@ void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint ntimestep, FILE *fp) MPI_Allreduce(&nlocal,&nlocal_max,1,MPI_INT,MPI_MAX,world); nbuf = 1+(numbonds_max*2+10)*nlocal_max; - memory->create_kokkos(k_buf,buf,nbuf,"reax/c/bonds:buf"); + memoryKK->create_kokkos(k_buf,buf,nbuf,"reax/c/bonds:buf"); // Pass information to buffer if (reaxc->execution_space == Device) @@ -107,7 +107,7 @@ void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint ntimestep, FILE *fp) // Receive information from buffer for output RecvBuffer(buf, nbuf, nbuf_local, nlocal_tot, numbonds_max); - memory->destroy_kokkos(k_buf,buf); + memoryKK->destroy_kokkos(k_buf,buf); } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.cpp b/src/KOKKOS/fix_reaxc_species_kokkos.cpp index f2719f9f0e..a676c7ef27 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_species_kokkos.cpp @@ -33,7 +33,7 @@ #include "compute.h" #include "input.h" #include "variable.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "reaxc_list.h" #include "atom_masks.h" diff --git a/src/KOKKOS/fix_rx_kokkos.cpp b/src/KOKKOS/fix_rx_kokkos.cpp index b1cfd20be2..d7b71a5fdd 100644 --- a/src/KOKKOS/fix_rx_kokkos.cpp +++ b/src/KOKKOS/fix_rx_kokkos.cpp @@ -17,7 +17,7 @@ #include "atom_masks.h" #include "atom_kokkos.h" #include "force.h" -#include "memory.h" +#include "memory_kokkos.h" #include "update.h" #include "respa.h" #include "modify.h" @@ -81,15 +81,15 @@ FixRxKokkos::~FixRxKokkos() if (copymode) return; if (localTempFlag) - memory->destroy_kokkos(k_dpdThetaLocal, dpdThetaLocal); + memoryKK->destroy_kokkos(k_dpdThetaLocal, dpdThetaLocal); - memory->destroy_kokkos(k_sumWeights, sumWeights); - //memory->destroy_kokkos(k_sumWeights); + memoryKK->destroy_kokkos(k_sumWeights, sumWeights); + //memoryKK->destroy_kokkos(k_sumWeights); //delete [] scratchSpace; - memory->destroy_kokkos(d_scratchSpace); + memoryKK->destroy_kokkos(d_scratchSpace); - memory->destroy_kokkos(k_cutsq); + memoryKK->destroy_kokkos(k_cutsq); } /* ---------------------------------------------------------------------- */ @@ -1233,9 +1233,9 @@ void FixRxKokkos::create_kinetics_data(void) { //printf("Inside FixRxKokkos::create_kinetics_data\n"); - memory->create_kokkos( d_kineticsData.Arr, h_kineticsData.Arr, nreactions, "KineticsType::Arr"); - memory->create_kokkos( d_kineticsData.nArr, h_kineticsData.nArr, nreactions, "KineticsType::nArr"); - memory->create_kokkos( d_kineticsData.Ea, h_kineticsData.Ea, nreactions, "KineticsType::Ea"); + memoryKK->create_kokkos( d_kineticsData.Arr, h_kineticsData.Arr, nreactions, "KineticsType::Arr"); + memoryKK->create_kokkos( d_kineticsData.nArr, h_kineticsData.nArr, nreactions, "KineticsType::nArr"); + memoryKK->create_kokkos( d_kineticsData.Ea, h_kineticsData.Ea, nreactions, "KineticsType::Ea"); for (int i = 0; i < nreactions; ++i) { @@ -1251,8 +1251,8 @@ void FixRxKokkos::create_kinetics_data(void) if (useSparseKinetics) { - memory->create_kokkos( d_kineticsData.nu , h_kineticsData.nu , nreactions, sparseKinetics_maxSpecies, "KineticsType::nu"); - memory->create_kokkos( d_kineticsData.nuk, h_kineticsData.nuk, nreactions, sparseKinetics_maxSpecies, "KineticsType::nuk"); + memoryKK->create_kokkos( d_kineticsData.nu , h_kineticsData.nu , nreactions, sparseKinetics_maxSpecies, "KineticsType::nu"); + memoryKK->create_kokkos( d_kineticsData.nuk, h_kineticsData.nuk, nreactions, sparseKinetics_maxSpecies, "KineticsType::nuk"); for (int i = 0; i < nreactions; ++i) for (int k = 0; k < sparseKinetics_maxSpecies; ++k) @@ -1266,8 +1266,8 @@ void FixRxKokkos::create_kinetics_data(void) if (SparseKinetics_enableIntegralReactions) { - memory->create_kokkos( d_kineticsData.inu, h_kineticsData.inu, nreactions, sparseKinetics_maxSpecies, "KineticsType::inu"); - memory->create_kokkos( d_kineticsData.isIntegral, h_kineticsData.isIntegral, nreactions, "KineticsType::isIntegral"); + memoryKK->create_kokkos( d_kineticsData.inu, h_kineticsData.inu, nreactions, sparseKinetics_maxSpecies, "KineticsType::inu"); + memoryKK->create_kokkos( d_kineticsData.isIntegral, h_kineticsData.isIntegral, nreactions, "KineticsType::isIntegral"); for (int i = 0; i < nreactions; ++i) { @@ -1286,9 +1286,9 @@ void FixRxKokkos::create_kinetics_data(void) //{ // Dense option - memory->create_kokkos( d_kineticsData.stoich, h_kineticsData.stoich, nreactions, nspecies, "KineticsType::stoich"); - memory->create_kokkos( d_kineticsData.stoichReactants, h_kineticsData.stoichReactants, nreactions, nspecies, "KineticsType::stoichReactants"); - memory->create_kokkos( d_kineticsData.stoichProducts, h_kineticsData.stoichProducts, nreactions, nspecies, "KineticsType::stoichProducts"); + memoryKK->create_kokkos( d_kineticsData.stoich, h_kineticsData.stoich, nreactions, nspecies, "KineticsType::stoich"); + memoryKK->create_kokkos( d_kineticsData.stoichReactants, h_kineticsData.stoichReactants, nreactions, nspecies, "KineticsType::stoichReactants"); + memoryKK->create_kokkos( d_kineticsData.stoichProducts, h_kineticsData.stoichProducts, nreactions, nspecies, "KineticsType::stoichProducts"); for (int i = 0; i < nreactions; ++i) for (int k = 0; k < nspecies; ++k) @@ -1445,8 +1445,8 @@ void FixRxKokkos::solve_reactions(const int vflag, const bool isPreF const int count = nlocal + (newton_pair ? nghost : 0); if (count > k_dpdThetaLocal.template view().dimension_0()) { - memory->destroy_kokkos (k_dpdThetaLocal, dpdThetaLocal); - memory->create_kokkos (k_dpdThetaLocal, dpdThetaLocal, count, "FixRxKokkos::dpdThetaLocal"); + memoryKK->destroy_kokkos (k_dpdThetaLocal, dpdThetaLocal); + memoryKK->create_kokkos (k_dpdThetaLocal, dpdThetaLocal, count, "FixRxKokkos::dpdThetaLocal"); this->d_dpdThetaLocal = k_dpdThetaLocal.template view(); this->h_dpdThetaLocal = k_dpdThetaLocal.h_view; } @@ -1511,8 +1511,8 @@ void FixRxKokkos::solve_reactions(const int vflag, const bool isPreF if (odeIntegrationFlag == ODE_LAMMPS_RKF45 && diagnosticFrequency == 1) { - memory->create_kokkos (k_diagnosticCounterPerODEnSteps, diagnosticCounterPerODEnSteps, nlocal, "FixRxKokkos::diagnosticCounterPerODEnSteps"); - memory->create_kokkos (k_diagnosticCounterPerODEnFuncs, diagnosticCounterPerODEnFuncs, nlocal, "FixRxKokkos::diagnosticCounterPerODEnFuncs"); + memoryKK->create_kokkos (k_diagnosticCounterPerODEnSteps, diagnosticCounterPerODEnSteps, nlocal, "FixRxKokkos::diagnosticCounterPerODEnSteps"); + memoryKK->create_kokkos (k_diagnosticCounterPerODEnFuncs, diagnosticCounterPerODEnFuncs, nlocal, "FixRxKokkos::diagnosticCounterPerODEnFuncs"); d_diagnosticCounterPerODEnSteps = k_diagnosticCounterPerODEnSteps.template view(); d_diagnosticCounterPerODEnFuncs = k_diagnosticCounterPerODEnFuncs.template view(); @@ -1542,8 +1542,8 @@ void FixRxKokkos::solve_reactions(const int vflag, const bool isPreF //typename ArrayTypes::t_double_1d d_scratchSpace("d_scratchSpace", scratchSpaceSize * nlocal); if (nlocal*scratchSpaceSize > d_scratchSpace.dimension_0()) { - memory->destroy_kokkos (d_scratchSpace); - memory->create_kokkos (d_scratchSpace, nlocal*scratchSpaceSize, "FixRxKokkos::d_scratchSpace"); + memoryKK->destroy_kokkos (d_scratchSpace); + memoryKK->create_kokkos (d_scratchSpace, nlocal*scratchSpaceSize, "FixRxKokkos::d_scratchSpace"); } #if 0 @@ -1811,8 +1811,8 @@ void FixRxKokkos::odeDiagnostics(void) my_min[FuncSum] = std::min( my_min[FuncSum], (double)nFuncs ); } - memory->destroy_kokkos( k_diagnosticCounterPerODEnSteps, diagnosticCounterPerODEnSteps ); - memory->destroy_kokkos( k_diagnosticCounterPerODEnFuncs, diagnosticCounterPerODEnFuncs ); + memoryKK->destroy_kokkos( k_diagnosticCounterPerODEnSteps, diagnosticCounterPerODEnSteps ); + memoryKK->destroy_kokkos( k_diagnosticCounterPerODEnFuncs, diagnosticCounterPerODEnFuncs ); MPI_Reduce (my_sum_sq, sum_sq, 2*numCounters, MPI_DOUBLE, MPI_SUM, 0, world); @@ -2022,10 +2022,10 @@ void FixRxKokkos::computeLocalTemperature() { const int ntypes = atom->ntypes; - //memory->create_kokkos (k_cutsq, h_cutsq, ntypes+1, ntypes+1, "pair:cutsq"); + //memoryKK->create_kokkos (k_cutsq, h_cutsq, ntypes+1, ntypes+1, "pair:cutsq"); if (ntypes+1 > k_cutsq.dimension_0()) { - memory->destroy_kokkos (k_cutsq); - memory->create_kokkos (k_cutsq, ntypes+1, ntypes+1, "FixRxKokkos::k_cutsq"); + memoryKK->destroy_kokkos (k_cutsq); + memoryKK->create_kokkos (k_cutsq, ntypes+1, ntypes+1, "FixRxKokkos::k_cutsq"); d_cutsq = k_cutsq.template view(); } @@ -2043,10 +2043,10 @@ void FixRxKokkos::computeLocalTemperature() // Initialize the local temperature weight array int sumWeightsCt = nlocal + (NEWTON_PAIR ? nghost : 0); - //memory->create_kokkos (k_sumWeights, sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights"); + //memoryKK->create_kokkos (k_sumWeights, sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights"); if (sumWeightsCt > k_sumWeights.template view().dimension_0()) { - memory->destroy_kokkos(k_sumWeights, sumWeights); - memory->create_kokkos (k_sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights"); + memoryKK->destroy_kokkos(k_sumWeights, sumWeights); + memoryKK->create_kokkos (k_sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights"); d_sumWeights = k_sumWeights.template view(); h_sumWeights = k_sumWeights.h_view; } diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index 2ef04ad6ee..7c2c115f52 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -22,7 +22,7 @@ #include "respa.h" #include "input.h" #include "variable.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "force.h" #include "atom_masks.h" @@ -45,7 +45,7 @@ FixSetForceKokkos::FixSetForceKokkos(LAMMPS *lmp, int narg, char **a datamask_modify = EMPTY_MASK; memory->destroy(sforce); - memory->create_kokkos(k_sforce,sforce,maxatom,3,"setforce:sforce"); + memoryKK->create_kokkos(k_sforce,sforce,maxatom,3,"setforce:sforce"); } /* ---------------------------------------------------------------------- */ @@ -55,7 +55,7 @@ FixSetForceKokkos::~FixSetForceKokkos() { if (copymode) return; - memory->destroy_kokkos(k_sforce,sforce); + memoryKK->destroy_kokkos(k_sforce,sforce); sforce = NULL; } @@ -99,8 +99,8 @@ void FixSetForceKokkos::post_force(int vflag) if (varflag == ATOM && atom->nmax > maxatom) { maxatom = atom->nmax; - memory->destroy_kokkos(k_sforce,sforce); - memory->create_kokkos(k_sforce,sforce,maxatom,3,"setforce:sforce"); + memoryKK->destroy_kokkos(k_sforce,sforce); + memoryKK->create_kokkos(k_sforce,sforce,maxatom,3,"setforce:sforce"); } foriginal[0] = foriginal[1] = foriginal[2] = 0.0; diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index 98bbb02714..cc1bd6bede 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -50,7 +50,7 @@ #include "neighbor.h" #include "neigh_list_kokkos.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "domain.h" #include "modify.h" // #include "pair_dpd_fdt.h" diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index 6871ef67ae..d262c51ff6 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -15,7 +15,7 @@ #include "gridcomm_kokkos.h" #include "comm.h" #include "kspace.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" using namespace LAMMPS_NS; @@ -126,8 +126,8 @@ template GridCommKokkos::~GridCommKokkos() { for (int i = 0; i < nswap; i++) { - //memory->destroy_kokkos(swap[i].k_packlist,swap[i].packlist); - //memory->destroy_kokkos(swap[i].k_unpacklist,swap[i].unpacklist); + //memoryKK->destroy_kokkos(swap[i].k_packlist,swap[i].packlist); + //memoryKK->destroy_kokkos(swap[i].k_unpacklist,swap[i].unpacklist); } memory->sfree(swap); diff --git a/src/KOKKOS/improper_class2_kokkos.cpp b/src/KOKKOS/improper_class2_kokkos.cpp index c2cb7dfe2b..d2d465a250 100644 --- a/src/KOKKOS/improper_class2_kokkos.cpp +++ b/src/KOKKOS/improper_class2_kokkos.cpp @@ -26,7 +26,7 @@ #include "force.h" #include "update.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -58,8 +58,8 @@ template ImproperClass2Kokkos::~ImproperClass2Kokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -78,15 +78,15 @@ void ImproperClass2Kokkos::compute(int eflag_in, int vflag_in) if (eflag_atom) { //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); d_vatom = k_vatom.template view(); //} } diff --git a/src/KOKKOS/improper_harmonic_kokkos.cpp b/src/KOKKOS/improper_harmonic_kokkos.cpp index 73e105864f..49dd36ed19 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.cpp +++ b/src/KOKKOS/improper_harmonic_kokkos.cpp @@ -26,7 +26,7 @@ #include "force.h" #include "update.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -58,8 +58,8 @@ template ImproperHarmonicKokkos::~ImproperHarmonicKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -78,15 +78,15 @@ void ImproperHarmonicKokkos::compute(int eflag_in, int vflag_in) if (eflag_atom) { //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); d_eatom = k_eatom.template view(); //} } if (vflag_atom) { //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); d_vatom = k_vatom.template view(); //} } diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 2b02624dce..62f0df4181 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -23,6 +23,7 @@ #include "neighbor_kokkos.h" #include "neigh_list_kokkos.h" #include "error.h" +#include "memory_kokkos.h" using namespace LAMMPS_NS; @@ -33,6 +34,8 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) kokkos_exists = 1; lmp->kokkos = this; + memoryKK = (MemoryKokkos*) memory; + auto_sync = 1; int me = 0; diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 8ade198c40..2454b7c412 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -11,6 +11,19 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +#ifndef LMP_MEMORY_KOKKOS_H +#define LMP_MEMORY_KOKKOS_H + +#ifdef LMP_KOKKOS +#include "kokkos_type.h" +#endif + +namespace LAMMPS_NS { + +class MemoryKokkos : public Memory { + public: + MemoryKokkos::MemoryKokkos(class LAMMPS *lmp) : Memory(lmp) {} + /* ---------------------------------------------------------------------- Kokkos versions of create/grow/destroy multi-dimensional arrays ------------------------------------------------------------------------- */ @@ -279,3 +292,9 @@ void destroy_kokkos(TYPE data, typename TYPE::value_type** &array) sfree(array); array = NULL; } + +}; + +} + +#endif \ No newline at end of file diff --git a/src/KOKKOS/nbin_ssa_kokkos.cpp b/src/KOKKOS/nbin_ssa_kokkos.cpp index ab97cb5848..1a88165856 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.cpp +++ b/src/KOKKOS/nbin_ssa_kokkos.cpp @@ -26,7 +26,7 @@ #include "error.h" #include "atom_masks.h" -// #include "memory.h" +// #include "memory_kokkos.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp index a674e7cec4..3ecc8b5e51 100644 --- a/src/KOKKOS/neigh_bond_kokkos.cpp +++ b/src/KOKKOS/neigh_bond_kokkos.cpp @@ -24,7 +24,7 @@ #include "domain_kokkos.h" #include "output.h" #include "thermo.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "modify.h" #include "fix.h" @@ -80,27 +80,27 @@ void NeighBondKokkos::init_topology_kk() { if (atom->molecular && atom->nbonds && maxbond == 0) { if (nprocs == 1) maxbond = atom->nbonds; else maxbond = static_cast (LB_FACTOR * atom->nbonds / nprocs); - memory->create_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neigh:neighbor->bondlist"); + memoryKK->create_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neigh:neighbor->bondlist"); } if (atom->molecular && atom->nangles && maxangle == 0) { if (nprocs == 1) maxangle = atom->nangles; else maxangle = static_cast (LB_FACTOR * atom->nangles / nprocs); - memory->create_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neigh:neighbor->anglelist"); + memoryKK->create_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neigh:neighbor->anglelist"); } if (atom->molecular && atom->ndihedrals && maxdihedral == 0) { if (nprocs == 1) maxdihedral = atom->ndihedrals; else maxdihedral = static_cast (LB_FACTOR * atom->ndihedrals / nprocs); - memory->create_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neigh:neighbor->dihedrallist"); + memoryKK->create_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neigh:neighbor->dihedrallist"); } if (atom->molecular && atom->nimpropers && maximproper == 0) { if (nprocs == 1) maximproper = atom->nimpropers; else maximproper = static_cast (LB_FACTOR * atom->nimpropers / nprocs); - memory->create_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neigh:neighbor->improperlist"); + memoryKK->create_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neigh:neighbor->improperlist"); } // set flags that determine which topology neighboring routines to use @@ -283,7 +283,7 @@ void NeighBondKokkos::bond_all() k_fail_flag.template sync(); if (h_fail_flag()) { maxbond = neighbor->nbondlist + BONDDELTA; - memory->grow_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neighbor:neighbor->bondlist"); + memoryKK->grow_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neighbor:neighbor->bondlist"); v_bondlist = k_bondlist.view(); } } while (h_fail_flag()); @@ -378,7 +378,7 @@ void NeighBondKokkos::bond_partial() k_fail_flag.template sync(); if (h_fail_flag()) { maxbond = neighbor->nbondlist + BONDDELTA; - memory->grow_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neighbor:neighbor->bondlist"); + memoryKK->grow_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neighbor:neighbor->bondlist"); v_bondlist = k_bondlist.view(); } } while (h_fail_flag()); @@ -500,7 +500,7 @@ void NeighBondKokkos::angle_all() k_fail_flag.template sync(); if (h_fail_flag()) { maxangle = neighbor->nanglelist + BONDDELTA; - memory->grow_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neighbor:neighbor->anglelist"); + memoryKK->grow_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neighbor:neighbor->anglelist"); v_anglelist = k_anglelist.view(); } } while (h_fail_flag()); @@ -602,7 +602,7 @@ void NeighBondKokkos::angle_partial() k_fail_flag.template sync(); if (h_fail_flag()) { maxangle = neighbor->nanglelist + BONDDELTA; - memory->grow_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neighbor:neighbor->anglelist"); + memoryKK->grow_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neighbor:neighbor->anglelist"); v_anglelist = k_anglelist.view(); } } while (h_fail_flag()); @@ -744,7 +744,7 @@ void NeighBondKokkos::dihedral_all() k_fail_flag.template sync(); if (h_fail_flag()) { maxdihedral = neighbor->ndihedrallist + BONDDELTA; - memory->grow_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neighbor:neighbor->dihedrallist"); + memoryKK->grow_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neighbor:neighbor->dihedrallist"); v_dihedrallist = k_dihedrallist.view(); } } while (h_fail_flag()); @@ -851,7 +851,7 @@ void NeighBondKokkos::dihedral_partial() k_fail_flag.template sync(); if (h_fail_flag()) { maxdihedral = neighbor->ndihedrallist + BONDDELTA; - memory->grow_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neighbor:neighbor->dihedrallist"); + memoryKK->grow_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neighbor:neighbor->dihedrallist"); v_dihedrallist = k_dihedrallist.view(); } } while (h_fail_flag()); @@ -1015,7 +1015,7 @@ void NeighBondKokkos::improper_all() k_fail_flag.template sync(); if (h_fail_flag()) { maximproper = neighbor->nimproperlist + BONDDELTA; - memory->grow_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neighbor:neighbor->improperlist"); + memoryKK->grow_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neighbor:neighbor->improperlist"); v_improperlist = k_improperlist.view(); } } while (h_fail_flag()); @@ -1122,7 +1122,7 @@ void NeighBondKokkos::improper_partial() k_fail_flag.template sync(); if (h_fail_flag()) { maximproper = neighbor->nimproperlist + BONDDELTA; - memory->grow_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neighbor:neighbor->improperlist"); + memoryKK->grow_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neighbor:neighbor->improperlist"); v_improperlist = k_improperlist.view(); } } while (h_fail_flag()); diff --git a/src/KOKKOS/neigh_list_kokkos.cpp b/src/KOKKOS/neigh_list_kokkos.cpp index 04454e53cb..98294a802a 100644 --- a/src/KOKKOS/neigh_list_kokkos.cpp +++ b/src/KOKKOS/neigh_list_kokkos.cpp @@ -13,7 +13,7 @@ #include "neigh_list_kokkos.h" #include "atom.h" -#include "memory.h" +#include "memory_kokkos.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index f34b149864..cf1b318201 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -16,7 +16,7 @@ #include "pair.h" #include "fix.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "update.h" #include "atom_masks.h" #include "error.h" @@ -52,24 +52,24 @@ NeighborKokkos::NeighborKokkos(LAMMPS *lmp) : Neighbor(lmp), NeighborKokkos::~NeighborKokkos() { if (!copymode) { - memory->destroy_kokkos(k_cutneighsq,cutneighsq); + memoryKK->destroy_kokkos(k_cutneighsq,cutneighsq); cutneighsq = NULL; - memory->destroy_kokkos(k_ex_type,ex_type); - memory->destroy_kokkos(k_ex1_type,ex1_type); - memory->destroy_kokkos(k_ex2_type,ex2_type); - memory->destroy_kokkos(k_ex1_group,ex1_group); - memory->destroy_kokkos(k_ex2_group,ex2_group); - memory->destroy_kokkos(k_ex_mol_group,ex_mol_group); - memory->destroy_kokkos(k_ex1_bit,ex1_bit); - memory->destroy_kokkos(k_ex2_bit,ex2_bit); - memory->destroy_kokkos(k_ex_mol_bit,ex_mol_bit); - memory->destroy_kokkos(k_ex_mol_intra,ex_mol_intra); + memoryKK->destroy_kokkos(k_ex_type,ex_type); + memoryKK->destroy_kokkos(k_ex1_type,ex1_type); + memoryKK->destroy_kokkos(k_ex2_type,ex2_type); + memoryKK->destroy_kokkos(k_ex1_group,ex1_group); + memoryKK->destroy_kokkos(k_ex2_group,ex2_group); + memoryKK->destroy_kokkos(k_ex_mol_group,ex_mol_group); + memoryKK->destroy_kokkos(k_ex1_bit,ex1_bit); + memoryKK->destroy_kokkos(k_ex2_bit,ex2_bit); + memoryKK->destroy_kokkos(k_ex_mol_bit,ex_mol_bit); + memoryKK->destroy_kokkos(k_ex_mol_intra,ex_mol_intra); - memory->destroy_kokkos(k_bondlist,bondlist); - memory->destroy_kokkos(k_anglelist,anglelist); - memory->destroy_kokkos(k_dihedrallist,dihedrallist); - memory->destroy_kokkos(k_improperlist,improperlist); + memoryKK->destroy_kokkos(k_bondlist,bondlist); + memoryKK->destroy_kokkos(k_anglelist,anglelist); + memoryKK->destroy_kokkos(k_dihedrallist,dihedrallist); + memoryKK->destroy_kokkos(k_improperlist,improperlist); } } @@ -90,7 +90,7 @@ void NeighborKokkos::init() void NeighborKokkos::init_cutneighsq_kokkos(int n) { - memory->create_kokkos(k_cutneighsq,cutneighsq,n+1,n+1,"neigh:cutneighsq"); + memoryKK->create_kokkos(k_cutneighsq,cutneighsq,n+1,n+1,"neigh:cutneighsq"); k_cutneighsq.modify(); } @@ -112,7 +112,7 @@ void NeighborKokkos::create_kokkos_list(int i) void NeighborKokkos::init_ex_type_kokkos(int n) { - memory->create_kokkos(k_ex_type,ex_type,n+1,n+1,"neigh:ex_type"); + memoryKK->create_kokkos(k_ex_type,ex_type,n+1,n+1,"neigh:ex_type"); k_ex_type.modify(); } @@ -120,9 +120,9 @@ void NeighborKokkos::init_ex_type_kokkos(int n) void NeighborKokkos::init_ex_bit_kokkos() { - memory->create_kokkos(k_ex1_bit, ex1_bit, nex_group, "neigh:ex1_bit"); + memoryKK->create_kokkos(k_ex1_bit, ex1_bit, nex_group, "neigh:ex1_bit"); k_ex1_bit.modify(); - memory->create_kokkos(k_ex2_bit, ex2_bit, nex_group, "neigh:ex2_bit"); + memoryKK->create_kokkos(k_ex2_bit, ex2_bit, nex_group, "neigh:ex2_bit"); k_ex2_bit.modify(); } @@ -130,7 +130,7 @@ void NeighborKokkos::init_ex_bit_kokkos() void NeighborKokkos::init_ex_mol_bit_kokkos() { - memory->create_kokkos(k_ex_mol_bit, ex_mol_bit, nex_mol, "neigh:ex_mol_bit"); + memoryKK->create_kokkos(k_ex_mol_bit, ex_mol_bit, nex_mol, "neigh:ex_mol_bit"); k_ex_mol_bit.modify(); } @@ -138,7 +138,7 @@ void NeighborKokkos::init_ex_mol_bit_kokkos() void NeighborKokkos::grow_ex_mol_intra_kokkos() { - memory->grow_kokkos(k_ex_mol_intra, ex_mol_intra, maxex_mol, "neigh:ex_mol_intra"); + memoryKK->grow_kokkos(k_ex_mol_intra, ex_mol_intra, maxex_mol, "neigh:ex_mol_intra"); k_ex_mol_intra.modify(); } @@ -335,29 +335,29 @@ void NeighborKokkos::operator()(TagNeighborXhold, const int &i) cons /* ---------------------------------------------------------------------- */ void NeighborKokkos::modify_ex_type_grow_kokkos(){ - memory->grow_kokkos(k_ex1_type,ex1_type,maxex_type,"neigh:ex1_type"); + memoryKK->grow_kokkos(k_ex1_type,ex1_type,maxex_type,"neigh:ex1_type"); k_ex1_type.modify(); - memory->grow_kokkos(k_ex2_type,ex2_type,maxex_type,"neigh:ex2_type"); + memoryKK->grow_kokkos(k_ex2_type,ex2_type,maxex_type,"neigh:ex2_type"); k_ex2_type.modify(); } /* ---------------------------------------------------------------------- */ void NeighborKokkos::modify_ex_group_grow_kokkos(){ - memory->grow_kokkos(k_ex1_group,ex1_group,maxex_group,"neigh:ex1_group"); + memoryKK->grow_kokkos(k_ex1_group,ex1_group,maxex_group,"neigh:ex1_group"); k_ex1_group.modify(); - memory->grow_kokkos(k_ex2_group,ex2_group,maxex_group,"neigh:ex2_group"); + memoryKK->grow_kokkos(k_ex2_group,ex2_group,maxex_group,"neigh:ex2_group"); k_ex2_group.modify(); } /* ---------------------------------------------------------------------- */ void NeighborKokkos::modify_mol_group_grow_kokkos(){ - memory->grow_kokkos(k_ex_mol_group,ex_mol_group,maxex_mol,"neigh:ex_mol_group"); + memoryKK->grow_kokkos(k_ex_mol_group,ex_mol_group,maxex_mol,"neigh:ex_mol_group"); k_ex_mol_group.modify(); } /* ---------------------------------------------------------------------- */ void NeighborKokkos::modify_mol_intra_grow_kokkos(){ - memory->grow_kokkos(k_ex_mol_intra,ex_mol_intra,maxex_mol,"neigh:ex_mol_intra"); + memoryKK->grow_kokkos(k_ex_mol_intra,ex_mol_intra,maxex_mol,"neigh:ex_mol_intra"); k_ex_mol_intra.modify(); } diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index 0da8a0a3d6..ba3eda64dd 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -65,8 +65,8 @@ PairBuckCoulCutKokkos::~PairBuckCoulCutKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_ljsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); @@ -98,13 +98,13 @@ void PairBuckCoulCutKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -252,13 +252,13 @@ void PairBuckCoulCutKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); memory->destroy(cut_coulsq); - memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairBuckCoulCut::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp index 3a5cbd868f..19af349a63 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -73,8 +73,8 @@ template PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_ljsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); @@ -117,13 +117,13 @@ void PairBuckCoulLongKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -308,14 +308,14 @@ void PairBuckCoulLongKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairBuckCoulLong::params",n+1,n+1); diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index e7640471d5..fcf14533dc 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -61,8 +61,8 @@ template PairBuckKokkos::~PairBuckKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); eatom = NULL; @@ -87,13 +87,13 @@ void PairBuckKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -194,7 +194,7 @@ void PairBuckKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairBuck::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_coul_cut_kokkos.cpp b/src/KOKKOS/pair_coul_cut_kokkos.cpp index 8edf093e2e..e20e243c09 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_coul_cut_kokkos.cpp @@ -27,7 +27,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -55,7 +55,7 @@ template PairCoulCutKokkos::~PairCoulCutKokkos() { if (allocated) - memory->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); } /* ---------------------------------------------------------------------- */ @@ -86,13 +86,13 @@ void PairCoulCutKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -190,7 +190,7 @@ void PairCoulCutKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_cut_ljsq = typename ArrayTypes::tdual_ffloat_2d("pair:cut_ljsq",n+1,n+1); diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index c331ab8da8..4cac18cacf 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -62,7 +62,7 @@ template PairCoulDebyeKokkos::~PairCoulDebyeKokkos() { if (!copymode) { - memory->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); } } @@ -93,13 +93,13 @@ void PairCoulDebyeKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -218,7 +218,7 @@ void PairCoulDebyeKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairCoulDebye::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_coul_dsf_kokkos.cpp index e6f5407f2d..f77e63bbf0 100644 --- a/src/KOKKOS/pair_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_coul_dsf_kokkos.cpp @@ -27,7 +27,7 @@ #include "neighbor.h" #include "neigh_list_kokkos.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "update.h" #include "integrate.h" #include "respa.h" @@ -65,8 +65,8 @@ template PairCoulDSFKokkos::~PairCoulDSFKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -86,13 +86,13 @@ void PairCoulDSFKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_coul_long_kokkos.cpp b/src/KOKKOS/pair_coul_long_kokkos.cpp index 721e140e33..f2ade3f367 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_coul_long_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -72,8 +72,8 @@ template PairCoulLongKokkos::~PairCoulLongKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); @@ -110,13 +110,13 @@ void PairCoulLongKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -272,10 +272,10 @@ void PairCoulLongKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairCoulLong::params",n+1,n+1); diff --git a/src/KOKKOS/pair_coul_wolf_kokkos.cpp b/src/KOKKOS/pair_coul_wolf_kokkos.cpp index 75177e2d81..0f3e9b9429 100644 --- a/src/KOKKOS/pair_coul_wolf_kokkos.cpp +++ b/src/KOKKOS/pair_coul_wolf_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -60,8 +60,8 @@ template PairCoulWolfKokkos::~PairCoulWolfKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -81,13 +81,13 @@ void PairCoulWolfKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp index c559ab412f..0fae6ffef9 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp @@ -28,7 +28,7 @@ #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "modify.h" #include "pair_dpd_fdt_energy_kokkos.h" #include "error.h" @@ -62,15 +62,15 @@ PairDPDfdtEnergyKokkos::~PairDPDfdtEnergyKokkos() { if (copymode) return; - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); if (allocated) { - memory->destroy_kokkos(k_duCond,duCond); - memory->destroy_kokkos(k_duMech,duMech); + memoryKK->destroy_kokkos(k_duCond,duCond); + memoryKK->destroy_kokkos(k_duMech,duMech); } - memory->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cutsq,cutsq); #ifdef DPD_USE_RAN_MARS rand_pool.destroy(); @@ -167,13 +167,13 @@ void PairDPDfdtEnergyKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.template view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.template view(); } @@ -274,11 +274,11 @@ void PairDPDfdtEnergyKokkos::compute(int eflag_in, int vflag_in) // Allocate memory for duCond and duMech if (allocated) { - memory->destroy_kokkos(k_duCond,duCond); - memory->destroy_kokkos(k_duMech,duMech); + memoryKK->destroy_kokkos(k_duCond,duCond); + memoryKK->destroy_kokkos(k_duMech,duMech); } - memory->create_kokkos(k_duCond,duCond,nlocal+nghost,"pair:duCond"); - memory->create_kokkos(k_duMech,duMech,nlocal+nghost,"pair:duMech"); + memoryKK->create_kokkos(k_duCond,duCond,nlocal+nghost,"pair:duCond"); + memoryKK->create_kokkos(k_duMech,duMech,nlocal+nghost,"pair:duMech"); d_duCond = k_duCond.view(); d_duMech = k_duMech.view(); h_duCond = k_duCond.h_view; @@ -641,7 +641,7 @@ void PairDPDfdtEnergyKokkos::allocate() int nghost = atom->nghost; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairDPDfdtEnergy::params",n+1,n+1); @@ -650,8 +650,8 @@ void PairDPDfdtEnergyKokkos::allocate() if (!splitFDT_flag) { memory->destroy(duCond); memory->destroy(duMech); - memory->create_kokkos(k_duCond,duCond,nlocal+nghost+1,"pair:duCond"); - memory->create_kokkos(k_duMech,duMech,nlocal+nghost+1,"pair:duMech"); + memoryKK->create_kokkos(k_duCond,duCond,nlocal+nghost+1,"pair:duCond"); + memoryKK->create_kokkos(k_duMech,duMech,nlocal+nghost+1,"pair:duMech"); d_duCond = k_duCond.view(); d_duMech = k_duMech.view(); h_duCond = k_duCond.h_view; diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index aa68d0a054..f263cbb6d9 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -28,7 +28,7 @@ #include "neighbor.h" #include "neigh_list_kokkos.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -59,8 +59,8 @@ template PairEAMAlloyKokkos::~PairEAMAlloyKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -80,13 +80,13 @@ void PairEAMAlloyKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index a982f94ec4..05ec1a644b 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -28,7 +28,7 @@ #include "neighbor.h" #include "neigh_list_kokkos.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -59,8 +59,8 @@ template PairEAMFSKokkos::~PairEAMFSKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -80,13 +80,13 @@ void PairEAMFSKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_eam_kokkos.cpp b/src/KOKKOS/pair_eam_kokkos.cpp index 8ac92a1766..0aa43b26b2 100644 --- a/src/KOKKOS/pair_eam_kokkos.cpp +++ b/src/KOKKOS/pair_eam_kokkos.cpp @@ -28,7 +28,7 @@ #include "neighbor.h" #include "neigh_list_kokkos.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -54,8 +54,8 @@ template PairEAMKokkos::~PairEAMKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -75,13 +75,13 @@ void PairEAMKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index 8d65be23af..6eb15f9b94 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -26,7 +26,7 @@ #include "neigh_list.h" #include "math_const.h" #include "math_special_kokkos.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "modify.h" #include "fix.h" @@ -89,18 +89,18 @@ PairExp6rxKokkos::~PairExp6rxKokkos() { if (copymode) return; - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); - memory->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cutsq,cutsq); for (int i=0; i < nparams; ++i) { delete[] params[i].name; delete[] params[i].potential; } - memory->destroy_kokkos(k_params,params); + memoryKK->destroy_kokkos(k_params,params); - memory->destroy_kokkos(k_mol2param,mol2param); + memoryKK->destroy_kokkos(k_mol2param,mol2param); } /* ---------------------------------------------------------------------- */ @@ -151,13 +151,13 @@ void PairExp6rxKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.template view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.template view(); } @@ -1660,7 +1660,7 @@ void PairExp6rxKokkos::allocate() for (int j = i; j <= ntypes; j++) setflag[i][j] = 0; - memory->create_kokkos(k_cutsq,cutsq,ntypes+1,ntypes+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,ntypes+1,ntypes+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_cutsq.template modify(); @@ -1697,7 +1697,7 @@ void PairExp6rxKokkos::read_file(char *file) int params_per_line = 5; char **words = new char*[params_per_line+1]; - memory->destroy_kokkos(k_params,params); + memoryKK->destroy_kokkos(k_params,params); params = NULL; nparams = maxparam = 0; @@ -1777,7 +1777,7 @@ void PairExp6rxKokkos::read_file(char *file) if (nparams == maxparam) { k_params.template modify(); maxparam += DELTA; - memory->grow_kokkos(k_params,params,maxparam, + memoryKK->grow_kokkos(k_params,params,maxparam, "pair:params"); } @@ -1816,8 +1816,8 @@ void PairExp6rxKokkos::setup() // set mol2param for all combinations // must be a single exact match to lines read from file - memory->destroy_kokkos(k_mol2param,mol2param); - memory->create_kokkos(k_mol2param,mol2param,nspecies,"pair:mol2param"); + memoryKK->destroy_kokkos(k_mol2param,mol2param); + memoryKK->create_kokkos(k_mol2param,mol2param,nspecies,"pair:mol2param"); for (i = 0; i < nspecies; i++) { n = -1; diff --git a/src/KOKKOS/pair_hybrid_kokkos.cpp b/src/KOKKOS/pair_hybrid_kokkos.cpp index 337b56c6ce..48bdf3081d 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_kokkos.cpp @@ -23,7 +23,7 @@ #include "neigh_request.h" #include "update.h" #include "comm.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "respa.h" #include "atom_masks.h" diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp index e7cf7ba42a..7d395cb3b4 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -73,8 +73,8 @@ template PairLJCharmmCoulCharmmImplicitKokkos::~PairLJCharmmCoulCharmmImplicitKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_ljsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); @@ -118,13 +118,13 @@ void PairLJCharmmCoulCharmmImplicitKokkos::compute(int eflag_in, int // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -315,14 +315,14 @@ void PairLJCharmmCoulCharmmImplicitKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); //memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJCharmmCoulCharmmImplicit::params",n+1,n+1); diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp index a456d6e276..2663d71a1f 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -73,8 +73,8 @@ template PairLJCharmmCoulCharmmKokkos::~PairLJCharmmCoulCharmmKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_ljsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); @@ -118,13 +118,13 @@ void PairLJCharmmCoulCharmmKokkos::compute(int eflag_in, int vflag_i // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -316,14 +316,14 @@ void PairLJCharmmCoulCharmmKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); //memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJCharmmCoulCharmm::params",n+1,n+1); diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp index dffbbb638f..81271c7d8a 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -73,8 +73,8 @@ template PairLJCharmmCoulLongKokkos::~PairLJCharmmCoulLongKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_ljsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); @@ -118,13 +118,13 @@ void PairLJCharmmCoulLongKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -336,14 +336,14 @@ void PairLJCharmmCoulLongKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); //memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJCharmmCoulLong::params",n+1,n+1); diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index 0081aca4f1..3f355b1b16 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -27,7 +27,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -60,9 +60,9 @@ template PairLJClass2CoulCutKokkos::~PairLJClass2CoulCutKokkos() { if (!copymode) { - memory->destroy_kokkos(k_cutsq, cutsq); - memory->destroy_kokkos(k_cut_ljsq, cut_ljsq); - memory->destroy_kokkos(k_cut_coulsq, cut_coulsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); + memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); } } @@ -95,13 +95,13 @@ void PairLJClass2CoulCutKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -255,13 +255,13 @@ void PairLJClass2CoulCutKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); memory->destroy(cut_coulsq); - memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJClass2CoulCut::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp index b5dc358feb..47976ec610 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp @@ -27,7 +27,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -69,8 +69,8 @@ template PairLJClass2CoulLongKokkos::~PairLJClass2CoulLongKokkos() { if (!copymode){ - memory->destroy_kokkos(k_cutsq, cutsq); - memory->destroy_kokkos(k_cut_ljsq, cut_ljsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); } } @@ -103,13 +103,13 @@ void PairLJClass2CoulLongKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -307,13 +307,13 @@ void PairLJClass2CoulLongKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJClass2CoulLong::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index 34cc15279b..5beb520c00 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -95,13 +95,13 @@ void PairLJClass2Kokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -200,7 +200,7 @@ void PairLJClass2Kokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairLJClass2::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index c3fda01ce6..86e37bea77 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -27,7 +27,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -60,9 +60,9 @@ template PairLJCutCoulCutKokkos::~PairLJCutCoulCutKokkos() { if (allocated){ - memory->destroy_kokkos(k_cutsq, cutsq); - memory->destroy_kokkos(k_cut_ljsq, cut_ljsq); - memory->destroy_kokkos(k_cut_coulsq, cut_coulsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); + memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); } } @@ -95,13 +95,13 @@ void PairLJCutCoulCutKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -247,13 +247,13 @@ void PairLJCutCoulCutKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); memory->destroy(cut_coulsq); - memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJCutCoulCut::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index b7a71cb99a..76e488c686 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -64,9 +64,9 @@ template PairLJCutCoulDebyeKokkos::~PairLJCutCoulDebyeKokkos() { if (!copymode) { - memory->destroy_kokkos(k_cutsq, cutsq); - memory->destroy_kokkos(k_cut_ljsq, cut_ljsq); - memory->destroy_kokkos(k_cut_coulsq, cut_coulsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); + memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); } } @@ -99,13 +99,13 @@ void PairLJCutCoulDebyeKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -261,13 +261,13 @@ void PairLJCutCoulDebyeKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); memory->destroy(cut_coulsq); - memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJCutCoulDebye::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index 9df5963676..0da5e7f5f5 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -72,9 +72,9 @@ template PairLJCutCoulDSFKokkos::~PairLJCutCoulDSFKokkos() { if (!copymode) { - memory->destroy_kokkos(k_cutsq, cutsq); - memory->destroy_kokkos(k_cut_ljsq, cut_ljsq); - //memory->destroy_kokkos(k_cut_coulsq, cut_coulsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); + //memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); } } @@ -107,13 +107,13 @@ void PairLJCutCoulDSFKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -279,13 +279,13 @@ void PairLJCutCoulDSFKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); //memory->destroy(cut_coulsq); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJCutCoulDSF::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp index 9bd79c7341..77a604534e 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp @@ -27,7 +27,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -68,13 +68,13 @@ PairLJCutCoulLongKokkos::PairLJCutCoulLongKokkos(LAMMPS *lmp):PairLJ template PairLJCutCoulLongKokkos::~PairLJCutCoulLongKokkos() { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); eatom = NULL; vatom = NULL; if (allocated){ - memory->destroy_kokkos(k_cutsq, cutsq); - memory->destroy_kokkos(k_cut_ljsq, cut_ljsq); + memoryKK->destroy_kokkos(k_cutsq, cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); } } @@ -108,13 +108,13 @@ void PairLJCutCoulLongKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -304,13 +304,13 @@ void PairLJCutCoulLongKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJCutCoulLong::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index c90d5ad11c..2a228fb168 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -27,7 +27,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -57,8 +57,8 @@ template PairLJCutKokkos::~PairLJCutKokkos() { if (allocated) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); eatom = NULL; @@ -95,13 +95,13 @@ void PairLJCutKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -195,7 +195,7 @@ void PairLJCutKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairLJCut::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index 95ec252ad5..aca7202b78 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -94,13 +94,13 @@ void PairLJExpandKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -202,7 +202,7 @@ void PairLJExpandKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairLJExpand::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp index 4b21b08eb3..bf269288e0 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -64,8 +64,8 @@ template PairLJGromacsCoulGromacsKokkos::~PairLJGromacsCoulGromacsKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_ljsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); @@ -109,13 +109,13 @@ void PairLJGromacsCoulGromacsKokkos::compute(int eflag_in, int vflag // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -299,14 +299,14 @@ void PairLJGromacsCoulGromacsKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); //memory->destroy(cut_ljsq); - memory->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); + memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); + memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); k_params = Kokkos::DualView("PairLJGromacsCoulGromacs::params",n+1,n+1); diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp index 73a17d7b22..f24ff718c1 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -64,8 +64,8 @@ template PairLJGromacsKokkos::~PairLJGromacsKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); k_cut_inner_sq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); @@ -106,13 +106,13 @@ void PairLJGromacsKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -240,15 +240,15 @@ void PairLJGromacsKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); memory->destroy(cut_inner); - memory->create_kokkos(k_cut_inner,cut_inner,n+1,n+1,"pair:cut_inner"); + memoryKK->create_kokkos(k_cut_inner,cut_inner,n+1,n+1,"pair:cut_inner"); d_cut_inner = k_cut_inner.template view(); memory->destroy(cut_inner_sq); - memory->create_kokkos(k_cut_inner_sq,cut_inner_sq,n+1,n+1,"pair:cut_inner_sq"); + memoryKK->create_kokkos(k_cut_inner_sq,cut_inner_sq,n+1,n+1,"pair:cut_inner_sq"); d_cut_inner_sq = k_cut_inner_sq.template view(); k_params = Kokkos::DualView("PairLJGromacs::params",n+1,n+1); diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index 2063f62b20..aa579d5dc1 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -27,7 +27,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -94,13 +94,13 @@ void PairLJSDKKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -231,7 +231,7 @@ void PairLJSDKKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairLJSDK::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index 08a9b82640..5768d7e42c 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -61,8 +61,8 @@ template PairMorseKokkos::~PairMorseKokkos() { if (allocated) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); eatom = NULL; @@ -99,13 +99,13 @@ void PairMorseKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -209,7 +209,7 @@ void PairMorseKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView("PairMorse::params",n+1,n+1); params = k_params.template view(); diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index d9a4f1ab83..eaf28304ba 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -31,7 +31,7 @@ #include "force.h" #include "comm.h" #include "neigh_list.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "citeme.h" #include "modify.h" @@ -80,10 +80,10 @@ PairMultiLucyRXKokkos::~PairMultiLucyRXKokkos() { if (copymode) return; - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); - memory->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cutsq,cutsq); delete h_table; delete d_table; @@ -153,13 +153,13 @@ void PairMultiLucyRXKokkos::compute_style(int eflag_in, int vflag_in // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.template view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.template view(); } @@ -864,20 +864,20 @@ void PairMultiLucyRXKokkos::create_kokkos_tables() { const int tlm1 = tablength-1; - memory->create_kokkos(d_table->innersq,h_table->innersq,ntables,"Table::innersq"); - memory->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); + memoryKK->create_kokkos(d_table->innersq,h_table->innersq,ntables,"Table::innersq"); + memoryKK->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); if(tabstyle == LOOKUP) { - memory->create_kokkos(d_table->e,h_table->e,ntables,tlm1,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tlm1,"Table::f"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tlm1,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tlm1,"Table::f"); } if(tabstyle == LINEAR) { - memory->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); - memory->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); - memory->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); - memory->create_kokkos(d_table->df,h_table->df,ntables,tlm1,"Table::df"); + memoryKK->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); + memoryKK->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); + memoryKK->create_kokkos(d_table->df,h_table->df,ntables,tlm1,"Table::df"); } for(int i=0; i < ntables; i++) { @@ -931,11 +931,11 @@ void PairMultiLucyRXKokkos::allocate() memory->create(setflag,nt,nt,"pair:setflag"); - memory->create_kokkos(k_cutsq,cutsq,nt,nt,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,nt,nt,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_cutsq.template modify(); - memory->create_kokkos(d_table->tabindex,h_table->tabindex,tabindex,nt,nt,"pair:tabindex"); + memoryKK->create_kokkos(d_table->tabindex,h_table->tabindex,tabindex,nt,nt,"pair:tabindex"); d_table_const.tabindex = d_table->tabindex; memset(&setflag[0][0],0,nt*nt*sizeof(int)); diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index d5f83f4537..1407c464e3 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -32,7 +32,7 @@ #include "respa.h" #include "math_const.h" #include "math_special.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" #include "reaxc_defs.h" @@ -81,12 +81,12 @@ PairReaxCKokkos::~PairReaxCKokkos() { if (copymode) return; - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); - memory->destroy_kokkos(k_tmpid,tmpid); + memoryKK->destroy_kokkos(k_tmpid,tmpid); tmpid = NULL; - memory->destroy_kokkos(k_tmpbo,tmpbo); + memoryKK->destroy_kokkos(k_tmpbo,tmpbo); tmpbo = NULL; } @@ -1339,10 +1339,10 @@ void PairReaxCKokkos::allocate_array() // FixReaxCSpecies if (fixspecies_flag) { - memory->destroy_kokkos(k_tmpid,tmpid); - memory->destroy_kokkos(k_tmpbo,tmpbo); - memory->create_kokkos(k_tmpid,tmpid,nmax,MAXSPECBOND,"pair:tmpid"); - memory->create_kokkos(k_tmpbo,tmpbo,nmax,MAXSPECBOND,"pair:tmpbo"); + memoryKK->destroy_kokkos(k_tmpid,tmpid); + memoryKK->destroy_kokkos(k_tmpbo,tmpbo); + memoryKK->create_kokkos(k_tmpid,tmpid,nmax,MAXSPECBOND,"pair:tmpid"); + memoryKK->create_kokkos(k_tmpbo,tmpbo,nmax,MAXSPECBOND,"pair:tmpbo"); } // FixReaxCBonds @@ -3905,14 +3905,14 @@ void PairReaxCKokkos::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatom) { maxeatom = atom->nmax; - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); v_eatom = k_eatom.view(); } if (vflag_atom && atom->nmax > maxvatom) { maxvatom = atom->nmax; - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); v_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 3440f7c639..63b4c19ae1 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -27,10 +27,10 @@ #include "neigh_request.h" #include "force.h" #include "comm.h" -#include "memory.h" +#include "memory_kokkos.h" #include "neighbor.h" #include "neigh_list_kokkos.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" #include "math_const.h" @@ -63,8 +63,8 @@ template PairSWKokkos::~PairSWKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); eatom = NULL; vatom = NULL; } @@ -86,13 +86,13 @@ void PairSWKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index 7f763baae6..b3e80d1f66 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -27,7 +27,7 @@ #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -92,13 +92,13 @@ void PairTableKokkos::compute_style(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -265,41 +265,41 @@ void PairTableKokkos::create_kokkos_tables() { const int tlm1 = tablength-1; - memory->create_kokkos(d_table->nshiftbits,h_table->nshiftbits,ntables,"Table::nshiftbits"); - memory->create_kokkos(d_table->nmask,h_table->nmask,ntables,"Table::nmask"); - memory->create_kokkos(d_table->innersq,h_table->innersq,ntables,"Table::innersq"); - memory->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); - memory->create_kokkos(d_table->deltasq6,h_table->deltasq6,ntables,"Table::deltasq6"); + memoryKK->create_kokkos(d_table->nshiftbits,h_table->nshiftbits,ntables,"Table::nshiftbits"); + memoryKK->create_kokkos(d_table->nmask,h_table->nmask,ntables,"Table::nmask"); + memoryKK->create_kokkos(d_table->innersq,h_table->innersq,ntables,"Table::innersq"); + memoryKK->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); + memoryKK->create_kokkos(d_table->deltasq6,h_table->deltasq6,ntables,"Table::deltasq6"); if(tabstyle == LOOKUP) { - memory->create_kokkos(d_table->e,h_table->e,ntables,tlm1,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tlm1,"Table::f"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tlm1,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tlm1,"Table::f"); } if(tabstyle == LINEAR) { - memory->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); - memory->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); - memory->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); - memory->create_kokkos(d_table->df,h_table->df,ntables,tlm1,"Table::df"); + memoryKK->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); + memoryKK->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); + memoryKK->create_kokkos(d_table->df,h_table->df,ntables,tlm1,"Table::df"); } if(tabstyle == SPLINE) { - memory->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); - memory->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); - memory->create_kokkos(d_table->e2,h_table->e2,ntables,tablength,"Table::e2"); - memory->create_kokkos(d_table->f2,h_table->f2,ntables,tablength,"Table::f2"); + memoryKK->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); + memoryKK->create_kokkos(d_table->e2,h_table->e2,ntables,tablength,"Table::e2"); + memoryKK->create_kokkos(d_table->f2,h_table->f2,ntables,tablength,"Table::f2"); } if(tabstyle == BITMAP) { int ntable = 1 << tablength; - memory->create_kokkos(d_table->rsq,h_table->rsq,ntables,ntable,"Table::rsq"); - memory->create_kokkos(d_table->e,h_table->e,ntables,ntable,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,ntable,"Table::f"); - memory->create_kokkos(d_table->de,h_table->de,ntables,ntable,"Table::de"); - memory->create_kokkos(d_table->df,h_table->df,ntables,ntable,"Table::df"); - memory->create_kokkos(d_table->drsq,h_table->drsq,ntables,ntable,"Table::drsq"); + memoryKK->create_kokkos(d_table->rsq,h_table->rsq,ntables,ntable,"Table::rsq"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,ntable,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,ntable,"Table::f"); + memoryKK->create_kokkos(d_table->de,h_table->de,ntables,ntable,"Table::de"); + memoryKK->create_kokkos(d_table->df,h_table->df,ntables,ntable,"Table::df"); + memoryKK->create_kokkos(d_table->drsq,h_table->drsq,ntables,ntable,"Table::drsq"); } @@ -410,8 +410,8 @@ void PairTableKokkos::allocate() const int nt = atom->ntypes + 1; memory->create(setflag,nt,nt,"pair:setflag"); - memory->create_kokkos(d_table->cutsq,h_table->cutsq,cutsq,nt,nt,"pair:cutsq"); - memory->create_kokkos(d_table->tabindex,h_table->tabindex,tabindex,nt,nt,"pair:tabindex"); + memoryKK->create_kokkos(d_table->cutsq,h_table->cutsq,cutsq,nt,nt,"pair:cutsq"); + memoryKK->create_kokkos(d_table->tabindex,h_table->tabindex,tabindex,nt,nt,"pair:tabindex"); d_table_const.cutsq = d_table->cutsq; d_table_const.tabindex = d_table->tabindex; diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 2f5a670537..6b30d1439c 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -27,7 +27,7 @@ #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" #include "fix.h" @@ -162,12 +162,12 @@ PairTableRXKokkos::~PairTableRXKokkos() delete [] site1; delete [] site2; - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); if (allocated) { - memory->destroy_kokkos(d_table->cutsq, cutsq); - memory->destroy_kokkos(d_table->tabindex, tabindex); + memoryKK->destroy_kokkos(d_table->cutsq, cutsq); + memoryKK->destroy_kokkos(d_table->tabindex, tabindex); } delete h_table; @@ -621,13 +621,13 @@ void PairTableRXKokkos::compute_style(int eflag_in, int vflag_in) else evflag = vflag_fdotr = 0; if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.template view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.template view(); } @@ -798,41 +798,41 @@ void PairTableRXKokkos::create_kokkos_tables() { const int tlm1 = tablength-1; - memory->create_kokkos(d_table->nshiftbits,h_table->nshiftbits,ntables,"Table::nshiftbits"); - memory->create_kokkos(d_table->nmask,h_table->nmask,ntables,"Table::nmask"); - memory->create_kokkos(d_table->innersq,h_table->innersq,ntables,"Table::innersq"); - memory->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); - memory->create_kokkos(d_table->deltasq6,h_table->deltasq6,ntables,"Table::deltasq6"); + memoryKK->create_kokkos(d_table->nshiftbits,h_table->nshiftbits,ntables,"Table::nshiftbits"); + memoryKK->create_kokkos(d_table->nmask,h_table->nmask,ntables,"Table::nmask"); + memoryKK->create_kokkos(d_table->innersq,h_table->innersq,ntables,"Table::innersq"); + memoryKK->create_kokkos(d_table->invdelta,h_table->invdelta,ntables,"Table::invdelta"); + memoryKK->create_kokkos(d_table->deltasq6,h_table->deltasq6,ntables,"Table::deltasq6"); if(tabstyle == LOOKUP) { - memory->create_kokkos(d_table->e,h_table->e,ntables,tlm1,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tlm1,"Table::f"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tlm1,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tlm1,"Table::f"); } if(tabstyle == LINEAR) { - memory->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); - memory->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); - memory->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); - memory->create_kokkos(d_table->df,h_table->df,ntables,tlm1,"Table::df"); + memoryKK->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); + memoryKK->create_kokkos(d_table->de,h_table->de,ntables,tlm1,"Table::de"); + memoryKK->create_kokkos(d_table->df,h_table->df,ntables,tlm1,"Table::df"); } if(tabstyle == SPLINE) { - memory->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); - memory->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); - memory->create_kokkos(d_table->e2,h_table->e2,ntables,tablength,"Table::e2"); - memory->create_kokkos(d_table->f2,h_table->f2,ntables,tablength,"Table::f2"); + memoryKK->create_kokkos(d_table->rsq,h_table->rsq,ntables,tablength,"Table::rsq"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,tablength,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,tablength,"Table::f"); + memoryKK->create_kokkos(d_table->e2,h_table->e2,ntables,tablength,"Table::e2"); + memoryKK->create_kokkos(d_table->f2,h_table->f2,ntables,tablength,"Table::f2"); } if(tabstyle == BITMAP) { int ntable = 1 << tablength; - memory->create_kokkos(d_table->rsq,h_table->rsq,ntables,ntable,"Table::rsq"); - memory->create_kokkos(d_table->e,h_table->e,ntables,ntable,"Table::e"); - memory->create_kokkos(d_table->f,h_table->f,ntables,ntable,"Table::f"); - memory->create_kokkos(d_table->de,h_table->de,ntables,ntable,"Table::de"); - memory->create_kokkos(d_table->df,h_table->df,ntables,ntable,"Table::df"); - memory->create_kokkos(d_table->drsq,h_table->drsq,ntables,ntable,"Table::drsq"); + memoryKK->create_kokkos(d_table->rsq,h_table->rsq,ntables,ntable,"Table::rsq"); + memoryKK->create_kokkos(d_table->e,h_table->e,ntables,ntable,"Table::e"); + memoryKK->create_kokkos(d_table->f,h_table->f,ntables,ntable,"Table::f"); + memoryKK->create_kokkos(d_table->de,h_table->de,ntables,ntable,"Table::de"); + memoryKK->create_kokkos(d_table->df,h_table->df,ntables,ntable,"Table::df"); + memoryKK->create_kokkos(d_table->drsq,h_table->drsq,ntables,ntable,"Table::drsq"); } @@ -943,8 +943,8 @@ void PairTableRXKokkos::allocate() const int nt = atom->ntypes + 1; memory->create(setflag,nt,nt,"pair:setflag"); - memory->create_kokkos(d_table->cutsq,h_table->cutsq,cutsq,nt,nt,"pair:cutsq"); - memory->create_kokkos(d_table->tabindex,h_table->tabindex,tabindex,nt,nt,"pair:tabindex"); + memoryKK->create_kokkos(d_table->cutsq,h_table->cutsq,cutsq,nt,nt,"pair:cutsq"); + memoryKK->create_kokkos(d_table->tabindex,h_table->tabindex,tabindex,nt,nt,"pair:tabindex"); d_table_const.cutsq = d_table->cutsq; d_table_const.tabindex = d_table->tabindex; diff --git a/src/KOKKOS/pair_tersoff_kokkos.cpp b/src/KOKKOS/pair_tersoff_kokkos.cpp index 3a5c2227ef..c585da6029 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -60,8 +60,8 @@ template PairTersoffKokkos::~PairTersoffKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -170,13 +170,13 @@ void PairTersoffKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp index 9a59979f4c..8e718fbf6f 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -60,8 +60,8 @@ template PairTersoffMODKokkos::~PairTersoffMODKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -170,13 +170,13 @@ void PairTersoffMODKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp index 8468bb01f5..11a5ff1007 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp @@ -31,7 +31,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -71,8 +71,8 @@ template PairTersoffZBLKokkos::~PairTersoffZBLKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); } } @@ -184,13 +184,13 @@ void PairTersoffZBLKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pair_vashishta_kokkos.cpp b/src/KOKKOS/pair_vashishta_kokkos.cpp index fe2394ae84..e7dd01bfe4 100644 --- a/src/KOKKOS/pair_vashishta_kokkos.cpp +++ b/src/KOKKOS/pair_vashishta_kokkos.cpp @@ -27,10 +27,10 @@ #include "neigh_request.h" #include "force.h" #include "comm.h" -#include "memory.h" +#include "memory_kokkos.h" #include "neighbor.h" #include "neigh_list_kokkos.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" #include "math_const.h" @@ -62,8 +62,8 @@ template PairVashishtaKokkos::~PairVashishtaKokkos() { if (!copymode) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); eatom = NULL; vatom = NULL; } @@ -85,13 +85,13 @@ void PairVashishtaKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index bd3ed3644f..e4fede474f 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -32,7 +32,7 @@ #include "domain.h" #include "fft3d_wrap.h" #include "remap_wrap.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -162,8 +162,8 @@ PPPMKokkos::~PPPMKokkos() //memory->destroy(part2grid); //memory->destroy(acons); - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); eatom = NULL; vatom = NULL; } @@ -618,13 +618,13 @@ void PPPMKokkos::compute(int eflag, int vflag) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } @@ -805,12 +805,12 @@ void PPPMKokkos::allocate() { d_density_brick = typename AT::t_FFT_SCALAR_3d("pppm:density_brick",nzhi_out-nzlo_out+1,nyhi_out-nylo_out+1,nxhi_out-nxlo_out+1); - memory->create_kokkos(k_density_fft,density_fft,nfft_both,"pppm:d_density_fft"); + memoryKK->create_kokkos(k_density_fft,density_fft,nfft_both,"pppm:d_density_fft"); d_density_fft = k_density_fft.view(); d_greensfn = typename AT::t_float_1d("pppm:greensfn",nfft_both); - memory->create_kokkos(k_work1,work1,2*nfft_both,"pppm:work1"); - memory->create_kokkos(k_work2,work2,2*nfft_both,"pppm:work2"); + memoryKK->create_kokkos(k_work1,work1,2*nfft_both,"pppm:work1"); + memoryKK->create_kokkos(k_work2,work2,2*nfft_both,"pppm:work2"); d_work1 = k_work1.view(); d_work2 = k_work2.view(); d_vg = typename AT::t_virial_array("pppm:vg",nfft_both); @@ -878,13 +878,13 @@ void PPPMKokkos::allocate() template void PPPMKokkos::deallocate() { - memory->destroy_kokkos(d_density_fft,density_fft); + memoryKK->destroy_kokkos(d_density_fft,density_fft); density_fft = NULL; - memory->destroy_kokkos(d_greensfn,greensfn); + memoryKK->destroy_kokkos(d_greensfn,greensfn); greensfn = NULL; - memory->destroy_kokkos(d_work1,work1); + memoryKK->destroy_kokkos(d_work1,work1); work1 = NULL; - memory->destroy_kokkos(d_work2,work2); + memoryKK->destroy_kokkos(d_work2,work2); work2 = NULL; delete fft1; diff --git a/src/KOKKOS/verlet_kokkos.cpp b/src/KOKKOS/verlet_kokkos.cpp index adec5ff1bd..cae17cd54f 100644 --- a/src/KOKKOS/verlet_kokkos.cpp +++ b/src/KOKKOS/verlet_kokkos.cpp @@ -32,7 +32,7 @@ #include "compute.h" #include "fix.h" #include "timer.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include diff --git a/src/accelerator_kokkos.h b/src/accelerator_kokkos.h index 8ea5b9d4d2..f7781c822d 100644 --- a/src/accelerator_kokkos.h +++ b/src/accelerator_kokkos.h @@ -25,6 +25,7 @@ #include "comm_tiled_kokkos.h" #include "domain_kokkos.h" #include "neighbor_kokkos.h" +#include "memory_kokkos.h" #include "modify_kokkos.h" #else @@ -37,6 +38,7 @@ #include "comm_tiled.h" #include "domain.h" #include "neighbor.h" +#include "memory.h" #include "modify.h" namespace LAMMPS_NS { @@ -89,6 +91,13 @@ class NeighborKokkos : public Neighbor { ~NeighborKokkos() {} }; +class MemoryKokkos : public MemoryBrick { + public: + MemoryKokkos(class LAMMPS *lmp) : MemoryBrick(lmp) {} + ~MemoryKokkos() {} + void grow_kokkos(tagint **, tagint **, int, int, const char*) {} +}; + class ModifyKokkos : public Modify { public: ModifyKokkos(class LAMMPS *lmp) : Modify(lmp) {} diff --git a/src/lammps.cpp b/src/lammps.cpp index bde7ca035d..65a833d8ee 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -472,6 +472,9 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) kokkos = NULL; if (kokkosflag == 1) { + delete memory; + memory = new MemoryKokkos(this); + kokkos = new KokkosLMP(this,kklast-kkfirst,&arg[kkfirst]); if (!kokkos->kokkos_exists) error->all(FLERR,"Cannot use -kokkos on without KOKKOS installed"); diff --git a/src/lammps.h b/src/lammps.h index c432784a0b..e3b815e623 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -53,6 +53,7 @@ class LAMMPS { class KokkosLMP *kokkos; // KOKKOS accelerator class class AtomKokkos *atomKK; // KOKKOS version of Atom class + class MemoryKokkos *memoryKK; // KOKKOS version of Memory class class Python * python; // Python interface diff --git a/src/memory.h b/src/memory.h index b83482e4c2..f2faecf6e1 100644 --- a/src/memory.h +++ b/src/memory.h @@ -16,9 +16,6 @@ #include "lmptype.h" #include "pointers.h" -#ifdef LMP_KOKKOS -#include "kokkos_type.h" -#endif namespace LAMMPS_NS { @@ -31,16 +28,6 @@ class Memory : protected Pointers { void sfree(void *); void fail(const char *); - // Kokkos memory allocation functions - // provide a dummy prototpye for any Kokkos memory function - // called in main LAMMPS even when not built with KOKKOS package - -#ifdef LMP_KOKKOS -#include "memory_kokkos.h" -#else - void grow_kokkos(tagint **, tagint **, int, int, const char*) {} -#endif - /* ---------------------------------------------------------------------- create/grow/destroy vecs and multidim arrays with contiguous memory blocks only use with primitive data types, e.g. 1d vec of ints, 2d array of doubles diff --git a/src/pointers.h b/src/pointers.h index 82b49c1dad..44967f5135 100644 --- a/src/pointers.h +++ b/src/pointers.h @@ -57,6 +57,7 @@ class Pointers { screen(ptr->screen), logfile(ptr->logfile), atomKK(ptr->atomKK), + memoryKK(ptr->memoryKK), python(ptr->python) {} virtual ~Pointers() {} @@ -84,6 +85,7 @@ class Pointers { FILE *&logfile; class AtomKokkos *&atomKK; + class MemoryKokkos *&memoryKK; class Python *&python; }; diff --git a/src/special.cpp b/src/special.cpp index 381a763dd2..56529e748b 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -591,7 +591,8 @@ void Special::combine() AtomKokkos* atomKK = (AtomKokkos*) atom; atomKK->modified(Host,SPECIAL_MASK); atomKK->sync(Device,SPECIAL_MASK); - memory->grow_kokkos(atomKK->k_special,atom->special, + MemoryKokkos* memoryKK = (MemoryKokkos*) memory; + memoryKK->grow_kokkos(atomKK->k_special,atom->special, atom->nmax,atom->maxspecial,"atom:special"); atomKK->modified(Device,SPECIAL_MASK); atomKK->sync(Host,SPECIAL_MASK); From 31f2ca1e4c9821d0033e72f02a425e0b2d64c783 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 09:51:40 -0700 Subject: [PATCH 17/34] Use multiple inheritance to remove accelerator_kokkos.h out of pair.h --- src/.gitignore | 1 + src/KOKKOS/Install.sh | 3 ++- src/KOKKOS/comm_kokkos.cpp | 6 +++-- src/KOKKOS/kokkos_base.h | 36 ++++++++++++++++++++++++++++++ src/KOKKOS/memory_kokkos.h | 5 ++--- src/KOKKOS/neighbor_kokkos.cpp | 2 +- src/KOKKOS/pair_eam_alloy_kokkos.h | 17 +++++++------- src/KOKKOS/pair_eam_fs_kokkos.h | 17 +++++++------- src/KOKKOS/pair_eam_kokkos.h | 17 +++++++------- src/KOKKOS/pair_hybrid_kokkos.cpp | 1 + src/KOKKOS/pair_reaxc_kokkos.cpp | 1 + src/accelerator_kokkos.h | 4 ++-- src/compute_aggregate_atom.cpp | 1 + src/compute_orientorder_atom.cpp | 1 + src/compute_rdf.cpp | 1 + src/pair.h | 5 ----- src/write_coeff.cpp | 1 + 17 files changed, 81 insertions(+), 38 deletions(-) create mode 100644 src/KOKKOS/kokkos_base.h diff --git a/src/.gitignore b/src/.gitignore index 8d99776096..bd0e952bbf 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -25,6 +25,7 @@ /kokkos.h /kokkos_type.h /kokkos_few.h +/kokkos_base.h /manifold*.cpp /manifold*.h diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index f86ef990d5..a5ee300e70 100644 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -124,8 +124,9 @@ action improper_harmonic_kokkos.cpp improper_harmonic.cpp action improper_harmonic_kokkos.h improper_harmonic.h action kokkos.cpp action kokkos.h -action kokkos_type.h +action kokkos_base.h action kokkos_few.h +action kokkos_type.h action memory_kokkos.h action modify_kokkos.cpp action modify_kokkos.h diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 7bb416df93..53c6a163af 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -28,6 +28,7 @@ #include "dump.h" #include "output.h" #include "modify.h" +#include "kokkos_base.h" using namespace LAMMPS_NS; @@ -379,6 +380,7 @@ void CommKokkos::forward_comm_pair_device(Pair *pair) MPI_Request request; int nsize = pair->comm_forward; + KokkosBase* pairKKBase = (KokkosBase*) pair; for (iswap = 0; iswap < nswap; iswap++) { int n = MAX(max_buf_pair,nsize*sendnum[iswap]); @@ -391,7 +393,7 @@ void CommKokkos::forward_comm_pair_device(Pair *pair) // pack buffer - n = pair->pack_forward_comm_kokkos(sendnum[iswap],k_sendlist, + n = pairKKBase->pack_forward_comm_kokkos(sendnum[iswap],k_sendlist, iswap,k_buf_send_pair,pbc_flag[iswap],pbc[iswap]); // exchange with another proc @@ -408,7 +410,7 @@ void CommKokkos::forward_comm_pair_device(Pair *pair) // unpack buffer - pair->unpack_forward_comm_kokkos(recvnum[iswap],firstrecv[iswap],k_buf_recv_pair); + pairKKBase->unpack_forward_comm_kokkos(recvnum[iswap],firstrecv[iswap],k_buf_recv_pair); } } diff --git a/src/KOKKOS/kokkos_base.h b/src/KOKKOS/kokkos_base.h new file mode 100644 index 0000000000..72cc57135e --- /dev/null +++ b/src/KOKKOS/kokkos_base.h @@ -0,0 +1,36 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifndef KOKKOS_BASE_H +#define KOKKOS_BASE_H + +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +class KokkosBase { + public: + KokkosBase() {} + virtual int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, + int, DAT::tdual_xfloat_1d &, + int, int *) {return 0;}; + virtual void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d &) {} +}; + +} + +#endif + +/* ERROR/WARNING messages: + +*/ diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 2454b7c412..c063e1d624 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -14,15 +14,14 @@ #ifndef LMP_MEMORY_KOKKOS_H #define LMP_MEMORY_KOKKOS_H -#ifdef LMP_KOKKOS +#include "memory.h" #include "kokkos_type.h" -#endif namespace LAMMPS_NS { class MemoryKokkos : public Memory { public: - MemoryKokkos::MemoryKokkos(class LAMMPS *lmp) : Memory(lmp) {} + MemoryKokkos(class LAMMPS *lmp) : Memory(lmp) {} /* ---------------------------------------------------------------------- Kokkos versions of create/grow/destroy multi-dimensional arrays diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index cf1b318201..8d36add10b 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "neighbor_kokkos.h" -#include "atom.h" +#include "atom_kokkos.h" #include "pair.h" #include "fix.h" #include "neigh_request.h" diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.h b/src/KOKKOS/pair_eam_alloy_kokkos.h index fb07eec32b..a962f55908 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.h +++ b/src/KOKKOS/pair_eam_alloy_kokkos.h @@ -24,6 +24,7 @@ PairStyle(eam/alloy/kk/host,PairEAMAlloyKokkos) #define LMP_PAIR_EAM_ALLOY_KOKKOS_H #include +#include "kokkos_base.h" #include "pair_kokkos.h" #include "pair_eam.h" #include "neigh_list_kokkos.h" @@ -49,7 +50,7 @@ struct TagPairEAMAlloyKernelC{}; // Cannot use virtual inheritance on the GPU template -class PairEAMAlloyKokkos : public PairEAM { +class PairEAMAlloyKokkos : public PairEAM, public KokkosBase { public: enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; @@ -59,7 +60,7 @@ class PairEAMAlloyKokkos : public PairEAM { PairEAMAlloyKokkos(class LAMMPS *); virtual ~PairEAMAlloyKokkos(); - virtual void compute(int, int); + void compute(int, int); void init_style(); void *extract(const char *, int &) { return NULL; } void coeff(int, char **); @@ -107,11 +108,11 @@ class PairEAMAlloyKokkos : public PairEAM { const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; - virtual int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, - int, int *); - virtual void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); + int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, + int, int *); + void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); @@ -148,7 +149,7 @@ class PairEAMAlloyKokkos : public PairEAM { t_ffloat_2d_n7_randomread d_rhor_spline; t_ffloat_2d_n7_randomread d_z2r_spline; - virtual void file2array(); + void file2array(); void file2array_alloy(); void array2spline(); void interpolate(int, double, double *, t_host_ffloat_2d_n7, int); diff --git a/src/KOKKOS/pair_eam_fs_kokkos.h b/src/KOKKOS/pair_eam_fs_kokkos.h index d71ec2b887..ec87e44ece 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.h +++ b/src/KOKKOS/pair_eam_fs_kokkos.h @@ -24,6 +24,7 @@ PairStyle(eam/fs/kk/host,PairEAMFSKokkos) #define LMP_PAIR_EAM_FS_KOKKOS_H #include +#include "kokkos_base.h" #include "pair_kokkos.h" #include "pair_eam.h" #include "neigh_list_kokkos.h" @@ -49,7 +50,7 @@ struct TagPairEAMFSKernelC{}; // Cannot use virtual inheritance on the GPU template -class PairEAMFSKokkos : public PairEAM { +class PairEAMFSKokkos : public PairEAM, public KokkosBase { public: enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; @@ -59,7 +60,7 @@ class PairEAMFSKokkos : public PairEAM { PairEAMFSKokkos(class LAMMPS *); virtual ~PairEAMFSKokkos(); - virtual void compute(int, int); + void compute(int, int); void init_style(); void *extract(const char *, int &) { return NULL; } void coeff(int, char **); @@ -107,11 +108,11 @@ class PairEAMFSKokkos : public PairEAM { const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; - virtual int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, - int, int *); - virtual void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); + int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, + int, int *); + void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); @@ -148,7 +149,7 @@ class PairEAMFSKokkos : public PairEAM { t_ffloat_2d_n7_randomread d_rhor_spline; t_ffloat_2d_n7_randomread d_z2r_spline; - virtual void file2array(); + void file2array(); void file2array_fs(); void array2spline(); void interpolate(int, double, double *, t_host_ffloat_2d_n7, int); diff --git a/src/KOKKOS/pair_eam_kokkos.h b/src/KOKKOS/pair_eam_kokkos.h index 856cc51f77..34a4795ec5 100644 --- a/src/KOKKOS/pair_eam_kokkos.h +++ b/src/KOKKOS/pair_eam_kokkos.h @@ -24,6 +24,7 @@ PairStyle(eam/kk/host,PairEAMKokkos) #define LMP_PAIR_EAM_KOKKOS_H #include +#include "kokkos_base.h" #include "pair_kokkos.h" #include "pair_eam.h" #include "neigh_list_kokkos.h" @@ -47,7 +48,7 @@ template struct TagPairEAMKernelC{}; template -class PairEAMKokkos : public PairEAM { +class PairEAMKokkos : public PairEAM, public KokkosBase { public: enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; @@ -57,7 +58,7 @@ class PairEAMKokkos : public PairEAM { PairEAMKokkos(class LAMMPS *); virtual ~PairEAMKokkos(); - virtual void compute(int, int); + void compute(int, int); void init_style(); void *extract(const char *, int &) { return NULL; } @@ -104,11 +105,11 @@ class PairEAMKokkos : public PairEAM { const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const; - virtual int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, - int, int *); - virtual void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&); - virtual int pack_forward_comm(int, int *, double *, int, int *); - virtual void unpack_forward_comm(int, int, double *); + int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d&, + int, int *); + void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d&); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); @@ -146,7 +147,7 @@ class PairEAMKokkos : public PairEAM { t_ffloat_2d_n7_randomread d_z2r_spline; void interpolate(int, double, double *, t_host_ffloat_2d_n7, int); - virtual void file2array(); + void file2array(); void array2spline(); typename AT::t_neighbors_2d d_neighbors; diff --git a/src/KOKKOS/pair_hybrid_kokkos.cpp b/src/KOKKOS/pair_hybrid_kokkos.cpp index 48bdf3081d..db757f6ce1 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_kokkos.cpp @@ -27,6 +27,7 @@ #include "error.h" #include "respa.h" #include "atom_masks.h" +#include "kokkos.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 1407c464e3..4fa75a1d51 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -38,6 +38,7 @@ #include "reaxc_defs.h" #include "reaxc_lookup.h" #include "reaxc_tool_box.h" +#include "modify.h" #define TEAMSIZE 128 diff --git a/src/accelerator_kokkos.h b/src/accelerator_kokkos.h index f7781c822d..708592a25e 100644 --- a/src/accelerator_kokkos.h +++ b/src/accelerator_kokkos.h @@ -91,9 +91,9 @@ class NeighborKokkos : public Neighbor { ~NeighborKokkos() {} }; -class MemoryKokkos : public MemoryBrick { +class MemoryKokkos : public Memory { public: - MemoryKokkos(class LAMMPS *lmp) : MemoryBrick(lmp) {} + MemoryKokkos(class LAMMPS *lmp) : Memory(lmp) {} ~MemoryKokkos() {} void grow_kokkos(tagint **, tagint **, int, int, const char*) {} }; diff --git a/src/compute_aggregate_atom.cpp b/src/compute_aggregate_atom.cpp index 1155ac437a..1e91327e54 100644 --- a/src/compute_aggregate_atom.cpp +++ b/src/compute_aggregate_atom.cpp @@ -16,6 +16,7 @@ ------------------------------------------------------------------------- */ #include +#include #include "compute_aggregate_atom.h" #include "atom.h" #include "atom_vec.h" diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index 90e2830e39..b443d56bf8 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -18,6 +18,7 @@ #include #include +#include #include "compute_orientorder_atom.h" #include "atom.h" #include "update.h" diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index 167de4576d..bcb620f3b3 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -32,6 +32,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" +#include "comm.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/pair.h b/src/pair.h index eb71e88224..cfb6576653 100644 --- a/src/pair.h +++ b/src/pair.h @@ -15,7 +15,6 @@ #define LMP_PAIR_H #include "pointers.h" -#include "accelerator_kokkos.h" namespace LAMMPS_NS { @@ -165,10 +164,6 @@ class Pair : protected Pointers { virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} virtual void unpack_forward_comm(int, int, double *) {} - virtual int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, - int, DAT::tdual_xfloat_1d &, - int, int *) {return 0;}; - virtual void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d &) {} virtual int pack_reverse_comm(int, int, double *) {return 0;} virtual void unpack_reverse_comm(int, int *, double *) {} virtual double memory_usage(); diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index d4d4f99bf3..0556d647cf 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -23,6 +23,7 @@ #include "force.h" #include "universe.h" #include "error.h" +#include "domain.h" using namespace LAMMPS_NS; From 31eb12920c17672d5af14ad485a9c06cdf3681b8 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 10:18:22 -0700 Subject: [PATCH 18/34] Use multiple inheritance to remove accelerator_kokkos.h out of region.h and kspace.h --- src/KOKKOS/fix_setforce_kokkos.cpp | 4 +++- src/KOKKOS/gridcomm_kokkos.cpp | 17 +++++++++++------ src/KOKKOS/kokkos_base.h | 11 +++++++++++ src/KOKKOS/pppm_kokkos.cpp | 9 +++++---- src/KOKKOS/pppm_kokkos.h | 11 ++++++----- src/KOKKOS/region_block_kokkos.h | 3 ++- src/KOKKOS/verlet_kokkos.cpp | 1 + src/delete_atoms.cpp | 1 + src/kspace.h | 6 ------ src/region.cpp | 9 --------- src/region.h | 5 ----- src/set.cpp | 1 + 12 files changed, 41 insertions(+), 37 deletions(-) diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index 7c2c115f52..17971e81be 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -26,6 +26,7 @@ #include "error.h" #include "force.h" #include "atom_masks.h" +#include "kokkos_base.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -90,7 +91,8 @@ void FixSetForceKokkos::post_force(int vflag) region = domain->regions[iregion]; region->prematch(); DAT::tdual_int_1d k_match = DAT::tdual_int_1d("setforce:k_match",nlocal); - region->match_all_kokkos(groupbit,k_match); + KokkosBase* regionKKBase = (KokkosBase*) region; + regionKKBase->match_all_kokkos(groupbit,k_match); k_match.template sync(); d_match = k_match.template view(); } diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index d262c51ff6..1e055ff92e 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -17,6 +17,7 @@ #include "kspace.h" #include "memory_kokkos.h" #include "error.h" +#include "kokkos_base.h" using namespace LAMMPS_NS; @@ -515,11 +516,13 @@ void GridCommKokkos::forward_comm(KSpace *kspace, int which) k_packlist.sync(); k_unpacklist.sync(); + KokkosBase* kspaceKKBase = (KokkosBase*) kspace; + for (int m = 0; m < nswap; m++) { if (swap[m].sendproc == me) - kspace->pack_forward_kokkos(which,k_buf2,swap[m].npack,k_packlist,m); + kspaceKKBase->pack_forward_kspace_kokkos(which,k_buf2,swap[m].npack,k_packlist,m); else - kspace->pack_forward_kokkos(which,k_buf1,swap[m].npack,k_packlist,m); + kspaceKKBase->pack_forward_kspace_kokkos(which,k_buf1,swap[m].npack,k_packlist,m); if (swap[m].sendproc != me) { MPI_Irecv(k_buf2.view().ptr_on_device(),nforward*swap[m].nunpack,MPI_FFT_SCALAR, @@ -529,7 +532,7 @@ void GridCommKokkos::forward_comm(KSpace *kspace, int which) MPI_Wait(&request,MPI_STATUS_IGNORE); } - kspace->unpack_forward_kokkos(which,k_buf2,swap[m].nunpack,k_unpacklist,m); + kspaceKKBase->unpack_forward_kspace_kokkos(which,k_buf2,swap[m].nunpack,k_unpacklist,m); } } @@ -544,11 +547,13 @@ void GridCommKokkos::reverse_comm(KSpace *kspace, int which) k_packlist.sync(); k_unpacklist.sync(); + KokkosBase* kspaceKKBase = (KokkosBase*) kspace; + for (int m = nswap-1; m >= 0; m--) { if (swap[m].recvproc == me) - kspace->pack_reverse_kokkos(which,k_buf2,swap[m].nunpack,k_unpacklist,m); + kspaceKKBase->pack_reverse_kspace_kokkos(which,k_buf2,swap[m].nunpack,k_unpacklist,m); else - kspace->pack_reverse_kokkos(which,k_buf1,swap[m].nunpack,k_unpacklist,m); + kspaceKKBase->pack_reverse_kspace_kokkos(which,k_buf1,swap[m].nunpack,k_unpacklist,m); if (swap[m].recvproc != me) { MPI_Irecv(k_buf2.view().ptr_on_device(),nreverse*swap[m].npack,MPI_FFT_SCALAR, @@ -558,7 +563,7 @@ void GridCommKokkos::reverse_comm(KSpace *kspace, int which) MPI_Wait(&request,MPI_STATUS_IGNORE); } - kspace->unpack_reverse_kokkos(which,k_buf2,swap[m].npack,k_packlist,m); + kspaceKKBase->unpack_reverse_kspace_kokkos(which,k_buf2,swap[m].npack,k_packlist,m); } } diff --git a/src/KOKKOS/kokkos_base.h b/src/KOKKOS/kokkos_base.h index 72cc57135e..3279cb2947 100644 --- a/src/KOKKOS/kokkos_base.h +++ b/src/KOKKOS/kokkos_base.h @@ -21,10 +21,21 @@ namespace LAMMPS_NS { class KokkosBase { public: KokkosBase() {} + + //Kspace + virtual void pack_forward_kspace_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; + virtual void unpack_forward_kspace_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; + virtual void pack_reverse_kspace_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; + virtual void unpack_reverse_kspace_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; + + // Pair virtual int pack_forward_comm_kokkos(int, DAT::tdual_int_2d, int, DAT::tdual_xfloat_1d &, int, int *) {return 0;}; virtual void unpack_forward_comm_kokkos(int, int, DAT::tdual_xfloat_1d &) {} + + // Region + virtual void match_all_kokkos(int, DAT::tdual_int_1d) {} }; } diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index e4fede474f..cf6e2814c0 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -35,6 +35,7 @@ #include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" +#include "kokkos.h" #include "math_const.h" #include "math_special_kokkos.h" @@ -2631,7 +2632,7 @@ void PPPMKokkos::operator()(TagPPPM_fieldforce_peratom, const int &i ------------------------------------------------------------------------- */ template -void PPPMKokkos::pack_forward_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::pack_forward_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2687,7 +2688,7 @@ void PPPMKokkos::operator()(TagPPPM_pack_forward2, const int &i) con ------------------------------------------------------------------------- */ template -void PPPMKokkos::unpack_forward_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::unpack_forward_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2744,7 +2745,7 @@ void PPPMKokkos::operator()(TagPPPM_unpack_forward2, const int &i) c ------------------------------------------------------------------------- */ template -void PPPMKokkos::pack_reverse_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::pack_reverse_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2774,7 +2775,7 @@ void PPPMKokkos::operator()(TagPPPM_pack_reverse, const int &i) cons ------------------------------------------------------------------------- */ template -void PPPMKokkos::unpack_reverse_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::unpack_reverse_kspace_kokkos(int flag, Kokkos::DualView &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); diff --git a/src/KOKKOS/pppm_kokkos.h b/src/KOKKOS/pppm_kokkos.h index 4e6bb1d74c..c328b488d0 100644 --- a/src/KOKKOS/pppm_kokkos.h +++ b/src/KOKKOS/pppm_kokkos.h @@ -24,6 +24,7 @@ KSpaceStyle(pppm/kk/host,PPPMKokkos) #include "pppm.h" #include "gridcomm_kokkos.h" +#include "kokkos_base.h" #include "kokkos_type.h" namespace LAMMPS_NS { @@ -86,7 +87,7 @@ struct TagPPPM_slabcorr4{}; struct TagPPPM_timing_zero{}; template -class PPPMKokkos : public PPPM { +class PPPMKokkos : public PPPM, public KokkosBase { public: typedef DeviceType device_type; typedef ArrayTypes AT; @@ -379,10 +380,10 @@ class PPPMKokkos : public PPPM { // grid communication - virtual void pack_forward_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); - virtual void unpack_forward_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); - virtual void pack_reverse_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); - virtual void unpack_reverse_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); + void pack_forward_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); + void unpack_forward_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); + void pack_reverse_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); + void unpack_reverse_kspace_kokkos(int, Kokkos::DualView &, int, DAT::tdual_int_2d &, int); // triclinic diff --git a/src/KOKKOS/region_block_kokkos.h b/src/KOKKOS/region_block_kokkos.h index e14ac4d0c0..532bc588e2 100644 --- a/src/KOKKOS/region_block_kokkos.h +++ b/src/KOKKOS/region_block_kokkos.h @@ -23,6 +23,7 @@ RegionStyle(block/kk/host,RegBlockKokkos) #define LMP_REGION_BLOCK_KOKKOS_H #include "region_block.h" +#include "kokkos_base.h" #include "kokkos_type.h" namespace LAMMPS_NS { @@ -30,7 +31,7 @@ namespace LAMMPS_NS { struct TagRegBlockMatchAll{}; template -class RegBlockKokkos : public RegBlock { +class RegBlockKokkos : public RegBlock, public KokkosBase { friend class FixPour; public: diff --git a/src/KOKKOS/verlet_kokkos.cpp b/src/KOKKOS/verlet_kokkos.cpp index cae17cd54f..5fa03a0989 100644 --- a/src/KOKKOS/verlet_kokkos.cpp +++ b/src/KOKKOS/verlet_kokkos.cpp @@ -34,6 +34,7 @@ #include "timer.h" #include "memory_kokkos.h" #include "error.h" +#include "kokkos.h" #include diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 825426b2b6..489c5bf5d5 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -28,6 +28,7 @@ #include "random_mars.h" #include "memory.h" #include "error.h" +#include "modify.h" #include diff --git a/src/kspace.h b/src/kspace.h index ad29c21472..5a2e5b7884 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -15,7 +15,6 @@ #define LMP_KSPACE_H #include "pointers.h" -#include "accelerator_kokkos.h" #ifdef FFT_SINGLE typedef float FFT_SCALAR; @@ -124,11 +123,6 @@ class KSpace : protected Pointers { virtual void pack_reverse(int, FFT_SCALAR *, int, int *) {}; virtual void unpack_reverse(int, FFT_SCALAR *, int, int *) {}; - virtual void pack_forward_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; - virtual void unpack_forward_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; - virtual void pack_reverse_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; - virtual void unpack_reverse_kokkos(int, DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; - virtual int timing(int, double &, double &) {return 0;} virtual int timing_1d(int, double &) {return 0;} virtual int timing_3d(int, double &) {return 0;} diff --git a/src/region.cpp b/src/region.cpp index d2ef481cb7..da814746ad 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -142,15 +142,6 @@ int Region::match(double x, double y, double z) return !(inside(x,y,z) ^ interior); } -/* ---------------------------------------------------------------------- - generate error if Kokkos function defaults to base class -------------------------------------------------------------------------- */ - -void Region::match_all_kokkos(int, DAT::tdual_int_1d) -{ - error->all(FLERR,"Can only use Kokkos supported regions with Kokkos package"); -} - /* ---------------------------------------------------------------------- generate list of contact points for interior or exterior regions if region has variable shape, invoke shape_update() once per timestep diff --git a/src/region.h b/src/region.h index 5b4238acb4..7e8c45cb2e 100644 --- a/src/region.h +++ b/src/region.h @@ -15,7 +15,6 @@ #define LMP_REGION_H #include "pointers.h" -#include "accelerator_kokkos.h" namespace LAMMPS_NS { @@ -97,10 +96,6 @@ class Region : protected Pointers { virtual void set_velocity_shape() {} virtual void velocity_contact_shape(double*, double*) {} - // Kokkos function, implemented by each Kokkos region - - virtual void match_all_kokkos(int, DAT::tdual_int_1d); - protected: void add_contact(int, double *, double, double, double); void options(int, char **); diff --git a/src/set.cpp b/src/set.cpp index 2b1c0edee2..11b91df4c4 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -36,6 +36,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" +#include "modify.h" using namespace LAMMPS_NS; using namespace MathConst; From 5b33f153f4fab7077416cd7cdea36b16c855e979 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 10:33:47 -0700 Subject: [PATCH 19/34] Add newline to memory_kokkos.h --- src/KOKKOS/memory_kokkos.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index c063e1d624..9f930faae2 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -296,4 +296,5 @@ void destroy_kokkos(TYPE data, typename TYPE::value_type** &array) } -#endif \ No newline at end of file +#endif + From 80dffb27e21ae97ecc93d39722195011f20f1842 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 11:33:42 -0700 Subject: [PATCH 20/34] Add missing header files --- src/GRANULAR/fix_wall_gran.cpp | 1 + src/GRANULAR/fix_wall_gran_region.cpp | 2 ++ src/KOKKOS/fix_rx_kokkos.cpp | 3 +++ src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp | 1 + src/KOKKOS/pair_exp6_rx_kokkos.cpp | 2 ++ src/KOKKOS/pair_kokkos.h | 1 + src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp | 1 + src/KOKKOS/pair_table_rx_kokkos.cpp | 2 ++ src/USER-DRUDE/pair_lj_cut_thole_long.cpp | 2 ++ src/USER-DRUDE/pair_thole.cpp | 2 ++ src/USER-OMP/pair_lj_cut_thole_long_omp.cpp | 1 + src/USER-TALLY/compute_force_tally.cpp | 2 ++ src/USER-TALLY/compute_heat_flux_tally.cpp | 1 + src/USER-TALLY/compute_pe_mol_tally.cpp | 1 + src/USER-TALLY/compute_pe_tally.cpp | 1 + src/USER-TALLY/compute_stress_tally.cpp | 2 ++ 16 files changed, 25 insertions(+) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index eeec94fdf7..033c35dbac 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -30,6 +30,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" +#include "neighbor.h" using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index a09b9dfa42..d1c5d4c9c7 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -30,6 +30,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" +#include "comm.h" +#include "neighbor.h" using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/fix_rx_kokkos.cpp b/src/KOKKOS/fix_rx_kokkos.cpp index d7b71a5fdd..61290ece33 100644 --- a/src/KOKKOS/fix_rx_kokkos.cpp +++ b/src/KOKKOS/fix_rx_kokkos.cpp @@ -26,6 +26,9 @@ #include "neigh_request.h" #include "error.h" #include "math_special_kokkos.h" +#include "comm.h" +#include "domain.h" +#include "kokkos.h" #include // DBL_EPSILON diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp index 0fae6ffef9..7d71719e0a 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp @@ -33,6 +33,7 @@ #include "pair_dpd_fdt_energy_kokkos.h" #include "error.h" #include "atom_masks.h" +#include "kokkos.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index 6eb15f9b94..a09a1d27e3 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -33,6 +33,8 @@ #include #include "atom_masks.h" #include "neigh_request.h" +#include "atom_kokkos.h" +#include "kokkos.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index f0e357270c..4c215ed162 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -20,6 +20,7 @@ #include "Kokkos_Macros.hpp" #include "pair.h" +#include "neighbor_kokkos.h" #include "neigh_list_kokkos.h" #include "Kokkos_Vectorization.hpp" diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index eaf28304ba..0961cf44eb 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -38,6 +38,7 @@ #include "fix.h" #include "atom_masks.h" #include "neigh_request.h" +#include "kokkos.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 6b30d1439c..7bc5198d8c 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -32,6 +32,8 @@ #include "atom_masks.h" #include "fix.h" #include "kokkos_few.h" +#include "kokkos.h" +#include "modify.h" #include using namespace LAMMPS_NS; diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp index 4163a816ac..f78ced3d8b 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp @@ -32,6 +32,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" +#include "modify.h" +#include "domain.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-DRUDE/pair_thole.cpp b/src/USER-DRUDE/pair_thole.cpp index abb37b82b7..ace119ce52 100644 --- a/src/USER-DRUDE/pair_thole.cpp +++ b/src/USER-DRUDE/pair_thole.cpp @@ -25,6 +25,8 @@ #include "error.h" #include "fix.h" #include "fix_store.h" +#include "domain.h" +#include "modify.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp index 85c7e44f8c..110b8917cf 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp @@ -29,6 +29,7 @@ #include "math_const.h" #include "error.h" #include "suffix.h" +#include "domain.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-TALLY/compute_force_tally.cpp b/src/USER-TALLY/compute_force_tally.cpp index 5f29aea5b2..3ec6c188fc 100644 --- a/src/USER-TALLY/compute_force_tally.cpp +++ b/src/USER-TALLY/compute_force_tally.cpp @@ -12,6 +12,7 @@ ------------------------------------------------------------------------- */ #include +#include #include "compute_force_tally.h" #include "atom.h" #include "group.h" @@ -20,6 +21,7 @@ #include "memory.h" #include "error.h" #include "force.h" +#include "comm.h" using namespace LAMMPS_NS; diff --git a/src/USER-TALLY/compute_heat_flux_tally.cpp b/src/USER-TALLY/compute_heat_flux_tally.cpp index c090050b15..43b663b27a 100644 --- a/src/USER-TALLY/compute_heat_flux_tally.cpp +++ b/src/USER-TALLY/compute_heat_flux_tally.cpp @@ -20,6 +20,7 @@ #include "memory.h" #include "error.h" #include "force.h" +#include "comm.h" using namespace LAMMPS_NS; diff --git a/src/USER-TALLY/compute_pe_mol_tally.cpp b/src/USER-TALLY/compute_pe_mol_tally.cpp index 25a172b7f8..0328740e03 100644 --- a/src/USER-TALLY/compute_pe_mol_tally.cpp +++ b/src/USER-TALLY/compute_pe_mol_tally.cpp @@ -20,6 +20,7 @@ #include "memory.h" #include "error.h" #include "force.h" +#include "comm.h" using namespace LAMMPS_NS; diff --git a/src/USER-TALLY/compute_pe_tally.cpp b/src/USER-TALLY/compute_pe_tally.cpp index 5b4644d4e1..caa4cf134a 100644 --- a/src/USER-TALLY/compute_pe_tally.cpp +++ b/src/USER-TALLY/compute_pe_tally.cpp @@ -20,6 +20,7 @@ #include "memory.h" #include "error.h" #include "force.h" +#include "comm.h" using namespace LAMMPS_NS; diff --git a/src/USER-TALLY/compute_stress_tally.cpp b/src/USER-TALLY/compute_stress_tally.cpp index 32253d2cad..e44313d695 100644 --- a/src/USER-TALLY/compute_stress_tally.cpp +++ b/src/USER-TALLY/compute_stress_tally.cpp @@ -20,6 +20,8 @@ #include "memory.h" #include "error.h" #include "force.h" +#include "comm.h" +#include "domain.h" using namespace LAMMPS_NS; From da51a8a0bb830f616cd28b79c1f67ccc07127cce Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 12:13:14 -0700 Subject: [PATCH 21/34] Add missing header files to GPU package --- src/GPU/pair_eam_alloy_gpu.cpp | 1 + src/GPU/pair_eam_fs_gpu.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index ab0f499a98..9b42b0a14f 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -28,6 +28,7 @@ #include "error.h" #include "neigh_request.h" #include "gpu_extra.h" +#include "domain.h" using namespace LAMMPS_NS; diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index a2b339db9a..c29b49631c 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -28,6 +28,7 @@ #include "error.h" #include "neigh_request.h" #include "gpu_extra.h" +#include "domain.h" using namespace LAMMPS_NS; From 5d2e097b27950ec340f9e6610e8ef0c5ab4dcc61 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 12:53:40 -0700 Subject: [PATCH 22/34] Need dynamic cast for multiple inheritance --- src/KOKKOS/comm_kokkos.cpp | 2 +- src/KOKKOS/fix_setforce_kokkos.cpp | 2 +- src/KOKKOS/gridcomm_kokkos.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 53c6a163af..e506fa1ad4 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -380,7 +380,7 @@ void CommKokkos::forward_comm_pair_device(Pair *pair) MPI_Request request; int nsize = pair->comm_forward; - KokkosBase* pairKKBase = (KokkosBase*) pair; + KokkosBase* pairKKBase = dynamic_cast(pair); for (iswap = 0; iswap < nswap; iswap++) { int n = MAX(max_buf_pair,nsize*sendnum[iswap]); diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index 17971e81be..e991609894 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -91,7 +91,7 @@ void FixSetForceKokkos::post_force(int vflag) region = domain->regions[iregion]; region->prematch(); DAT::tdual_int_1d k_match = DAT::tdual_int_1d("setforce:k_match",nlocal); - KokkosBase* regionKKBase = (KokkosBase*) region; + KokkosBase* regionKKBase = dynamic_cast(region); regionKKBase->match_all_kokkos(groupbit,k_match); k_match.template sync(); d_match = k_match.template view(); diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index 1e055ff92e..fdfaf296ef 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -516,7 +516,7 @@ void GridCommKokkos::forward_comm(KSpace *kspace, int which) k_packlist.sync(); k_unpacklist.sync(); - KokkosBase* kspaceKKBase = (KokkosBase*) kspace; + KokkosBase* kspaceKKBase = dynamic_cast(kspace); for (int m = 0; m < nswap; m++) { if (swap[m].sendproc == me) @@ -547,7 +547,7 @@ void GridCommKokkos::reverse_comm(KSpace *kspace, int which) k_packlist.sync(); k_unpacklist.sync(); - KokkosBase* kspaceKKBase = (KokkosBase*) kspace; + KokkosBase* kspaceKKBase = dynamic_cast(kspace); for (int m = nswap-1; m >= 0; m--) { if (swap[m].recvproc == me) From 42e03da70c5575e6738cd82e358931f8f2dd7e73 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 13:16:11 -0700 Subject: [PATCH 23/34] Remove redundant #include in input.cpp --- src/input.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/input.cpp b/src/input.cpp index d18be498fd..0640327682 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -27,7 +27,6 @@ #include "comm.h" #include "comm_brick.h" #include "comm_tiled.h" -#include "accelerator_kokkos.h" #include "group.h" #include "domain.h" #include "output.h" From 14aa036f36f51eded1dff2f585033048bcba0c0f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Dec 2017 15:53:02 -0500 Subject: [PATCH 24/34] add missing header files to USER-INTEL package --- src/Purge.list | 3 +++ src/USER-INTEL/angle_charmm_intel.cpp | 1 + src/USER-INTEL/angle_harmonic_intel.cpp | 1 + src/USER-INTEL/bond_fene_intel.cpp | 1 + src/USER-INTEL/bond_harmonic_intel.cpp | 1 + src/USER-INTEL/dihedral_charmm_intel.cpp | 1 + src/USER-INTEL/dihedral_fourier_intel.cpp | 1 + src/USER-INTEL/dihedral_harmonic_intel.cpp | 1 + src/USER-INTEL/dihedral_opls_intel.cpp | 1 + src/USER-INTEL/fix_intel.cpp | 1 + src/USER-INTEL/nbin_intel.cpp | 3 ++- src/USER-INTEL/npair_full_bin_ghost_intel.cpp | 2 ++ src/USER-INTEL/npair_full_bin_intel.cpp | 1 + src/USER-INTEL/npair_half_bin_newton_intel.cpp | 1 + src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp | 1 + src/USER-INTEL/npair_intel.cpp | 4 ++++ src/USER-INTEL/pair_eam_intel.cpp | 1 + src/USER-INTEL/pppm_disp_intel.cpp | 3 +++ src/USER-INTEL/pppm_intel.cpp | 3 +++ 19 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/Purge.list b/src/Purge.list index 312994fdb7..93808b784c 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -16,6 +16,9 @@ style_region.h style_neigh_bin.h style_neigh_pair.h style_neigh_stencil.h +# deleted on 1 December 2017 +npair_half_bin_newtoff_intel.cpp +npair_half_bin_newtoff_intel.h # deleted on 11 October 2017 fix_shear_history_omp.cpp fix_shear_history_omp.h diff --git a/src/USER-INTEL/angle_charmm_intel.cpp b/src/USER-INTEL/angle_charmm_intel.cpp index 031c964200..bcaecb4696 100644 --- a/src/USER-INTEL/angle_charmm_intel.cpp +++ b/src/USER-INTEL/angle_charmm_intel.cpp @@ -23,6 +23,7 @@ #include "domain.h" #include "comm.h" #include "force.h" +#include "modify.h" #include "math_const.h" #include "memory.h" #include "suffix.h" diff --git a/src/USER-INTEL/angle_harmonic_intel.cpp b/src/USER-INTEL/angle_harmonic_intel.cpp index 84220277d7..ffc81c496d 100644 --- a/src/USER-INTEL/angle_harmonic_intel.cpp +++ b/src/USER-INTEL/angle_harmonic_intel.cpp @@ -23,6 +23,7 @@ #include "domain.h" #include "comm.h" #include "force.h" +#include "modify.h" #include "math_const.h" #include "memory.h" #include "suffix.h" diff --git a/src/USER-INTEL/bond_fene_intel.cpp b/src/USER-INTEL/bond_fene_intel.cpp index 93d64ed631..004a2e5413 100644 --- a/src/USER-INTEL/bond_fene_intel.cpp +++ b/src/USER-INTEL/bond_fene_intel.cpp @@ -19,6 +19,7 @@ #include #include "bond_fene_intel.h" #include "atom.h" +#include "modify.h" #include "neighbor.h" #include "domain.h" #include "comm.h" diff --git a/src/USER-INTEL/bond_harmonic_intel.cpp b/src/USER-INTEL/bond_harmonic_intel.cpp index 0ac466f113..0c714edc09 100644 --- a/src/USER-INTEL/bond_harmonic_intel.cpp +++ b/src/USER-INTEL/bond_harmonic_intel.cpp @@ -19,6 +19,7 @@ #include #include "bond_harmonic_intel.h" #include "atom.h" +#include "modify.h" #include "neighbor.h" #include "domain.h" #include "comm.h" diff --git a/src/USER-INTEL/dihedral_charmm_intel.cpp b/src/USER-INTEL/dihedral_charmm_intel.cpp index 0e13e92251..c8429dc8ff 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.cpp +++ b/src/USER-INTEL/dihedral_charmm_intel.cpp @@ -21,6 +21,7 @@ #include "atom.h" #include "comm.h" #include "memory.h" +#include "modify.h" #include "neighbor.h" #include "domain.h" #include "force.h" diff --git a/src/USER-INTEL/dihedral_fourier_intel.cpp b/src/USER-INTEL/dihedral_fourier_intel.cpp index 805ffc0e25..772ea5b02f 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.cpp +++ b/src/USER-INTEL/dihedral_fourier_intel.cpp @@ -21,6 +21,7 @@ #include "atom.h" #include "comm.h" #include "memory.h" +#include "modify.h" #include "neighbor.h" #include "domain.h" #include "force.h" diff --git a/src/USER-INTEL/dihedral_harmonic_intel.cpp b/src/USER-INTEL/dihedral_harmonic_intel.cpp index 5d16b0da74..b35ea4e03a 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.cpp +++ b/src/USER-INTEL/dihedral_harmonic_intel.cpp @@ -21,6 +21,7 @@ #include "atom.h" #include "comm.h" #include "memory.h" +#include "modify.h" #include "neighbor.h" #include "domain.h" #include "force.h" diff --git a/src/USER-INTEL/dihedral_opls_intel.cpp b/src/USER-INTEL/dihedral_opls_intel.cpp index e290ab9061..6b7b2c81eb 100644 --- a/src/USER-INTEL/dihedral_opls_intel.cpp +++ b/src/USER-INTEL/dihedral_opls_intel.cpp @@ -21,6 +21,7 @@ #include "atom.h" #include "comm.h" #include "memory.h" +#include "modify.h" #include "neighbor.h" #include "domain.h" #include "force.h" diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp index eac48b8510..3e36c8f7a9 100644 --- a/src/USER-INTEL/fix_intel.cpp +++ b/src/USER-INTEL/fix_intel.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #ifdef _LMP_INTEL_OFFLOAD #ifndef INTEL_OFFLOAD_NOAFFINITY diff --git a/src/USER-INTEL/nbin_intel.cpp b/src/USER-INTEL/nbin_intel.cpp index 3a36ead499..9a1dae36ca 100644 --- a/src/USER-INTEL/nbin_intel.cpp +++ b/src/USER-INTEL/nbin_intel.cpp @@ -18,8 +18,9 @@ #include "nbin_intel.h" #include "atom.h" #include "group.h" -#include "domain.h" #include "comm.h" +#include "domain.h" +#include "modify.h" #include "update.h" #include "error.h" diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp index e6d45d7b2c..a814891f25 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp @@ -21,6 +21,8 @@ #include "neigh_list.h" #include "atom.h" #include "atom_vec.h" +#include "comm.h" +#include "domain.h" #include "molecule.h" #include "error.h" diff --git a/src/USER-INTEL/npair_full_bin_intel.cpp b/src/USER-INTEL/npair_full_bin_intel.cpp index 06c10c080f..60b912d796 100644 --- a/src/USER-INTEL/npair_full_bin_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_intel.cpp @@ -20,6 +20,7 @@ #include "neigh_list.h" #include "atom.h" #include "comm.h" +#include "domain.h" #include "group.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/npair_half_bin_newton_intel.cpp b/src/USER-INTEL/npair_half_bin_newton_intel.cpp index c761557097..8c024a4604 100644 --- a/src/USER-INTEL/npair_half_bin_newton_intel.cpp +++ b/src/USER-INTEL/npair_half_bin_newton_intel.cpp @@ -20,6 +20,7 @@ #include "neigh_list.h" #include "atom.h" #include "comm.h" +#include "domain.h" #include "group.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp b/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp index d70f1ec589..653a951394 100644 --- a/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp +++ b/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp @@ -20,6 +20,7 @@ #include "neigh_list.h" #include "atom.h" #include "comm.h" +#include "domain.h" #include "group.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/npair_intel.cpp b/src/USER-INTEL/npair_intel.cpp index 0068e02635..234557c941 100644 --- a/src/USER-INTEL/npair_intel.cpp +++ b/src/USER-INTEL/npair_intel.cpp @@ -15,6 +15,10 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ +#include "comm.h" +#include "domain.h" +#include "timer.h" +#include "modify.h" #include "npair_intel.h" #include "nstencil.h" diff --git a/src/USER-INTEL/pair_eam_intel.cpp b/src/USER-INTEL/pair_eam_intel.cpp index b97128bf9f..ea4ee30d52 100644 --- a/src/USER-INTEL/pair_eam_intel.cpp +++ b/src/USER-INTEL/pair_eam_intel.cpp @@ -23,6 +23,7 @@ #include "atom.h" #include "force.h" #include "comm.h" +#include "modify.h" #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" diff --git a/src/USER-INTEL/pppm_disp_intel.cpp b/src/USER-INTEL/pppm_disp_intel.cpp index 1269579ff4..bd41f8b531 100644 --- a/src/USER-INTEL/pppm_disp_intel.cpp +++ b/src/USER-INTEL/pppm_disp_intel.cpp @@ -20,7 +20,10 @@ #include #include "pppm_disp_intel.h" #include "atom.h" +#include "comm.h" +#include "domain.h" #include "error.h" +#include "modify.h" #include "fft3d_wrap.h" #include "gridcomm.h" #include "math_const.h" diff --git a/src/USER-INTEL/pppm_intel.cpp b/src/USER-INTEL/pppm_intel.cpp index db855b75ef..30f8f4c5c0 100644 --- a/src/USER-INTEL/pppm_intel.cpp +++ b/src/USER-INTEL/pppm_intel.cpp @@ -23,7 +23,10 @@ #include #include "pppm_intel.h" #include "atom.h" +#include "comm.h" +#include "domain.h" #include "error.h" +#include "modify.h" #include "fft3d_wrap.h" #include "gridcomm.h" #include "math_const.h" From 58ed92d905d4d04981ff090367bca50d9c0b5086 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Dec 2017 16:45:22 -0500 Subject: [PATCH 25/34] one more file that doesn't require to include accelerator_kokkos.h --- src/fix_addforce.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 5c677a4338..6b1e892279 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -16,7 +16,6 @@ #include "fix_addforce.h" #include "atom.h" #include "atom_masks.h" -#include "accelerator_kokkos.h" #include "update.h" #include "modify.h" #include "domain.h" From e7f97728c3ea7647b6c8edb8100cfe5dca6cf761 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 1 Dec 2017 17:14:11 -0500 Subject: [PATCH 26/34] disable disruptive debug output --- src/compute_msd_chunk.cpp | 2 +- src/fix_store.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index bc5a374fad..69cd87f96b 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -126,7 +126,7 @@ void ComputeMSDChunk::setup() if (fix->nrow == nchunk && fix->ncol == 3) return; fix->reset_global(nchunk,3); - + double **cominit = fix->astore; for (int i = 0; i < nchunk; i++) { cominit[i][0] = comall[i][0]; diff --git a/src/fix_store.cpp b/src/fix_store.cpp index c856bb2db2..84e94fc2b7 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -155,8 +155,7 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller) else memory->create(astore,nrow,ncol,"fix/store:astore"); memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf"); - - printf("AAA HOW GET HERE\n"); + // printf("AAA HOW GET HERE\n"); } /* ---------------------------------------------------------------------- From 5d9a6c1fe2e538219f17b83f41a2f6e38c5e0e09 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Fri, 1 Dec 2017 16:03:25 -0700 Subject: [PATCH 27/34] Add checks to Kokkos Install.sh so that files aren't unnecessarily recompiled --- src/KOKKOS/Install.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index a5ee300e70..e823dc338b 100644 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -28,7 +28,20 @@ action () { # force rebuild of files with LMP_KOKKOS switch -touch ../accelerator_kokkos.h +KOKKOS_INSTALLED=0 +if (test -e ../Makefile.package) then + KOKKOS_INSTALLED=`grep DLMP_KOKKOS ../Makefile.package | wc -l` +fi + +if (test $mode = 1) then + if (test $KOKKOS_INSTALLED = 0) then + touch ../accelerator_kokkos.h + fi +elif (test $mode = 0) then + if (test $KOKKOS_INSTALLED = 1) then + touch ../accelerator_kokkos.h + fi +fi # list of files with optional dependcies From 4a3a6b445597dc7d320fb59b910170bb5688377a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 3 Dec 2017 19:37:42 -0500 Subject: [PATCH 28/34] no need to include library.o in the LAMMPS executable --- src/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index e0f0db77fe..c3c84b3665 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,12 +17,12 @@ SHLINK = liblammps.so OBJDIR = Obj_$@ OBJSHDIR = Obj_shared_$@ -SRC = $(wildcard *.cpp) -INC = $(wildcard *.h) +SRC = $(filter-out library.cpp,$(wildcard *.cpp)) +INC = $(filter-out library.h,$(wildcard *.h)) OBJ = $(SRC:.cpp=.o) -SRCLIB = $(filter-out main.cpp,$(SRC)) -OBJLIB = $(filter-out main.o,$(OBJ)) +SRCLIB = $(filter-out main.cpp,$(SRC)) library.cpp +OBJLIB = $(filter-out main.o,$(OBJ)) library.o # Command-line options for mode: exe (default), shexe, lib, shlib @@ -176,7 +176,7 @@ help: then cp Makefile.package.settings.empty Makefile.package.settings; fi @cp Makefile.package Makefile.package.settings $(objdir) @cd $(objdir); rm -f .depend; \ - $(MAKE) $(MFLAGS) "SRC = $(SRC)" "INC = $(INC)" depend || : + $(MAKE) $(MFLAGS) "SRC = $(SRC) library.cpp" "INC = $(INC) library.h" depend || : ifeq ($(mode),exe) @cd $(objdir); \ $(MAKE) $(MFLAGS) "OBJ = $(OBJ)" "INC = $(INC)" "SHFLAGS =" \ From 2813923f15b2a77824709454b2359385de865ee3 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 4 Dec 2017 10:43:41 -0700 Subject: [PATCH 29/34] Add multiple inheritance to pair_multi_lucy_rx_kokkos --- src/KOKKOS/pair_multi_lucy_rx_kokkos.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h index b8ced4c847..aee1763b06 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h @@ -25,6 +25,7 @@ PairStyle(multi/lucy/rx/kk/host,PairMultiLucyRXKokkos) #include "pair_multi_lucy_rx.h" #include "pair_kokkos.h" +#include "kokkos_base.h" #include "kokkos_type.h" namespace LAMMPS_NS { @@ -43,7 +44,7 @@ template struct TagPairMultiLucyRXComputeLocalDensity{}; template -class PairMultiLucyRXKokkos : public PairMultiLucyRX { +class PairMultiLucyRXKokkos : public PairMultiLucyRX, public KokkosBase { public: typedef DeviceType device_type; typedef ArrayTypes AT; From d916416cc51604f5198200bb42276fe3a1ef2297 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 4 Dec 2017 12:02:32 -0700 Subject: [PATCH 30/34] Add pair_yukawa_kokkos to Install.sh and minor cleanup --- src/KOKKOS/Install.sh | 2 ++ src/KOKKOS/pair_yukawa_kokkos.cpp | 30 ++--------------------------- src/KOKKOS/pair_yukawa_kokkos.h | 32 +++++++++++++++---------------- 3 files changed, 20 insertions(+), 44 deletions(-) diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index df5fc3e5f1..a382295be3 100644 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -229,6 +229,8 @@ action pair_tersoff_mod_kokkos.cpp pair_tersoff_mod.cpp action pair_tersoff_mod_kokkos.h pair_tersoff_mod.h action pair_tersoff_zbl_kokkos.cpp pair_tersoff_zbl.cpp action pair_tersoff_zbl_kokkos.h pair_tersoff_zbl.h +action pair_yukawa_kokkos.cpp +action pair_yukawa_kokkos.h action pppm_kokkos.cpp pppm.cpp action pppm_kokkos.h pppm.h action rand_pool_wrap_kokkos.cpp diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 39233a9098..6d675ed2b8 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -16,15 +16,6 @@ ------------------------------------------------------------------------- */ #include #include -// #include "pair_yukawa.h" -// #include "atom.h" -//#include "force.h" -//#include "comm.h" -//#include "neigh_list.h" -//#include "memory.h" -//#include "error.h" - -// These were added. #include "pair_yukawa_kokkos.h" #include "kokkos.h" #include "atom_kokkos.h" @@ -40,7 +31,6 @@ #include "memory.h" #include "error.h" #include "atom_masks.h" -// end These were added. using namespace LAMMPS_NS; using namespace MathConst; @@ -104,24 +94,11 @@ void PairYukawaKokkos::allocate() d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView( - "PairYukawa::params",n+1,n+1); + "PairYukawa::params",n+1,n+1); params = k_params.template view(); } -/* ---------------------------------------------------------------------- - global settings -------------------------------------------------------------------------- */ - -template -void PairYukawaKokkos::settings(int narg, char **arg) -{ - if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - - PairYukawa::settings(2,arg); -} - - /* ---------------------------------------------------------------------- init specific to this pair style ------------------------------------------------------------------------- */ @@ -158,9 +135,6 @@ void PairYukawaKokkos::init_style() } else if (neighflag == HALF || neighflag == HALFTHREAD) { neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; - } else if (neighflag == N2) { - neighbor->requests[irequest]->full = 0; - neighbor->requests[irequest]->half = 0; } else { error->all(FLERR,"Cannot use chosen neighbor list style with yukawa/kk"); } @@ -241,7 +215,7 @@ void PairYukawaKokkos::compute(int eflag_in, int vflag_in) // loop over neighbors of my atoms EV_FLOAT ev = pair_compute,void >( - this,(NeighListKokkos*)list); + this,(NeighListKokkos*)list); if (eflag_global) eng_vdwl += ev.evdwl; if (vflag_global) { diff --git a/src/KOKKOS/pair_yukawa_kokkos.h b/src/KOKKOS/pair_yukawa_kokkos.h index 1323bd1c39..a4c8cf05b7 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.h +++ b/src/KOKKOS/pair_yukawa_kokkos.h @@ -31,15 +31,15 @@ namespace LAMMPS_NS { template class PairYukawaKokkos : public PairYukawa { public: - enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF|N2}; + enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF}; enum {COUL_FLAG=0}; typedef DeviceType device_type; + typedef ArrayTypes AT; PairYukawaKokkos(class LAMMPS *); virtual ~PairYukawaKokkos(); void compute(int, int); - void settings(int, char**); void init_style(); double init_one(int,int); @@ -78,22 +78,22 @@ class PairYukawaKokkos : public PairYukawa { typename Kokkos::DualView::t_dev_const_um params; params_yukawa m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; - typename ArrayTypes::t_x_array_randomread x; - typename ArrayTypes::t_x_array c_x; - typename ArrayTypes::t_f_array f; - typename ArrayTypes::t_int_1d_randomread type; + typename AT::t_x_array_randomread x; + typename AT::t_x_array c_x; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; DAT::tdual_efloat_1d k_eatom; DAT::tdual_virial_array k_vatom; - typename ArrayTypes::t_efloat_1d d_eatom; - typename ArrayTypes::t_virial_array d_vatom; - typename ArrayTypes::t_tagint_1d tag; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + typename AT::t_tagint_1d tag; int newton_pair; double special_lj[4]; - typename ArrayTypes::tdual_ffloat_2d k_cutsq; - typename ArrayTypes::t_ffloat_2d d_cutsq; + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; int neighflag; @@ -109,15 +109,15 @@ class PairYukawaKokkos : public PairYukawa { friend class PairComputeFunctor; friend class PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist( - PairYukawaKokkos*,NeighListKokkos*); + PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist( - PairYukawaKokkos*,NeighListKokkos*); + PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist( - PairYukawaKokkos*,NeighListKokkos*); + PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist( - PairYukawaKokkos*,NeighListKokkos*); + PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute( - PairYukawaKokkos*,NeighListKokkos*); + PairYukawaKokkos*,NeighListKokkos*); friend void pair_virial_fdotr_compute(PairYukawaKokkos*); }; From fc742eb2efcf9c1f62736746ef82cd60d57cd5d7 Mon Sep 17 00:00:00 2001 From: Jaap Kroes Date: Tue, 5 Dec 2017 16:23:20 +0100 Subject: [PATCH 31/34] Remove outdated elastic constants --- potentials/BN.extep | 5 ----- 1 file changed, 5 deletions(-) diff --git a/potentials/BN.extep b/potentials/BN.extep index 1b9f46c768..8732ada84b 100644 --- a/potentials/BN.extep +++ b/potentials/BN.extep @@ -107,8 +107,3 @@ N B N 3 1.0 0.0d0 306.586555205d0 10.d0 -0.7218d0 0.6576543657d0 0 N N 4 2 0.0060 -0.0073 0.0000 0.0000 N N 4 3 0.0000 0.0000 0.0000 0.0000 N N 4 4 0.0000 0.0000 0.0000 0.0000 - -# Elastic properties -# ================== -# hBN: B=164 N/M; C11=290 N/M; kappa=0.64 eV -# cBN: B=402 GPa; C11=567 GPa; C66=533 GPa From f64544a5fe4c7e17f80353f5148fc89ffe8aafd3 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Tue, 5 Dec 2017 08:34:24 -0700 Subject: [PATCH 32/34] Move instantiation of MemoryKokkos class --- src/KOKKOS/kokkos.cpp | 2 ++ src/lammps.cpp | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 62f0df4181..5a74223353 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -34,6 +34,8 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) kokkos_exists = 1; lmp->kokkos = this; + delete memory; + memory = new MemoryKokkos(lmp); memoryKK = (MemoryKokkos*) memory; auto_sync = 1; diff --git a/src/lammps.cpp b/src/lammps.cpp index 65a833d8ee..bde7ca035d 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -472,9 +472,6 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) kokkos = NULL; if (kokkosflag == 1) { - delete memory; - memory = new MemoryKokkos(this); - kokkos = new KokkosLMP(this,kklast-kkfirst,&arg[kkfirst]); if (!kokkos->kokkos_exists) error->all(FLERR,"Cannot use -kokkos on without KOKKOS installed"); From c4e83be5336b35a73b76eb09202da09b2c2e85c8 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Thu, 7 Dec 2017 08:42:17 -0700 Subject: [PATCH 33/34] Fix compile error in pair_yukawa_kokkos --- src/KOKKOS/pair_yukawa_kokkos.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 6d675ed2b8..6560ec9684 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -28,7 +28,7 @@ #include "integrate.h" #include "respa.h" #include "math_const.h" -#include "memory.h" +#include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" @@ -58,8 +58,8 @@ template PairYukawaKokkos::~PairYukawaKokkos() { if (allocated) { - memory->destroy_kokkos(k_eatom,eatom); - memory->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); eatom = NULL; @@ -90,7 +90,7 @@ void PairYukawaKokkos::allocate() int n = atom->ntypes; memory->destroy(cutsq); - memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); k_params = Kokkos::DualView( @@ -183,13 +183,13 @@ void PairYukawaKokkos::compute(int eflag_in, int vflag_in) // reallocate per-atom arrays if necessary if (eflag_atom) { - memory->destroy_kokkos(k_eatom,eatom); - memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); d_eatom = k_eatom.view(); } if (vflag_atom) { - memory->destroy_kokkos(k_vatom,vatom); - memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom"); d_vatom = k_vatom.view(); } From 3e99d1a83a974c5ce6d33319f9fd67d9f06ce5f6 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Thu, 7 Dec 2017 09:06:33 -0700 Subject: [PATCH 34/34] Add pair yukawa/kk to Section_commands --- doc/src/Section_commands.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Section_commands.txt b/doc/src/Section_commands.txt index 6beae0b2c0..22723c9a51 100644 --- a/doc/src/Section_commands.txt +++ b/doc/src/Section_commands.txt @@ -1023,7 +1023,7 @@ KOKKOS, o = USER-OMP, t = OPT. "tri/lj"_pair_tri_lj.html, "vashishta (ko)"_pair_vashishta.html, "vashishta/table (o)"_pair_vashishta.html, -"yukawa (go)"_pair_yukawa.html, +"yukawa (gok)"_pair_yukawa.html, "yukawa/colloid (go)"_pair_yukawa_colloid.html, "zbl (go)"_pair_zbl.html :tb(c=4,ea=c)