diff --git a/src/USER-INTEL/angle_charmm_intel.cpp b/src/USER-INTEL/angle_charmm_intel.cpp index d55afd47427302169ec649f8a12bc1a9e6012681..031c9642000c22a6aa7f4156db319de5409fce6e 100644 --- a/src/USER-INTEL/angle_charmm_intel.cpp +++ b/src/USER-INTEL/angle_charmm_intel.cpp @@ -336,7 +336,7 @@ void AngleCharmmIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->nangletypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.fc[i].k = k[i]; fc.fc[i].theta0 = theta0[i]; fc.fc[i].k_ub = k_ub[i]; diff --git a/src/USER-INTEL/angle_harmonic_intel.cpp b/src/USER-INTEL/angle_harmonic_intel.cpp index 47e0add6906836e8549472b9018dd1d6cf6fd487..84220277d7a736131c30fa37d79fd93364e0c4ca 100644 --- a/src/USER-INTEL/angle_harmonic_intel.cpp +++ b/src/USER-INTEL/angle_harmonic_intel.cpp @@ -318,7 +318,7 @@ void AngleHarmonicIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->nangletypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.fc[i].k = k[i]; fc.fc[i].theta0 = theta0[i]; } diff --git a/src/USER-INTEL/bond_fene_intel.cpp b/src/USER-INTEL/bond_fene_intel.cpp index bb96135b2d7abeaf1e9a2b7990fae1fb17a314b0..93d64ed631f5466baec735c52a2770160b2eb8fb 100644 --- a/src/USER-INTEL/bond_fene_intel.cpp +++ b/src/USER-INTEL/bond_fene_intel.cpp @@ -295,7 +295,7 @@ void BondFENEIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->nbondtypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.fc[i].k = k[i]; fc.fc[i].ir0sq = 1.0 / (r0[i] * r0[i]); fc.fc[i].sigma = sigma[i]; diff --git a/src/USER-INTEL/bond_harmonic_intel.cpp b/src/USER-INTEL/bond_harmonic_intel.cpp index beb0ebcddaf52e1277859dad00fab1ce25a8aea3..0ac466f11386c99bef29b95a33e086349389239c 100644 --- a/src/USER-INTEL/bond_harmonic_intel.cpp +++ b/src/USER-INTEL/bond_harmonic_intel.cpp @@ -266,7 +266,7 @@ void BondHarmonicIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->nbondtypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.fc[i].k = k[i]; fc.fc[i].r0 = r0[i]; } diff --git a/src/USER-INTEL/dihedral_charmm_intel.cpp b/src/USER-INTEL/dihedral_charmm_intel.cpp index 715cef4d37c6a7b0f0e7afcfac57004ff02c9394..0e13e92251594d04348d98f2200c3501a5b29fd5 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.cpp +++ b/src/USER-INTEL/dihedral_charmm_intel.cpp @@ -942,8 +942,8 @@ void DihedralCharmmIntel::pack_force_const(ForceConst<flt_t> &fc, buffers->set_ntypes(tp1); if (weightflag) { - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.ljp[i][j].lj1 = lj14_1[i][j]; fc.ljp[i][j].lj2 = lj14_2[i][j]; fc.ljp[i][j].lj3 = lj14_3[i][j]; @@ -952,7 +952,7 @@ void DihedralCharmmIntel::pack_force_const(ForceConst<flt_t> &fc, } } - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.bp[i].multiplicity = multiplicity[i]; fc.bp[i].cos_shift = cos_shift[i]; fc.bp[i].sin_shift = sin_shift[i]; diff --git a/src/USER-INTEL/dihedral_harmonic_intel.cpp b/src/USER-INTEL/dihedral_harmonic_intel.cpp index 196b024fa62d9ed9e192ea9f4b7395b7173c206c..5d16b0da745425abd66617ab50043ef796d78db3 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.cpp +++ b/src/USER-INTEL/dihedral_harmonic_intel.cpp @@ -400,7 +400,7 @@ void DihedralHarmonicIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->ndihedraltypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.bp[i].multiplicity = multiplicity[i]; fc.bp[i].cos_shift = cos_shift[i]; fc.bp[i].sin_shift = sin_shift[i]; diff --git a/src/USER-INTEL/dihedral_opls_intel.cpp b/src/USER-INTEL/dihedral_opls_intel.cpp index 1abeba1d5ea5d71a6ed27033502c233a183c8a71..e290ab90616b94df0135264dcbbf66fe8546a36a 100644 --- a/src/USER-INTEL/dihedral_opls_intel.cpp +++ b/src/USER-INTEL/dihedral_opls_intel.cpp @@ -427,7 +427,7 @@ void DihedralOPLSIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->ndihedraltypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.bp[i].k1 = k1[i]; fc.bp[i].k2 = k2[i]; fc.bp[i].k3 = k3[i]; diff --git a/src/USER-INTEL/improper_cvff_intel.cpp b/src/USER-INTEL/improper_cvff_intel.cpp index dc9765d9130670ec7dd2e991dc8d936b66240142..39090e5a7420b3fd32598cbab2aca8a802e497b1 100644 --- a/src/USER-INTEL/improper_cvff_intel.cpp +++ b/src/USER-INTEL/improper_cvff_intel.cpp @@ -433,7 +433,7 @@ void ImproperCvffIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->nimpropertypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.fc[i].k = k[i]; fc.fc[i].sign = sign[i]; fc.fc[i].multiplicity = multiplicity[i]; diff --git a/src/USER-INTEL/improper_harmonic_intel.cpp b/src/USER-INTEL/improper_harmonic_intel.cpp index fe0efca5ec163d50f4a75643223f6c8df0980a95..3547061672cff079b53761f928761e746d637d8a 100644 --- a/src/USER-INTEL/improper_harmonic_intel.cpp +++ b/src/USER-INTEL/improper_harmonic_intel.cpp @@ -389,7 +389,7 @@ void ImproperHarmonicIntel::pack_force_const(ForceConst<flt_t> &fc, const int bp1 = atom->nimpropertypes + 1; fc.set_ntypes(bp1,memory); - for (int i = 0; i < bp1; i++) { + for (int i = 1; i < bp1; i++) { fc.fc[i].k = k[i]; fc.fc[i].chi = chi[i]; } diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h index d49d0d8b00a21bb139e4d7a417ce46f45e2edd56..068f61023edfd0b08a7a6d983b2ce059bab1e4cc 100644 --- a/src/USER-INTEL/intel_preprocess.h +++ b/src/USER-INTEL/intel_preprocess.h @@ -211,10 +211,9 @@ enum {TIME_PACK, TIME_HOST_NEIGHBOR, TIME_HOST_PAIR, TIME_OFFLOAD_NEIGHBOR, datasize); \ } -#define IP_PRE_omp_range_id_vec(ifrom, ito, tid, inum, \ - nthreads, vecsize) \ +#define IP_PRE_omp_range_vec(ifrom, ito, tid, inum, nthreads, \ + vecsize) \ { \ - tid = omp_get_thread_num(); \ int idelta = static_cast<int>(ceil(static_cast<float>(inum) \ /vecsize/nthreads)); \ idelta *= vecsize; \ @@ -223,6 +222,14 @@ enum {TIME_PACK, TIME_HOST_NEIGHBOR, TIME_HOST_PAIR, TIME_OFFLOAD_NEIGHBOR, if (ito > inum) ito = inum; \ } +#define IP_PRE_omp_range_id_vec(ifrom, ito, tid, inum, \ + nthreads, vecsize) \ + { \ + tid = omp_get_thread_num(); \ + IP_PRE_omp_range_vec(ifrom, ito, tid, inum, nthreads, \ + vecsize); \ + } + #define IP_PRE_omp_stride_id_vec(ifrom, ip, ito, tid, inum, \ nthr, vecsize) \ { \ @@ -235,13 +242,12 @@ enum {TIME_PACK, TIME_HOST_NEIGHBOR, TIME_HOST_PAIR, TIME_OFFLOAD_NEIGHBOR, int nd = nthr / INTEL_HTHREADS; \ int td = tid / INTEL_HTHREADS; \ int tm = tid % INTEL_HTHREADS; \ - IP_PRE_omp_range_id_vec(ifrom, ito, td, inum, nd, \ - vecsize); \ + IP_PRE_omp_range_vec(ifrom, ito, td, inum, nd, vecsize); \ ifrom += tm * vecsize; \ ip = INTEL_HTHREADS * vecsize; \ } else { \ - IP_PRE_omp_range_id_vec(ifrom, ito, tid, inum, nthr, \ - vecsize); \ + IP_PRE_omp_range_vec(ifrom, ito, tid, inum, nthr, \ + vecsize); \ ip = vecsize; \ } \ } diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp index 07beae1e41683d781b2f80df9dbe2e1d790c66cb..e32fd066607fff224be9bcf2d606c4472864220e 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp @@ -458,8 +458,8 @@ void PairBuckCoulCutIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.c_cut[i][j].cutsq = cutsq[i][j]; fc.c_cut[i][j].cut_ljsq = cut_ljsq[i][j]; fc.c_cut[i][j].cut_coulsq = cut_coulsq[i][j]; diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.cpp b/src/USER-INTEL/pair_buck_coul_long_intel.cpp index 995e2e85839d3503fdefd8cc9100a7d49a78f19c..2b9fea7a50f80c0298069d976c3211d47bffc12e 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_long_intel.cpp @@ -545,8 +545,8 @@ void PairBuckCoulLongIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { if (cutsq[i][j] < cut_ljsq[i][j]) error->all(FLERR, "Intel variant of lj/buck/coul/long expects lj cutoff<=coulombic"); diff --git a/src/USER-INTEL/pair_buck_intel.cpp b/src/USER-INTEL/pair_buck_intel.cpp index 8c63d2e62d5d9a419ec627d9da01bbf64cfd77a3..05a28eb7f05b71e3df46b4403ae6971b70351295 100644 --- a/src/USER-INTEL/pair_buck_intel.cpp +++ b/src/USER-INTEL/pair_buck_intel.cpp @@ -413,8 +413,8 @@ void PairBuckIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.c_force[i][j].buck1 = buck1[i][j]; fc.c_force[i][j].buck2 = buck2[i][j]; fc.c_force[i][j].rhoinv = rhoinv[i][j]; diff --git a/src/USER-INTEL/pair_dpd_intel.cpp b/src/USER-INTEL/pair_dpd_intel.cpp index c7cddfccc1e3a9cb8a1a3f59861b369db2008ed4..09f27504a1bd2a8bc94bb0a6e4f50d5f775fe129 100644 --- a/src/USER-INTEL/pair_dpd_intel.cpp +++ b/src/USER-INTEL/pair_dpd_intel.cpp @@ -531,8 +531,8 @@ void PairDPDIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.param[i][j].a0 = a0[i][j]; fc.param[i][j].gamma = gamma[i][j]; fc.param[i][j].sigma = sigma[i][j]; diff --git a/src/USER-INTEL/pair_gayberne_intel.cpp b/src/USER-INTEL/pair_gayberne_intel.cpp index 3fbb58308b0d37bfeea2f918cf44de0e7e67a8e5..1f05ad0efc82c917f847a26e4e009c90f1643a2d 100644 --- a/src/USER-INTEL/pair_gayberne_intel.cpp +++ b/src/USER-INTEL/pair_gayberne_intel.cpp @@ -938,8 +938,8 @@ void PairGayBerneIntel::pack_force_const(ForceConst<flt_t> &fc, fc.upsilon = upsilon; fc.mu = mu; - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.ijc[i][j].lj1 = lj1[i][j]; fc.ijc[i][j].lj2 = lj2[i][j]; fc.ijc[i][j].cutsq = cutsq[i][j]; diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp index 0dc2c275e87d3d583da1b42a4a493ae04cdd4469..e3afcd64a6e30f04506698b112dc9194606294a3 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp @@ -521,8 +521,8 @@ void PairLJCharmmCoulCharmmIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.lj[i][j].x = lj1[i][j]; fc.lj[i][j].y = lj2[i][j]; fc.lj[i][j].z = lj3[i][j]; diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp index fe99525122c17ae456241ae8f33e6f2deb1bf82a..a2680cdff41bb964cf39e42f85c140837e08fca8 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp @@ -586,8 +586,8 @@ void PairLJCharmmCoulLongIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.lj[i][j].x = lj1[i][j]; fc.lj[i][j].y = lj2[i][j]; fc.lj[i][j].z = lj3[i][j]; diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp index e9775d6ec5c96b97bcd89ae39925796474bdca86..c0bf6f35c6e6b220f33d6d6bbb00232d8fcce3bd 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp @@ -544,8 +544,8 @@ void PairLJCutCoulLongIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { if (cutsq[i][j] < cut_ljsq[i][j]) error->all(FLERR, "Intel variant of lj/cut/coul/long expects lj cutoff<=coulombic"); diff --git a/src/USER-INTEL/pair_lj_cut_intel.cpp b/src/USER-INTEL/pair_lj_cut_intel.cpp index 4871821842dd327e8d2da1e1a0bb02a8e4146ae9..f5a7999ee2e9cf13280167af8eecb008dbca59fe 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_intel.cpp @@ -437,8 +437,8 @@ void PairLJCutIntel::pack_force_const(ForceConst<flt_t> &fc, fc.special_lj[0] = 1.0; } - for (int i = 0; i < tp1; i++) { - for (int j = 0; j < tp1; j++) { + for (int i = 1; i < tp1; i++) { + for (int j = 1; j < tp1; j++) { fc.ljc12o[i][j].lj1 = lj1[i][j]; fc.ljc12o[i][j].lj2 = lj2[i][j]; fc.lj34[i][j].lj3 = lj3[i][j];