forked from lijiext/lammps
Merge pull request #366 from rbberger/kokkos_lammps_bigbig_fix
Fix data type of molecule array in npair_kokkos.h
This commit is contained in:
commit
6ca377436f
|
@ -957,10 +957,10 @@ struct AtomVecAngleKokkos_UnpackBorder {
|
|||
_x(i+_first,0) = _buf(i,0);
|
||||
_x(i+_first,1) = _buf(i,1);
|
||||
_x(i+_first,2) = _buf(i,2);
|
||||
_tag(i+_first) = static_cast<int> (_buf(i,3));
|
||||
_tag(i+_first) = static_cast<tagint> (_buf(i,3));
|
||||
_type(i+_first) = static_cast<int> (_buf(i,4));
|
||||
_mask(i+_first) = static_cast<int> (_buf(i,5));
|
||||
_molecule(i+_first) = static_cast<int> (_buf(i,6));
|
||||
_molecule(i+_first) = static_cast<tagint> (_buf(i,6));
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -836,7 +836,7 @@ struct AtomVecAtomicKokkos_UnpackBorder {
|
|||
_x(i+_first,0) = _buf(i,0);
|
||||
_x(i+_first,1) = _buf(i,1);
|
||||
_x(i+_first,2) = _buf(i,2);
|
||||
_tag(i+_first) = static_cast<int> (_buf(i,3));
|
||||
_tag(i+_first) = static_cast<tagint> (_buf(i,3));
|
||||
_type(i+_first) = static_cast<int> (_buf(i,4));
|
||||
_mask(i+_first) = static_cast<int> (_buf(i,5));
|
||||
// printf("%i %i %lf %lf %lf %i BORDER\n",_tag(i+_first),i+_first,_x(i+_first,0),_x(i+_first,1),_x(i+_first,2),_type(i+_first));
|
||||
|
|
|
@ -905,10 +905,10 @@ struct AtomVecBondKokkos_UnpackBorder {
|
|||
_x(i+_first,0) = _buf(i,0);
|
||||
_x(i+_first,1) = _buf(i,1);
|
||||
_x(i+_first,2) = _buf(i,2);
|
||||
_tag(i+_first) = static_cast<int> (_buf(i,3));
|
||||
_tag(i+_first) = static_cast<tagint> (_buf(i,3));
|
||||
_type(i+_first) = static_cast<int> (_buf(i,4));
|
||||
_mask(i+_first) = static_cast<int> (_buf(i,5));
|
||||
_molecule(i+_first) = static_cast<int> (_buf(i,6));
|
||||
_molecule(i+_first) = static_cast<tagint> (_buf(i,6));
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -872,7 +872,7 @@ struct AtomVecChargeKokkos_UnpackBorder {
|
|||
_x(i+_first,0) = _buf(i,0);
|
||||
_x(i+_first,1) = _buf(i,1);
|
||||
_x(i+_first,2) = _buf(i,2);
|
||||
_tag(i+_first) = static_cast<int> (_buf(i,3));
|
||||
_tag(i+_first) = static_cast<tagint> (_buf(i,3));
|
||||
_type(i+_first) = static_cast<int> (_buf(i,4));
|
||||
_mask(i+_first) = static_cast<int> (_buf(i,5));
|
||||
_q(i+_first) = _buf(i,6);
|
||||
|
|
|
@ -1029,10 +1029,10 @@ struct AtomVecMolecularKokkos_UnpackBorder {
|
|||
_x(i+_first,0) = _buf(i,0);
|
||||
_x(i+_first,1) = _buf(i,1);
|
||||
_x(i+_first,2) = _buf(i,2);
|
||||
_tag(i+_first) = static_cast<int> (_buf(i,3));
|
||||
_tag(i+_first) = static_cast<tagint> (_buf(i,3));
|
||||
_type(i+_first) = static_cast<int> (_buf(i,4));
|
||||
_mask(i+_first) = static_cast<int> (_buf(i,5));
|
||||
_molecule(i+_first) = static_cast<int> (_buf(i,6));
|
||||
_molecule(i+_first) = static_cast<tagint> (_buf(i,6));
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -250,7 +250,7 @@ struct DomainPBCFunctor {
|
|||
x(i,0) += period[0];
|
||||
if (DEFORM_VREMAP && (mask[i] & deform_groupbit)) v(i,0) += h_rate[0];
|
||||
imageint idim = image[i] & IMGMASK;
|
||||
const int otherdims = image[i] ^ idim;
|
||||
const imageint otherdims = image[i] ^ idim;
|
||||
idim--;
|
||||
idim &= IMGMASK;
|
||||
image[i] = otherdims | idim;
|
||||
|
@ -260,7 +260,7 @@ struct DomainPBCFunctor {
|
|||
x(i,0) = MAX(x(i,0),lo[0]);
|
||||
if (DEFORM_VREMAP && (mask[i] & deform_groupbit)) v(i,0) -= h_rate[0];
|
||||
imageint idim = image[i] & IMGMASK;
|
||||
const int otherdims = image[i] ^ idim;
|
||||
const imageint otherdims = image[i] ^ idim;
|
||||
idim++;
|
||||
idim &= IMGMASK;
|
||||
image[i] = otherdims | idim;
|
||||
|
|
|
@ -387,7 +387,7 @@ KOKKOS_INLINE_FUNCTION
|
|||
void FixQEqReaxKokkos<DeviceType>::compute_h_item(int ii, int &m_fill, const bool &final) const
|
||||
{
|
||||
const int i = d_ilist[ii];
|
||||
int j,jj,jtag,jtype,flag;
|
||||
int j,jj,jtype,flag;
|
||||
|
||||
if (mask[i] & groupbit) {
|
||||
|
||||
|
@ -395,7 +395,7 @@ void FixQEqReaxKokkos<DeviceType>::compute_h_item(int ii, int &m_fill, const boo
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const int jnum = d_numneigh[i];
|
||||
if (final)
|
||||
d_firstnbr[i] = m_fill;
|
||||
|
@ -403,7 +403,6 @@ void FixQEqReaxKokkos<DeviceType>::compute_h_item(int ii, int &m_fill, const boo
|
|||
for (jj = 0; jj < jnum; jj++) {
|
||||
j = d_neighbors(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
|
||||
jtype = type(j);
|
||||
|
||||
const X_FLOAT delx = x(j,0) - xtmp;
|
||||
|
@ -411,10 +410,11 @@ void FixQEqReaxKokkos<DeviceType>::compute_h_item(int ii, int &m_fill, const boo
|
|||
const X_FLOAT delz = x(j,2) - ztmp;
|
||||
|
||||
if (neighflag != FULL) {
|
||||
const tagint jtag = tag(j);
|
||||
flag = 0;
|
||||
if (j < nlocal) flag = 1;
|
||||
else if (tag[i] < tag[j]) flag = 1;
|
||||
else if (tag[i] == tag[j]) {
|
||||
else if (itag < jtag) flag = 1;
|
||||
else if (itag == jtag) {
|
||||
if (delz > SMALL) flag = 1;
|
||||
else if (fabs(delz) < SMALL) {
|
||||
if (dely > SMALL) flag = 1;
|
||||
|
|
|
@ -159,7 +159,8 @@ class FixQEqReaxKokkos : public FixQEqReax {
|
|||
//typename ArrayTypes<DeviceType>::t_float_1d_randomread mass, q;
|
||||
typename ArrayTypes<DeviceType>::t_float_1d_randomread mass;
|
||||
typename ArrayTypes<DeviceType>::t_float_1d q;
|
||||
typename ArrayTypes<DeviceType>::t_int_1d type, tag, mask;
|
||||
typename ArrayTypes<DeviceType>::t_int_1d type, mask;
|
||||
typename ArrayTypes<DeviceType>::t_tagint_1d tag;
|
||||
|
||||
DAT::tdual_float_1d k_q;
|
||||
typename AT::t_float_1d d_q;
|
||||
|
|
|
@ -76,7 +76,6 @@ void FixReaxCBondsKokkos::init()
|
|||
void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint ntimestep, FILE *fp)
|
||||
|
||||
{
|
||||
int i, j;
|
||||
int nbuf_local;
|
||||
int nlocal_max, numbonds, numbonds_max;
|
||||
double *buf;
|
||||
|
|
|
@ -157,7 +157,8 @@ class NeighborKokkosExecute
|
|||
// data from Atom class
|
||||
|
||||
const typename AT::t_x_array_randomread x;
|
||||
const typename AT::t_int_1d_const type,mask,molecule;
|
||||
const typename AT::t_int_1d_const type,mask;
|
||||
const typename AT::t_tagint_1d_const molecule;
|
||||
const typename AT::t_tagint_1d_const tag;
|
||||
const typename AT::t_tagint_2d_const special;
|
||||
const typename AT::t_int_2d_const nspecial;
|
||||
|
@ -194,7 +195,7 @@ class NeighborKokkosExecute
|
|||
const typename AT::t_x_array_randomread &_x,
|
||||
const typename AT::t_int_1d_const &_type,
|
||||
const typename AT::t_int_1d_const &_mask,
|
||||
const typename AT::t_int_1d_const &_molecule,
|
||||
const typename AT::t_tagint_1d_const &_molecule,
|
||||
const typename AT::t_tagint_1d_const &_tag,
|
||||
const typename AT::t_tagint_2d_const &_special,
|
||||
const typename AT::t_int_2d_const &_nspecial,
|
||||
|
|
|
@ -1046,7 +1046,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeLJCoulomb<NEIGHFLAG,
|
|||
const X_FLOAT ztmp = x(i,2);
|
||||
const F_FLOAT qi = q(i);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const int jnum = d_numneigh[i];
|
||||
|
||||
F_FLOAT fxtmp, fytmp, fztmp;
|
||||
|
@ -1056,7 +1056,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeLJCoulomb<NEIGHFLAG,
|
|||
int j = d_neighbors(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const int jtype = type(j);
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
const F_FLOAT qj = q(j);
|
||||
|
||||
if (NEIGHFLAG != FULL) {
|
||||
|
@ -1201,7 +1201,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeTabulatedLJCoulomb<N
|
|||
const X_FLOAT ztmp = x(i,2);
|
||||
const F_FLOAT qi = q(i);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const int jnum = d_numneigh[i];
|
||||
|
||||
F_FLOAT fxtmp, fytmp, fztmp;
|
||||
|
@ -1211,7 +1211,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeTabulatedLJCoulomb<N
|
|||
int j = d_neighbors(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const int jtype = type(j);
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
const F_FLOAT qj = q(j);
|
||||
|
||||
if (NEIGHFLAG != FULL) {
|
||||
|
@ -1580,7 +1580,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxBuildListsHalf<NEIGHFLAG>,
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const int jnum = d_numneigh[i];
|
||||
|
||||
F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[3], dBOp_i[3], dln_BOp_pi_i[3], dln_BOp_pi2_i[3];
|
||||
|
@ -1605,7 +1605,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxBuildListsHalf<NEIGHFLAG>,
|
|||
for (int jj = 0; jj < jnum; jj++) {
|
||||
int j = d_neighbors(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
d_bo_first[j] = j*maxbo;
|
||||
d_hb_first[j] = j*maxhb;
|
||||
|
@ -1802,7 +1802,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxBuildListsHalf_LessAtomics<
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const int jnum = d_numneigh[i];
|
||||
|
||||
F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[3];
|
||||
|
@ -1826,7 +1826,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxBuildListsHalf_LessAtomics<
|
|||
for (int jj = 0; jj < jnum; jj++) {
|
||||
int j = d_neighbors(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
d_bo_first[j] = j*maxbo;
|
||||
d_hb_first[j] = j*maxhb;
|
||||
|
@ -2752,7 +2752,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeTorsion<NEIGHFLAG,EV
|
|||
|
||||
const int i = d_ilist[ii];
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const X_FLOAT xtmp = x(i,0);
|
||||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
|
@ -2768,7 +2768,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeTorsion<NEIGHFLAG,EV
|
|||
for (int jj = j_start; jj < j_end; jj++) {
|
||||
int j = d_bo_list[jj];
|
||||
j &= NEIGHMASK;
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
const int jtype = type(j);
|
||||
const int j_index = jj - j_start;
|
||||
|
||||
|
@ -3113,7 +3113,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeHydrogen<NEIGHFLAG,E
|
|||
const X_FLOAT xtmp = x(i,0);
|
||||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
|
||||
const int j_start = d_bo_first[i];
|
||||
const int j_end = j_start + d_bo_num[i];
|
||||
|
@ -3140,7 +3140,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeHydrogen<NEIGHFLAG,E
|
|||
for (int kk = k_start; kk < k_end; kk++) {
|
||||
int k = d_hb_list[kk];
|
||||
k &= NEIGHMASK;
|
||||
const int ktag = tag(k);
|
||||
const tagint ktag = tag(k);
|
||||
const int ktype = type(k);
|
||||
|
||||
delik[0] = x(k,0) - xtmp;
|
||||
|
@ -3153,7 +3153,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeHydrogen<NEIGHFLAG,E
|
|||
const int jj = hblist[itr];
|
||||
int j = d_bo_list[jj];
|
||||
j &= NEIGHMASK;
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
if (jtag == ktag) continue;
|
||||
|
||||
const int jtype = type(j);
|
||||
|
@ -3247,14 +3247,14 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxUpdateBond<NEIGHFLAG>, cons
|
|||
Kokkos::View<F_FLOAT**, typename DAT::t_ffloat_2d_dl::array_layout,DeviceType,Kokkos::MemoryTraits<AtomicF<NEIGHFLAG>::value> > a_Cdbopi2 = d_Cdbopi2;
|
||||
|
||||
const int i = d_ilist[ii];
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const int j_start = d_bo_first[i];
|
||||
const int j_end = j_start + d_bo_num[i];
|
||||
|
||||
for (int jj = j_start; jj < j_end; jj++) {
|
||||
int j = d_bo_list[jj];
|
||||
j &= NEIGHMASK;
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
const int j_index = jj - j_start;
|
||||
const F_FLOAT Cdbo_i = d_Cdbo(i,j_index);
|
||||
const F_FLOAT Cdbopi_i = d_Cdbopi(i,j_index);
|
||||
|
@ -3302,7 +3302,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeBond1<NEIGHFLAG,EVFL
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const F_FLOAT imass = paramssing(itype).mass;
|
||||
const F_FLOAT val_i = paramssing(itype).valency;
|
||||
const int j_start = d_bo_first[i];
|
||||
|
@ -3313,7 +3313,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeBond1<NEIGHFLAG,EVFL
|
|||
for (int jj = j_start; jj < j_end; jj++) {
|
||||
int j = d_bo_list[jj];
|
||||
j &= NEIGHMASK;
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
|
@ -3438,7 +3438,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeBond2<NEIGHFLAG,EVFL
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
const F_FLOAT imass = paramssing(itype).mass;
|
||||
const F_FLOAT val_i = paramssing(itype).valency;
|
||||
const int j_start = d_bo_first[i];
|
||||
|
@ -3451,7 +3451,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeBond2<NEIGHFLAG,EVFL
|
|||
for (int jj = j_start; jj < j_end; jj++) {
|
||||
int j = d_bo_list[jj];
|
||||
j &= NEIGHMASK;
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
|
|
|
@ -314,7 +314,7 @@ void PairTersoffKokkos<DeviceType>::operator()(TagPairTersoffComputeHalf<NEIGHFL
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
|
||||
F_FLOAT fi[3], fj[3], fk[3];
|
||||
|
||||
|
@ -331,7 +331,7 @@ void PairTersoffKokkos<DeviceType>::operator()(TagPairTersoffComputeHalf<NEIGHFL
|
|||
int j = d_neighbors_short(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const int jtype = type(j);
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
|
|
|
@ -314,7 +314,7 @@ void PairTersoffMODKokkos<DeviceType>::operator()(TagPairTersoffMODComputeHalf<N
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const int tagitag = tag(i);
|
||||
|
||||
F_FLOAT fi[3], fj[3], fk[3];
|
||||
|
||||
|
@ -331,7 +331,7 @@ void PairTersoffMODKokkos<DeviceType>::operator()(TagPairTersoffMODComputeHalf<N
|
|||
int j = d_neighbors_short(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const int jtype = type(j);
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
|
|
|
@ -328,7 +328,7 @@ void PairTersoffZBLKokkos<DeviceType>::operator()(TagPairTersoffZBLComputeHalf<N
|
|||
const X_FLOAT ytmp = x(i,1);
|
||||
const X_FLOAT ztmp = x(i,2);
|
||||
const int itype = type(i);
|
||||
const int itag = tag(i);
|
||||
const tagint itag = tag(i);
|
||||
|
||||
F_FLOAT fi[3], fj[3], fk[3];
|
||||
|
||||
|
@ -345,7 +345,7 @@ void PairTersoffZBLKokkos<DeviceType>::operator()(TagPairTersoffZBLComputeHalf<N
|
|||
int j = d_neighbors_short(i,jj);
|
||||
j &= NEIGHMASK;
|
||||
const int jtype = type(j);
|
||||
const int jtag = tag(j);
|
||||
const tagint jtag = tag(j);
|
||||
|
||||
if (itag > jtag) {
|
||||
if ((itag+jtag) % 2 == 0) continue;
|
||||
|
|
Loading…
Reference in New Issue