From efaa4c67109fb75e03699d2d7294005810fb776e Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 7 Mar 2017 09:31:12 -0700 Subject: [PATCH] new neigh_modify exclude option, other SNAP changes --- doc/src/compute_voronoi_atom.txt | 4 ++++ doc/src/neigh_modify.txt | 20 +++++++++++-------- examples/USER/misc/gauss-diel/in.gauss-diel | 2 +- .../USER/misc/gauss-diel/in.gauss-diel-cg | 2 +- .../USER/misc/gauss-diel/in.gauss-diel-split | 2 +- examples/rigid/in.rigid.tnr | 2 +- .../snap/Ta06A.snap | 0 .../snap/W_2940_2017_2.snap | 2 +- examples/snap/W_2940_2017_2.snapcoeff | 2 +- examples/snap/W_2940_2017_2.snapparam | 2 +- ...ePair.pot => W_2940_2017_2_He_JW2013.snap} | 2 +- examples/snap/in.snap.Ta06A | 2 +- examples/snap/in.snap.W.2940 | 2 +- examples/snap/in.snap.hybrid.WSNAP.HePair | 2 +- .../Ta06A_pot.snap => potentials/Ta06A.snap | 6 +++--- .../W_2940_2017_2.snap | 2 +- potentials/W_2940_2017_2.snapcoeff | 2 +- potentials/W_2940_2017_2.snapparam | 2 +- ...ePair.pot => W_2940_2017_2_He_JW2013.snap} | 2 +- src/GPU/README | 13 ++++++++---- src/KIM/README | 2 -- src/KOKKOS/neighbor_kokkos.cpp | 15 ++++++++++++++ src/KOKKOS/neighbor_kokkos.h | 3 +++ src/KOKKOS/npair_kokkos.cpp | 11 ++++++++-- src/KOKKOS/npair_kokkos.h | 4 ++++ src/MAKE/OPTIONS/Makefile.omp | 2 +- src/RIGID/fix_shake.cpp | 3 +-- src/SNAP/sna.cpp | 2 +- src/neighbor.cpp | 16 ++++++++++++--- src/neighbor.h | 3 +++ src/npair.cpp | 14 +++++++++++-- src/npair.h | 4 +++- 32 files changed, 108 insertions(+), 44 deletions(-) rename potentials/Ta06A_pot.snap => examples/snap/Ta06A.snap (100%) rename potentials/W_2940_2017_2.pot.snap => examples/snap/W_2940_2017_2.snap (77%) rename examples/snap/{W.SNAP_HePair.pot => W_2940_2017_2_He_JW2013.snap} (82%) rename examples/snap/Ta06A_pot.snap => potentials/Ta06A.snap (86%) rename examples/snap/W_2940_2017_2.pot.snap => potentials/W_2940_2017_2.snap (77%) rename potentials/{W.SNAP_HePair.pot => W_2940_2017_2_He_JW2013.snap} (82%) diff --git a/doc/src/compute_voronoi_atom.txt b/doc/src/compute_voronoi_atom.txt index ea573a1356..d084fcee66 100644 --- a/doc/src/compute_voronoi_atom.txt +++ b/doc/src/compute_voronoi_atom.txt @@ -217,6 +217,10 @@ This compute is part of the VORONOI package. It is only enabled if LAMMPS was built with that package. See the "Making LAMMPS"_Section_start.html#start_3 section for more info. +It also requiers you have a copy of the Voro++ library built and +installed on your system. See instructions on obtaining and +installing the Voro++ software in the src/VORONOI/README file. + [Related commands:] "dump custom"_dump.html, "dump local"_dump.html diff --git a/doc/src/neigh_modify.txt b/doc/src/neigh_modify.txt index c16b667f7d..5c149d892d 100644 --- a/doc/src/neigh_modify.txt +++ b/doc/src/neigh_modify.txt @@ -34,8 +34,10 @@ keyword = {delay} or {every} or {check} or {once} or {cluster} or {include} or { M,N = exclude if one atom in pair is type M, other is type N group group1-ID group2-ID group1-ID,group2-ID = exclude if one atom is in 1st group, other in 2nd - molecule group-ID - groupname = exclude if both atoms are in the same molecule and in the same group + molecule/intra group-ID + group-ID = exclude if both atoms are in the same molecule and in group + molecule/inter group-ID + group-ID = exclude if both atoms are in different molecules and in group none delete all exclude settings {page} value = N @@ -52,7 +54,7 @@ neigh_modify every 2 delay 10 check yes page 100000 neigh_modify exclude type 2 3 neigh_modify exclude group frozen frozen check no neigh_modify exclude group residue1 chain3 -neigh_modify exclude molecule rigid :pre +neigh_modify exclude molecule/intra rigid :pre [Description:] @@ -130,9 +132,11 @@ The {exclude type} option turns off the pairwise interaction if one atom is of type M and the other of type N. M can equal N. The {exclude group} option turns off the interaction if one atom is in the first group and the other is the second. Group1-ID can equal -group2-ID. The {exclude molecule} option turns off the interaction if -both atoms are in the specified group and in the same molecule, as -determined by their molecule ID. +group2-ID. The {exclude molecule/intra} option turns off the +interaction if both atoms are in the specified group and in the same +molecule, as determined by their molecule ID. The {exclude +molecule/inter} turns off the interaction between pairs of atoms that +have different molecule IDs and are both in the specified group. Each of the exclude options can be specified multiple times. The {exclude type} option is the most efficient option to use; it requires @@ -195,8 +199,8 @@ binsize of 1/2 the cutoff. If the "delay" setting is non-zero, then it must be a multiple of the "every" setting. -The exclude molecule option can only be used with atom styles that -define molecule IDs. +The molecule/intra and molecule/inter exclude options can only be used +with atom styles that define molecule IDs. The value of the {page} setting must be at least 10x larger than the {one} setting. This insures neighbor pages are not mostly empty diff --git a/examples/USER/misc/gauss-diel/in.gauss-diel b/examples/USER/misc/gauss-diel/in.gauss-diel index 3e2be5b4d6..5aa7ae7157 100644 --- a/examples/USER/misc/gauss-diel/in.gauss-diel +++ b/examples/USER/misc/gauss-diel/in.gauss-diel @@ -81,7 +81,7 @@ group sds subtract all cions velocity all create 1. 87287 dist gaussian neighbor 1.5 multi -neigh_modify exclude molecule sds +neigh_modify exclude molecule/intra sds neigh_modify every 5 delay 0 check yes fix 1 all nve/limit 0.2 diff --git a/examples/USER/misc/gauss-diel/in.gauss-diel-cg b/examples/USER/misc/gauss-diel/in.gauss-diel-cg index ed21016220..51032c3d32 100644 --- a/examples/USER/misc/gauss-diel/in.gauss-diel-cg +++ b/examples/USER/misc/gauss-diel/in.gauss-diel-cg @@ -81,7 +81,7 @@ group sds subtract all cions velocity all create 1. 87287 dist gaussian neighbor 1.5 multi -neigh_modify exclude molecule sds +neigh_modify exclude molecule/intra sds neigh_modify every 5 delay 0 check yes fix 1 all nve/limit 0.2 diff --git a/examples/USER/misc/gauss-diel/in.gauss-diel-split b/examples/USER/misc/gauss-diel/in.gauss-diel-split index f13859863b..b6a17371d1 100644 --- a/examples/USER/misc/gauss-diel/in.gauss-diel-split +++ b/examples/USER/misc/gauss-diel/in.gauss-diel-split @@ -84,7 +84,7 @@ group sds subtract all cions velocity all create 1. 87287 dist gaussian neighbor 1.5 multi -neigh_modify exclude molecule sds +neigh_modify exclude molecule/intra sds neigh_modify every 5 delay 0 check yes fix 1 all nve/limit 0.2 diff --git a/examples/rigid/in.rigid.tnr b/examples/rigid/in.rigid.tnr index 6be5ba529c..7d8d74b3cb 100644 --- a/examples/rigid/in.rigid.tnr +++ b/examples/rigid/in.rigid.tnr @@ -20,7 +20,7 @@ velocity all create 1.4 109345 group rods type 2 group tethers subtract all rods -neigh_modify exclude molecule rods delay 0 every 1 +neigh_modify exclude molecule/intra rods delay 0 every 1 # Specify the pair potentials diff --git a/potentials/Ta06A_pot.snap b/examples/snap/Ta06A.snap similarity index 100% rename from potentials/Ta06A_pot.snap rename to examples/snap/Ta06A.snap diff --git a/potentials/W_2940_2017_2.pot.snap b/examples/snap/W_2940_2017_2.snap similarity index 77% rename from potentials/W_2940_2017_2.pot.snap rename to examples/snap/W_2940_2017_2.snap index ea98d65c9e..51eee41a0a 100644 --- a/potentials/W_2940_2017_2.pot.snap +++ b/examples/snap/W_2940_2017_2.snap @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # Definition of SNAP+ZBL potential. variable zblcutinner equal 4 diff --git a/examples/snap/W_2940_2017_2.snapcoeff b/examples/snap/W_2940_2017_2.snapcoeff index 98a5c50635..dcfea3feaf 100644 --- a/examples/snap/W_2940_2017_2.snapcoeff +++ b/examples/snap/W_2940_2017_2.snapcoeff @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # LAMMPS SNAP coefficients for W diff --git a/examples/snap/W_2940_2017_2.snapparam b/examples/snap/W_2940_2017_2.snapparam index 7ff57c905d..e0b20005e6 100644 --- a/examples/snap/W_2940_2017_2.snapparam +++ b/examples/snap/W_2940_2017_2.snapparam @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # required rcutfac 4.73442 diff --git a/examples/snap/W.SNAP_HePair.pot b/examples/snap/W_2940_2017_2_He_JW2013.snap similarity index 82% rename from examples/snap/W.SNAP_HePair.pot rename to examples/snap/W_2940_2017_2_He_JW2013.snap index eb5ee4dfbe..45a31955b3 100644 --- a/examples/snap/W.SNAP_HePair.pot +++ b/examples/snap/W_2940_2017_2_He_JW2013.snap @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # Definition of SNAP+ZBL+Tabulated potential. variable zblcutinner equal 4 diff --git a/examples/snap/in.snap.Ta06A b/examples/snap/in.snap.Ta06A index fc0b122948..38a24b8c06 100644 --- a/examples/snap/in.snap.Ta06A +++ b/examples/snap/in.snap.Ta06A @@ -24,7 +24,7 @@ mass 1 180.88 # choose potential -include Ta06A_pot.snap +include Ta06A.snap # Setup output diff --git a/examples/snap/in.snap.W.2940 b/examples/snap/in.snap.W.2940 index 7d81b4c78e..e1abf861e6 100644 --- a/examples/snap/in.snap.W.2940 +++ b/examples/snap/in.snap.W.2940 @@ -24,7 +24,7 @@ mass 1 183.84 # choose potential -include W_2940_2017_2.pot.snap +include W_2940_2017_2.snap # Setup output diff --git a/examples/snap/in.snap.hybrid.WSNAP.HePair b/examples/snap/in.snap.hybrid.WSNAP.HePair index d2710bca77..1f16fa64a2 100644 --- a/examples/snap/in.snap.hybrid.WSNAP.HePair +++ b/examples/snap/in.snap.hybrid.WSNAP.HePair @@ -27,7 +27,7 @@ group tungsten type 1 group helium type 2 # choose potential -include W.SNAP_HePair.pot +include W_2940_2017_2_He_JW2013.snap # Setup output diff --git a/examples/snap/Ta06A_pot.snap b/potentials/Ta06A.snap similarity index 86% rename from examples/snap/Ta06A_pot.snap rename to potentials/Ta06A.snap index 7c86c24641..edcc002524 100644 --- a/examples/snap/Ta06A_pot.snap +++ b/potentials/Ta06A.snap @@ -9,9 +9,9 @@ variable zblz equal 73 # Specify hybrid with SNAP, ZBL -pair_style hybrid/overlay snap & -zbl ${zblcutinner} ${zblcutouter} - +pair_style hybrid/overlay & +zbl ${zblcutinner} ${zblcutouter} & +snap pair_coeff 1 1 zbl ${zblz} ${zblz} pair_coeff * * snap Ta06A.snapcoeff Ta Ta06A.snapparam Ta diff --git a/examples/snap/W_2940_2017_2.pot.snap b/potentials/W_2940_2017_2.snap similarity index 77% rename from examples/snap/W_2940_2017_2.pot.snap rename to potentials/W_2940_2017_2.snap index ea98d65c9e..51eee41a0a 100644 --- a/examples/snap/W_2940_2017_2.pot.snap +++ b/potentials/W_2940_2017_2.snap @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # Definition of SNAP+ZBL potential. variable zblcutinner equal 4 diff --git a/potentials/W_2940_2017_2.snapcoeff b/potentials/W_2940_2017_2.snapcoeff index 98a5c50635..dcfea3feaf 100644 --- a/potentials/W_2940_2017_2.snapcoeff +++ b/potentials/W_2940_2017_2.snapcoeff @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # LAMMPS SNAP coefficients for W diff --git a/potentials/W_2940_2017_2.snapparam b/potentials/W_2940_2017_2.snapparam index 7ff57c905d..e0b20005e6 100644 --- a/potentials/W_2940_2017_2.snapparam +++ b/potentials/W_2940_2017_2.snapparam @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # required rcutfac 4.73442 diff --git a/potentials/W.SNAP_HePair.pot b/potentials/W_2940_2017_2_He_JW2013.snap similarity index 82% rename from potentials/W.SNAP_HePair.pot rename to potentials/W_2940_2017_2_He_JW2013.snap index eb5ee4dfbe..45a31955b3 100644 --- a/potentials/W.SNAP_HePair.pot +++ b/potentials/W_2940_2017_2_He_JW2013.snap @@ -1,4 +1,4 @@ -# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. "Quantum-Accurate Molecular Dynamics Potential for Tungsten" arXiv:1702.07042 [physics.comp-ph] # # Definition of SNAP+ZBL+Tabulated potential. variable zblcutinner equal 4 diff --git a/src/GPU/README b/src/GPU/README index ea1fa70285..792fc1a8b9 100644 --- a/src/GPU/README +++ b/src/GPU/README @@ -1,11 +1,16 @@ This package implements GPU optimizations of various LAMMPS styles. -This package uses an external library in lib/gpu which must be -compiled before making LAMMPS. See the lib/gpu/README file and the +Section 5.3.1 on the manual gives details of what hardware and Cuda +software is required on your system, and full details on how to build +and use this package. See the KOKKOS package, which also has +GPU-enabled styles. + +This package uses an external library provided in lib/gpu which must +be compiled before making LAMMPS. See the lib/gpu/README file and the LAMMPS manual for information on building LAMMPS with external libraries. The settings in the Makefile.lammps file in that directory must be correct for LAMMPS to build correctly with this package installed. -The people who created this package are Mike Brown (while at Sandia -and ORNL) and Trung Nguyen (while at ORNL). +The GPU package and its associated library was created by Mike Brown +while at Sandia and ORNL, and by Trung Nguyen while at ORNL. diff --git a/src/KIM/README b/src/KIM/README index e450d7dfd1..496db92cf2 100644 --- a/src/KIM/README +++ b/src/KIM/README @@ -1,5 +1,3 @@ --*- fill-column: 70; -*- - This package provides a pair_style kim command which is a wrapper on the Knowledge Base for Interatomic Models (KIM) repository of interatomic potentials, so that they can be used by LAMMPS scripts. diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index 2a85255e12..e40e6a238c 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -64,6 +64,7 @@ NeighborKokkos::~NeighborKokkos() 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); memory->destroy_kokkos(k_bondlist,bondlist); memory->destroy_kokkos(k_anglelist,anglelist); @@ -133,6 +134,14 @@ void NeighborKokkos::init_ex_mol_bit_kokkos() k_ex_mol_bit.modify(); } +/* ---------------------------------------------------------------------- */ + +void NeighborKokkos::grow_ex_mol_intra_kokkos() +{ + memory->grow_kokkos(k_ex_mol_intra, ex_mol_intra, maxex_mol, "neigh:ex_mol_intra"); + k_ex_mol_intra.modify(); +} + /* ---------------------------------------------------------------------- if any atom moved trigger distance (half of neighbor skin) return 1 shrink trigger distance if box size has changed @@ -348,6 +357,12 @@ void NeighborKokkos::modify_mol_group_grow_kokkos(){ 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"); + k_ex_mol_intra.modify(); +} + /* ---------------------------------------------------------------------- */ void NeighborKokkos::init_topology() { diff --git a/src/KOKKOS/neighbor_kokkos.h b/src/KOKKOS/neighbor_kokkos.h index 244de19dce..137c071e87 100644 --- a/src/KOKKOS/neighbor_kokkos.h +++ b/src/KOKKOS/neighbor_kokkos.h @@ -54,6 +54,7 @@ class NeighborKokkos : public Neighbor { DAT::tdual_int_1d k_ex1_bit,k_ex2_bit; DAT::tdual_int_1d k_ex_mol_group; DAT::tdual_int_1d k_ex_mol_bit; + DAT::tdual_int_1d k_ex_mol_intra; NeighBondKokkos neighbond_host; NeighBondKokkos neighbond_device; @@ -76,6 +77,7 @@ class NeighborKokkos : public Neighbor { void init_ex_type_kokkos(int); void init_ex_bit_kokkos(); void init_ex_mol_bit_kokkos(); + void grow_ex_mol_intra_kokkos(); virtual int check_distance(); template int check_distance_kokkos(); virtual void build(int); @@ -84,6 +86,7 @@ class NeighborKokkos : public Neighbor { void modify_ex_type_grow_kokkos(); void modify_ex_group_grow_kokkos(); void modify_mol_group_grow_kokkos(); + void modify_mol_intra_grow_kokkos(); }; } diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index f49e44c352..3614a82cfe 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -56,6 +56,7 @@ void NPairKokkos::copy_neighbor_info() k_ex2_bit = neighborKK->k_ex2_bit; k_ex_mol_group = neighborKK->k_ex_mol_group; k_ex_mol_bit = neighborKK->k_ex_mol_bit; + k_ex_mol_intra = neighborKK->k_ex_mol_intra; } /* ---------------------------------------------------------------------- @@ -147,6 +148,7 @@ void NPairKokkos::build(NeighList *list_) nex_mol, k_ex_mol_group.view(), k_ex_mol_bit.view(), + k_ex_mol_intra.view(), bboxhi,bboxlo, domain->xperiodic,domain->yperiodic,domain->zperiodic, domain->xprd_half,domain->yprd_half,domain->zprd_half); @@ -161,6 +163,7 @@ void NPairKokkos::build(NeighList *list_) k_ex2_bit.sync(); k_ex_mol_group.sync(); k_ex_mol_bit.sync(); + k_ex_mol_intra.sync(); k_bincount.sync(), k_bins.sync(), atomKK->sync(Device,X_MASK|TYPE_MASK|MASK_MASK|MOLECULE_MASK|TAG_MASK|SPECIAL_MASK); @@ -284,8 +287,12 @@ int NeighborKokkosExecute::exclusion(const int &i,const int &j, if (nex_mol) { for (m = 0; m < nex_mol; m++) - if (mask(i) & ex_mol_bit(m) && mask(j) & ex_mol_bit(m) && - molecule(i) == molecule(j)) return 1; + if (ex_mol_intra[m]) { // intra-chain: exclude i-j pair if on same molecule + if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] && + molecule[i] == molecule[j]) return 1; + } else // exclude i-j pair if on different molecules + if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] && + molecule[i] != molecule[j]) return 1; } return 0; diff --git a/src/KOKKOS/npair_kokkos.h b/src/KOKKOS/npair_kokkos.h index 54726cb971..52cdfe0d53 100644 --- a/src/KOKKOS/npair_kokkos.h +++ b/src/KOKKOS/npair_kokkos.h @@ -98,6 +98,7 @@ class NPairKokkos : public NPair { DAT::tdual_int_1d k_ex1_bit,k_ex2_bit; DAT::tdual_int_1d k_ex_mol_group; DAT::tdual_int_1d k_ex_mol_bit; + DAT::tdual_int_1d k_ex_mol_intra; // data from NBin class @@ -139,6 +140,7 @@ class NeighborKokkosExecute const int nex_mol; const typename AT::t_int_1d_const ex_mol_group; const typename AT::t_int_1d_const ex_mol_bit; + const typename AT::t_int_1d_const ex_mol_intra; // data from NBin class @@ -216,6 +218,7 @@ class NeighborKokkosExecute const int & _nex_mol, const typename AT::t_int_1d_const & _ex_mol_group, const typename AT::t_int_1d_const & _ex_mol_bit, + const typename AT::t_int_1d_const & _ex_mol_intra, const X_FLOAT *_bboxhi, const X_FLOAT* _bboxlo, const int & _xperiodic, const int & _yperiodic, const int & _zperiodic, const int & _xprd_half, const int & _yprd_half, const int & _zprd_half): @@ -235,6 +238,7 @@ class NeighborKokkosExecute ex1_group(_ex1_group),ex2_group(_ex2_group), ex1_bit(_ex1_bit),ex2_bit(_ex2_bit),nex_mol(_nex_mol), ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit), + ex_mol_intra(_ex_mol_intra), xperiodic(_xperiodic),yperiodic(_yperiodic),zperiodic(_zperiodic), xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half) { diff --git a/src/MAKE/OPTIONS/Makefile.omp b/src/MAKE/OPTIONS/Makefile.omp index 5c25c8e41c..fd485d5416 100644 --- a/src/MAKE/OPTIONS/Makefile.omp +++ b/src/MAKE/OPTIONS/Makefile.omp @@ -7,7 +7,7 @@ SHELL = /bin/sh # specify flags and libraries needed for your compiler CC = mpicxx -CCFLAGS = -g -O3 -fopenmp +CCFLAGS = -g -O3 -restrict -fopenmp SHFLAGS = -fPIC DEPFLAGS = -M diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 5907a69b1f..6d5d470545 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -447,7 +447,6 @@ void FixShake::setup(int vflag) next_output = (ntimestep/output_every)*output_every + output_every; } else next_output = -1; - // set respa to 0 if verlet is used and to 1 otherwise if (strstr(update->integrate_style,"verlet")) @@ -476,7 +475,6 @@ void FixShake::setup(int vflag) // precalculate constraining forces for first integration step shake_end_of_step(vflag); - } /* ---------------------------------------------------------------------- @@ -592,6 +590,7 @@ void FixShake::post_force(int vflag) } // store vflag for coordinate_constraints_end_of_step() + vflag_post_force = vflag; } diff --git a/src/SNAP/sna.cpp b/src/SNAP/sna.cpp index ef93ce9ff6..8b16b89336 100644 --- a/src/SNAP/sna.cpp +++ b/src/SNAP/sna.cpp @@ -815,7 +815,7 @@ void SNA::compute_dbidrj() // for mb1 = 0,...,j1mid // for ma1 = 0,...,j1 // zdb += - // Conj(dudr(j1,ma1,mb1))*z(j1,j2,j,ma1,mb1) + // Conj(dudr(j1,ma1,mb1))*z(j,j2,j1,ma1,mb1) // dbdr(j1,j2,j) += 2*zdb*(j+1)/(j1+1) // zdb = 0 // for mb2 = 0,...,j2mid diff --git a/src/neighbor.cpp b/src/neighbor.cpp index e0b84cc410..4941a3a22a 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -166,7 +166,7 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL) ex1_group = ex2_group = ex1_bit = ex2_bit = NULL; nex_mol = maxex_mol = 0; - ex_mol_group = ex_mol_bit = NULL; + ex_mol_group = ex_mol_bit = ex_mol_intra = NULL; // Kokkos setting @@ -234,6 +234,7 @@ Neighbor::~Neighbor() memory->destroy(ex_mol_group); delete [] ex_mol_bit; + memory->destroy(ex_mol_intra); } /* ---------------------------------------------------------------------- */ @@ -2323,7 +2324,8 @@ void Neighbor::modify_params(int narg, char **arg) nex_group++; iarg += 4; - } else if (strcmp(arg[iarg+1],"molecule") == 0) { + } else if (strcmp(arg[iarg+1],"molecule/inter") == 0 || + strcmp(arg[iarg+1],"molecule/intra") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command"); if (atom->molecule_flag == 0) error->all(FLERR,"Neigh_modify exclude molecule " @@ -2331,13 +2333,21 @@ void Neighbor::modify_params(int narg, char **arg) if (nex_mol == maxex_mol) { maxex_mol += EXDELTA; memory->grow(ex_mol_group,maxex_mol,"neigh:ex_mol_group"); + if (lmp->kokkos) + grow_ex_mol_intra_kokkos(); + else + memory->grow(ex_mol_intra,maxex_mol,"neigh:ex_mol_intra"); } ex_mol_group[nex_mol] = group->find(arg[iarg+2]); if (ex_mol_group[nex_mol] == -1) error->all(FLERR,"Invalid group ID in neigh_modify command"); + if (strcmp(arg[iarg+1],"molecule/intra") == 0) + ex_mol_intra[nex_mol] = 1; + else + ex_mol_intra[nex_mol] = 0; nex_mol++; iarg += 3; - + } else if (strcmp(arg[iarg+1],"none") == 0) { nex_type = nex_group = nex_mol = 0; iarg += 2; diff --git a/src/neighbor.h b/src/neighbor.h index 8e2fad1f1b..16a80b5991 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -71,6 +71,8 @@ class Neighbor : protected Pointers { int nex_mol; // # of entries in molecule exclusion list int *ex_mol_group; // molecule group #'s to exclude int *ex_mol_bit; // molecule group bits to exclude + int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) + // 1 = exclude if in same molecule (intra) // special info, used by NeighPair @@ -229,6 +231,7 @@ class Neighbor : protected Pointers { virtual void init_ex_type_kokkos(int) {} virtual void init_ex_bit_kokkos() {} virtual void init_ex_mol_bit_kokkos() {} + virtual void grow_ex_mol_intra_kokkos() {} }; namespace NeighConst { diff --git a/src/npair.cpp b/src/npair.cpp index 9fe326cbd1..6c3f8ac05e 100644 --- a/src/npair.cpp +++ b/src/npair.cpp @@ -86,6 +86,7 @@ void NPair::copy_neighbor_info() nex_mol = neighbor->nex_mol; ex_mol_group = neighbor->ex_mol_group; ex_mol_bit = neighbor->ex_mol_bit; + ex_mol_intra = neighbor->ex_mol_intra; // special info @@ -180,8 +181,17 @@ int NPair::exclusion(int i, int j, int itype, int jtype, if (nex_mol) { for (m = 0; m < nex_mol; m++) - if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] && - molecule[i] == molecule[j]) return 1; + + // intra-chain: exclude i-j pair if in same molecule + // inter-chain: exclude i-j pair if in different molecules + + if (ex_mol_intra[m]) { + if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] && + molecule[i] == molecule[j]) return 1; + } else { + if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] && + molecule[i] != molecule[j]) return 1; + } } return 0; diff --git a/src/npair.h b/src/npair.h index cdb8b3061d..8f2bcb13bc 100644 --- a/src/npair.h +++ b/src/npair.h @@ -61,8 +61,10 @@ class NPair : protected Pointers { int *ex1_bit,*ex2_bit; // pairs of group bits to exclude int nex_mol; // # of entries in molecule exclusion list - int *ex_mol_group; // molecule group #'s to exclude int *ex_mol_bit; // molecule group bits to exclude + int *ex_mol_group; // molecule group #'s to exclude + int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) + // 1 = exclude if in same molecule (intra) // special data from Neighbor class