15 #if defined(__SSE2__) && ! defined(NAMD_DISABLE_SSE)
16 #include <emmintrin.h>
17 #if defined(__INTEL_COMPILER)
18 #define __align(X) __declspec(align(X) )
19 #elif defined(__GNUC__) || defined(__PGI)
20 #define __align(X) __attribute__((aligned(X) ))
22 #define __align(X) __declspec(align(X) )
26 #ifdef DEFINITION // (
32 #if NAMD_ComputeNonbonded_SortAtoms != 0
40 #define NAME CLASSNAME(calc)
45 #define CLASS ComputeNonbondedPair
46 #define CLASSNAME(X) ENERGYNAME( X ## _pair )
54 #define CLASS ComputeNonbondedSelf
55 #define CLASSNAME(X) ENERGYNAME( X ## _self )
66 #define ENERGYNAME(X) SLOWONLYNAME( X ## _energy )
70 #define ENERGYNAME(X) SLOWONLYNAME( X )
79 #define SLOWONLYNAME(X) MERGEELECTNAME( X ## _slow )
83 #define SLOWONLYNAME(X) MERGEELECTNAME( X )
92 #define MERGEELECTNAME(X) FULLELECTNAME( X ## _merge )
96 #define MERGEELECTNAME(X) FULLELECTNAME( X )
103 #define FULLELECTNAME(X) TABENERGYNAME( X ## _fullelect )
107 #define FULLELECTNAME(X) TABENERGYNAME( X )
116 #define TABENERGYNAME(X) FEPNAME( X ## _tabener )
117 #define TABENERGY(X) X
118 #define NOTABENERGY(X)
120 #define TABENERGYNAME(X) FEPNAME( X )
122 #define NOTABENERGY(X) X
143 #define FEPNAME(X) LAST( X )
146 #define NOT_ALCHPAIR(X) X
159 #define FEPNAME(X) LAST( X ## _fep )
167 #define FEPNAME(X) LAST( X ## _ti )
175 #define FEPNAME(X) LAST( X ## _les )
182 #define FEPNAME(X) LAST( X ## _int )
189 #define FEPNAME(X) LAST( X ## _pprof )
196 #define FEPNAME(X) LAST( X ## _go )
199 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
216 #define KNL_MAKE_DEPENDS_INCLUDE
218 #undef KNL_MAKE_DEPENDS_INCLUDE
223 #if ( TABENERGY(1+) FEP(1+) TI(1+) INT(1+) LES(1+) GO(1+) PPROF(1+) NOFAST(1+) 0 )
235 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR( + 1 ) )
236 #define COMPONENT_DOTPRODUCT(A,B) ((A##_x * B##_x) + (A##_y * B##_y) + (A##_z * B##_z))
251 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
265 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
266 int savePairlists = 0;
267 int usePairlists = 0;
280 int exclChecksum = 0;
288 BigReal goEnergyNonnative = 0; ) )
327 const float offset_x_f = params->
offset_f.
x;
328 const float offset_y_f = params->
offset_f.
y;
329 const float offset_z_f = params->
offset_f.
z;
332 params->plcutoff * params->
plcutoff;
333 register const BigReal groupplcutoff2 = \
360 const float scaling_f =
scaling;
362 vector4double scalingv = vec_splats(scaling);
372 const float c1_f =
c1;
373 const float c3_f =
c3;
378 const int r2_delta_expc = 64 * (r2_delta_exp - 1023);
383 const BigReal diff = cutoff2 - switchdist2;
384 const BigReal switchfactor = 1./(diff*diff*diff);
401 BigReal vdwShiftUp = alchVdwShiftCoeff*(1 - vdwLambdaUp);
406 FEP(
BigReal vdwShift2Up = alchVdwShiftCoeff*(1 - vdwLambda2Up);)
409 BigReal lambdaDown = 1 - alchLambda;
413 BigReal vdwShiftDown = alchVdwShiftCoeff*(1 - vdwLambdaDown);
418 FEP(
BigReal vdwShift2Down = alchVdwShiftCoeff*(1 - vdwLambda2Down);)
440 int pswitchTable[5*5];
447 for (
int ip=0; ip<5; ++ip) {
448 for (
int jp=0; jp<5; ++jp ) {
449 pswitchTable[ip+5*jp] = 0;
450 if ((ip==1 && jp==0) || (ip==0 && jp==1)) pswitchTable[ip+5*jp] = 1;
451 if ((ip==2 && jp==0) || (ip==0 && jp==2)) pswitchTable[ip+5*jp] = 2;
452 if ((ip==3 && jp==0) || (ip==0 && jp==3)) pswitchTable[ip+5*jp] = 3;
453 if ((ip==4 && jp==0) || (ip==0 && jp==4)) pswitchTable[ip+5*jp] = 4;
455 if (ip && jp && (abs(ip - jp) != 2)) pswitchTable[ip+5*jp] = 99;
459 if ((ip == 1 && jp == 1) || (ip == 1 && jp == 3) || (ip == 3 && jp == 1)) pswitchTable[ip+5*jp] = 1;
460 if ((ip == 2 && jp == 2) || (ip == 2 && jp == 4) || (ip == 4 && jp == 2)) pswitchTable[ip+5*jp] = 2;
461 if (ip == 3 && jp == 3) pswitchTable[ip+5*jp] = 3;
462 if (ip == 4 && jp == 4) pswitchTable[ip+5*jp] = 4;
470 if (ip == 1 && jp == 1) pswitchTable[ip+5*jp] = 0;
471 if (ip == 2 && jp == 2) pswitchTable[ip+5*jp] = 0;
483 BigReal fullElectEnergy_ti_2 = 0;)
488 const int i_upper = params->
numAtoms[0];
489 register const int j_upper = params->
numAtoms[1];
494 KNL(
const CompAtomFlt *pFlt_0 = params->pFlt[0]; )
495 KNL(
const CompAtomFlt *pFlt_1 = params->pFlt[1]; )
499 char * excl_flags_buff = 0;
500 const int32 * full_excl = 0;
501 const int32 * mod_excl = 0;
503 plint *pairlistn_save;
int npairn;
504 plint *pairlistx_save;
int npairx;
505 plint *pairlistm_save;
int npairm;
510 plint *pairlistnA1_save;
int npairnA1;
511 plint *pairlistxA1_save;
int npairxA1;
512 plint *pairlistmA1_save;
int npairmA1;
513 plint *pairlistnA2_save;
int npairnA2;
514 plint *pairlistxA2_save;
int npairxA2;
515 plint *pairlistmA2_save;
int npairmA2;
516 plint *pairlistnA3_save;
int npairnA3;
517 plint *pairlistxA3_save;
int npairxA3;
518 plint *pairlistmA3_save;
int npairmA3;
519 plint *pairlistnA4_save;
int npairnA4;
520 plint *pairlistxA4_save;
int npairxA4;
521 plint *pairlistmA4_save;
int npairmA4;
526 int arraysize = j_upper+5;
535 union {
double f;
int32 i[2]; } byte_order_test;
536 byte_order_test.f = 1.0;
537 int32 *r2iilist = (
int32*)r2list + ( byte_order_test.i[0] ? 0 : 1 );
539 if ( ! ( savePairlists || ! usePairlists ) ) arraysize = 0;
550 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR( + 1 ) )
563 register SortEntry* p_1_sortValues = atomSort_0_sortValues__;
564 register SortEntry* p_1_sortValues_fixg = atomSort_1_sortValues__;
566 int p_0_sortValues_len = 0;
567 int p_1_sortValues_len = 0;
568 int p_1_sortValues_fixg_len = 0;
572 BigReal atomSort_windowRadius = sqrt(groupplcutoff2);
574 if (savePairlists || !usePairlists) {
582 register int nbgs = p_1->nonbondedGroupSize;
583 register BigReal p_x = p_1->position.x;
584 register BigReal p_y = p_1->position.y;
585 register BigReal p_z = p_1->position.z;
586 register int index = 0;
588 for (
register int j = nbgs; j < j_upper; j += nbgs) {
592 register const CompAtom* p_j_next = p_1 + j;
609 register SortEntry* p_1_sortValStorePtr = p_1_sortValues + p_1_sortValues_len;
610 p_1_sortValStorePtr->
index = index;
611 p_1_sortValStorePtr->
sortValue = sortVal;
612 p_1_sortValues_len++;
621 register SortEntry* p_1_sortValStorePtr = p_1_sortValues + p_1_sortValues_len;
622 p_1_sortValStorePtr->
index = index;
623 p_1_sortValStorePtr->
sortValue = sortVal;
624 p_1_sortValues_len++;
629 #if 0 // Selection Sort
631 #elif 0 // Bubble Sort
634 #if NAMD_ComputeNonbonded_SortAtoms_LessBranches == 0
643 register int nbgs = p_0->nonbondedGroupSize;
644 register BigReal p_x = p_0->position.x + offset_x;
645 register BigReal p_y = p_0->position.y + offset_y;
646 register BigReal p_z = p_0->position.z + offset_z;
647 register int index = 0;
649 for (
register int i = nbgs; i < i_upper; i += nbgs) {
653 register const CompAtom* p_i_next = p_0 + i;
665 register BigReal* p_0_sortValStorePtr = p_0_sortValues + index;
666 *p_0_sortValStorePtr = sortVal;
674 register BigReal* p_0_sortValStorePtr = p_0_sortValues + index;
675 *p_0_sortValStorePtr = sortVal;
677 p_0_sortValues_len = i_upper;
682 #endif // NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR( + 1 ) )
686 #if ! (NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR( + 1 ) ) )
714 if ( savePairlists || ! usePairlists ) {
716 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
719 register int fixg = 0;
720 for (
int tmpI = 0; tmpI < p_1_sortValues_len; tmpI++) {
721 register SortEntry* p_1_sortEntry = p_1_sortValues + tmpI;
722 register int p_1_index = p_1_sortEntry->
index;
723 if (!pExt_1[p_1_index].groupFixed) {
724 register SortEntry* p_1_sortEntry_fixg = p_1_sortValues_fixg + p_1_sortValues_fixg_len;
725 p_1_sortEntry_fixg->
index = p_1_sortEntry->
index;
727 p_1_sortValues_fixg_len++;
734 for ( j = 0; j < j_upper; ++j ) {
735 if ( p_1[j].nonbondedGroupSize ) {
740 if ( g_upper ) grouplist[g_upper] = grouplist[g_upper-1];
744 for ( g = 0; g < g_upper; ++g ) {
746 if ( ! pExt_1[j].groupFixed ) {
747 fixglist[fixg++] = j;
753 if ( fixg_upper ) fixglist[fixg_upper] = fixglist[fixg_upper-1];
755 #endif // NAMD_ComputeNonbonded_SortAtoms != 0
763 NAMD_bug(
"pairlist i_upper mismatch!");
773 int pairlistoffset=0;
777 #if ( SHORT( FAST( 1+ ) ) 0 )
790 #define fullf_1 fullf_0
796 int groupCount = params->
minPart;
798 if ( savePairlists || ! usePairlists ) {
805 PAIR(
for ( ; i < (i_upper);))
SELF(
for ( i=0; i < (i_upper- 1);i++))
808 KNL(
const CompAtomFlt &pFlt_i = pFlt_0[i]; )
811 PAIR(
if (savePairlists || ! usePairlists){)
817 __dcbt((
void *) &(p_0[i]));
822 groupCount = maxPart;
831 register const BigReal p_i_x_f = pFlt_i.position.x + offset_x_f;
832 register const BigReal p_i_y_f = pFlt_i.position.y + offset_y_f;
833 register const BigReal p_i_z_f = pFlt_i.position.z + offset_z_f;
836 vector4double p_i_v = {p_i_x, p_i_y, p_i_z, 0.0};
849 if ( savePairlists || ! usePairlists ) {
851 #ifdef MEM_OPT_VERSION
852 const ExclusionCheck *exclcheck = mol->get_excl_check_for_idx(pExt_i.exclId);
853 const int excl_min = pExt_i.id + exclcheck->
min;
854 const int excl_max = pExt_i.id + exclcheck->
max;
857 const int excl_min = exclcheck->
min;
858 const int excl_max = exclcheck->
max;
860 const char * excl_flags_var;
861 if ( exclcheck->
flags ) excl_flags_var = exclcheck->
flags - excl_min;
866 #ifndef MEM_OPT_VERSION
867 if ( excl_flags_buff ) {
869 nl = full_excl[0] + 1;
870 for ( l=1; l<nl; ++l ) excl_flags_buff[full_excl[l]] = 0;
871 nl = mod_excl[0] + 1;
872 for ( l=1; l<nl; ++l ) excl_flags_buff[mod_excl[l]] = 0;
874 excl_flags_buff =
new char[mol->
numAtoms];
875 memset( (
void*) excl_flags_buff, 0, mol->
numAtoms);
879 nl = full_excl[0] + 1;
880 for ( l=1; l<nl; ++l ) excl_flags_buff[full_excl[l]] =
EXCHCK_FULL;
882 nl = mod_excl[0] + 1;
883 for ( l=1; l<nl; ++l ) excl_flags_buff[mod_excl[l]] =
EXCHCK_MOD;
884 excl_flags_var = excl_flags_buff;
888 const char *
const excl_flags = excl_flags_var;
894 const int groupfixed = (
fixedAtomsOn && pExt_i.groupFixed );
908 while ( g_lower < g_upper &&
909 grouplist[g_lower] < j_hgroup ) ++g_lower;
910 while ( fixg_lower < fixg_upper &&
911 fixglist[fixg_lower] < j_hgroup ) ++fixg_lower;
914 for ( j = i + 1; j < j_hgroup; ++j ) {
915 pairlist[pairlistindex++] = j;
920 register int *pli = pairlist + pairlistindex;
925 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
928 register BigReal p_i_sortValue = p_0_sortValues[i];
929 const BigReal p_i_sortValue_plus_windowRadius = p_i_sortValue + atomSort_windowRadius;
930 register SortEntry* sortValues = ( groupfixed ? p_1_sortValues_fixg : p_1_sortValues );
933 register int lower = 0;
934 register int upper = (groupfixed ? p_1_sortValues_fixg_len : p_1_sortValues_len);
935 while ((upper - lower) > 1) {
936 register int j = ((lower + upper) >> 1);
938 if (jSortVal < p_i_sortValue_plus_windowRadius) {
944 const int gu = (sortValues[lower].
sortValue >= p_i_sortValue_plus_windowRadius) ? lower : upper;
948 register int *gli = goodglist;
949 const int *glist = ( groupfixed ? fixglist : grouplist );
950 SELF(
const int gl = ( groupfixed ? fixg_lower : g_lower ); )
951 const int gu = ( groupfixed ? fixg_upper : g_upper );
960 #if defined(__SSE2__) && ! defined(NAMD_DISABLE_SSE)
963 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
964 register SortEntry* sortEntry0 = sortValues + g;
965 register SortEntry* sortEntry1 = sortValues + g + 1;
966 register int jprev0 = sortEntry0->
index;
967 register int jprev1 = sortEntry1->
index;
969 register int jprev0 = glist[g ];
970 register int jprev1 = glist[g + 1];
976 __m128d PJ_X_01 = _mm_set_pd(p_1[jprev1].position.x, p_1[jprev0].position.x);
977 __m128d PJ_Y_01 = _mm_set_pd(p_1[jprev1].position.y, p_1[jprev0].position.y);
978 __m128d PJ_Z_01 = _mm_set_pd(p_1[jprev1].position.z, p_1[jprev0].position.z);
981 const __m128d P_I_X = _mm_set1_pd(p_i_x);
982 const __m128d P_I_Y = _mm_set1_pd(p_i_y);
983 const __m128d P_I_Z = _mm_set1_pd(p_i_z);
986 for ( ; g < gu - 2; g +=2 ) {
991 __m128d T_01 = _mm_sub_pd(P_I_X, PJ_X_01);
992 __m128d R2_01 = _mm_mul_pd(T_01, T_01);
993 T_01 = _mm_sub_pd(P_I_Y, PJ_Y_01);
994 R2_01 = _mm_add_pd(R2_01, _mm_mul_pd(T_01, T_01));
995 T_01 = _mm_sub_pd(P_I_Z, PJ_Z_01);
996 R2_01 = _mm_add_pd(R2_01, _mm_mul_pd(T_01, T_01));
998 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
999 sortEntry0 = sortValues + g;
1000 sortEntry1 = sortValues + g + 1;
1001 jprev0 = sortEntry0->
index;
1002 jprev1 = sortEntry1->
index;
1005 jprev1 = glist[g+1];
1008 PJ_X_01 = _mm_set_pd(p_1[jprev1].position.x, p_1[jprev0].position.x);
1009 PJ_Y_01 = _mm_set_pd(p_1[jprev1].position.y, p_1[jprev0].position.y);
1010 PJ_Z_01 = _mm_set_pd(p_1[jprev1].position.z, p_1[jprev0].position.z);
1012 __align(16)
double r2_01[2];
1013 _mm_store_pd(r2_01, R2_01);
1016 bool test0 = ( r2_01[0] < groupplcutoff2 );
1017 bool test1 = ( r2_01[1] < groupplcutoff2 );
1021 goodglist [ hu ] = j0;
1022 goodglist [ hu + test0 ] = j1;
1024 hu += test0 + test1;
1028 #elif defined (A2_QPX)
1030 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
1031 register SortEntry* sortEntry0 = sortValues + g;
1032 register SortEntry* sortEntry1 = sortValues + g + 1;
1033 register int jprev0 = sortEntry0->
index;
1034 register int jprev1 = sortEntry1->
index;
1036 register int jprev0 = glist[g ];
1037 register int jprev1 = glist[g + 1];
1040 __dcbt ((
void*)(p_1 + jprev0));
1043 vector4double pj_v_0, pj_v_1;
1044 vector4double v_0, v_1;
1051 for ( ; g < gu - 2; g +=2 ) {
1056 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
1057 sortEntry0 = sortValues + g;
1058 sortEntry1 = sortValues + g + 1;
1059 jprev0 = sortEntry0->
index;
1060 jprev1 = sortEntry1->
index;
1063 jprev1 = glist[g+1];
1066 v_0 = vec_sub (p_i_v, pj_v_0);
1067 v_1 = vec_sub (p_i_v, pj_v_1);
1068 v_0 = vec_mul (v_0, v_0);
1069 v_1 = vec_mul (v_1, v_1);
1071 r2_0 = vec_extract(v_0, 0) + vec_extract(v_0, 1) + vec_extract(v_0, 2);
1072 r2_1 = vec_extract(v_1, 0) + vec_extract(v_1, 1) + vec_extract(v_1, 2);
1077 size_t test0 = ( groupplcutoff2 > r2_0 );
1078 size_t test1 = ( groupplcutoff2 > r2_1 );
1082 goodglist [ hu ] = j0;
1083 goodglist [ hu + test0 ] = j1;
1085 hu += test0 + test1;
1092 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
1093 register SortEntry* sortEntry0 = sortValues + g;
1094 register SortEntry* sortEntry1 = sortValues + g + 1;
1095 register int jprev0 = sortEntry0->
index;
1096 register int jprev1 = sortEntry1->
index;
1098 register int jprev0 = glist[g ];
1099 register int jprev1 = glist[g + 1];
1105 register BigReal pj_x_0, pj_x_1;
1106 register BigReal pj_y_0, pj_y_1;
1107 register BigReal pj_z_0, pj_z_1;
1108 register BigReal t_0, t_1, r2_0, r2_1;
1110 pj_x_0 = p_1[jprev0].position.x;
1111 pj_x_1 = p_1[jprev1].position.x;
1113 pj_y_0 = p_1[jprev0].position.y;
1114 pj_y_1 = p_1[jprev1].position.y;
1116 pj_z_0 = p_1[jprev0].position.z;
1117 pj_z_1 = p_1[jprev1].position.z;
1120 for ( ; g < gu - 2; g +=2 ) {
1125 t_0 = p_i_x - pj_x_0;
1126 t_1 = p_i_x - pj_x_1;
1130 t_0 = p_i_y - pj_y_0;
1131 t_1 = p_i_y - pj_y_1;
1135 t_0 = p_i_z - pj_z_0;
1136 t_1 = p_i_z - pj_z_1;
1140 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
1141 sortEntry0 = sortValues + g;
1142 sortEntry1 = sortValues + g + 1;
1143 jprev0 = sortEntry0->
index;
1144 jprev1 = sortEntry1->
index;
1147 jprev1 = glist[g+1];
1150 pj_x_0 = p_1[jprev0].position.x;
1151 pj_x_1 = p_1[jprev1].position.x;
1152 pj_y_0 = p_1[jprev0].position.y;
1153 pj_y_1 = p_1[jprev1].position.y;
1154 pj_z_0 = p_1[jprev0].position.z;
1155 pj_z_1 = p_1[jprev1].position.z;
1157 bool test0 = ( r2_0 < groupplcutoff2 );
1158 bool test1 = ( r2_1 < groupplcutoff2 );
1162 goodglist [ hu ] = j0;
1163 goodglist [ hu + test0 ] = j1;
1165 hu += test0 + test1;
1171 #pragma omp simd simdlen(16)
1172 for (; g < gu; g++) {
1174 #if NAMD_ComputeNonbonded_SortAtoms != 0 && ( 0 PAIR ( + 1 ) )
1175 register SortEntry* sortEntry = sortValues + g;
1176 register int j = sortEntry->
index;
1181 BigReal p_j_x = p_1[j].position.x;
1182 BigReal p_j_y = p_1[j].position.y;
1183 BigReal p_j_z = p_1[j].position.z;
1192 #pragma omp ordered simd monotonic(hu:1)
1193 if ( r2 <= groupplcutoff2 )
1194 goodglist[hu ++] = j;
1197 for (
int h=0; h<hu; ++h ) {
1198 int j = goodglist[h];
1199 int nbgs = p_1[j].nonbondedGroupSize;
1212 pairlistindex = pli - pairlist;
1214 if ( pairlistindex ) {
1215 pairlist[pairlistindex] = pairlist[pairlistindex-1];
1225 else pairlistoffset++;
1228 const int atomfixed = (
fixedAtomsOn && pExt_i.atomFixed );
1230 register int *pli = pairlist2;
1233 register plint *plin = pairlistn;
1240 for (
int k=pairlistoffset; k<pairlistindex; k++) {
1246 if (qmGroup_i > 0) {
1247 if (qmGroup_i == qmGroup_j) {
1257 int npair2_int = pli - pairlist2;
1259 for (
int k=0; k<npair2_int; k++) {
1263 BigReal p_j_x = p_1[j].position.x;
1266 BigReal p_j_y = p_1[j].position.y;
1269 BigReal p_j_z = p_1[j].position.z;
1273 if ( ( ! (atomfixed && pExt_1[j].atomFixed) ) && (r2 <= plcutoff2) ) {
1274 int atom2 = pExt_1[j].
id;
1275 if ( atom2 >= excl_min && atom2 <= excl_max ) *(pli++) = j;
1287 if (ifep_type != 1) {
PAIR(++i;)
continue; }
1288 for (
int k=pairlistoffset; k<pairlistindex; k++) {
1290 const int jfep_type = p_1[j].partition;
1292 if (jfep_type == 1) {
1297 if (ifep_type != 1 && ifep_type != 2) {
PAIR(++i;)
continue; }
1298 for (
int k=pairlistoffset; k<pairlistindex; k++) {
1300 const int jfep_type = p_1[j].partition;
1302 if (ifep_type + jfep_type == 3) {
1307 int npair2_int = pli - pairlist2;
1309 for (
int k=0; k<npair2_int; k++) {
1311 BigReal p_j_x = p_1[j].position.x;
1314 BigReal p_j_y = p_1[j].position.y;
1317 BigReal p_j_z = p_1[j].position.z;
1320 if ( ( ! (atomfixed && pExt_1[j].atomFixed) ) && (r2 <=
plcutoff2) ) {
1321 int atom2 = pExt_1[j].
id;
1322 if ( atom2 >= excl_min && atom2 <= excl_max ) *(pli++) = j;
1329 for (
int k=pairlistoffset; k<pairlistindex; k++) {
1331 BigReal p_j_x = p_1[j].position.x;
1334 BigReal p_j_y = p_1[j].position.y;
1337 BigReal p_j_z = p_1[j].position.z;
1340 if ( (! pExt_1[j].atomFixed) && (r2 <=
plcutoff2) ) {
1341 int atom2 = pExt_1[j].
id;
1342 if ( atom2 >= excl_min && atom2 <= excl_max ) *(pli++) = j;
1347 int k = pairlistoffset;
1348 int ku = pairlistindex;
1351 #if defined(__SSE2__) && ! defined(NAMD_DISABLE_SSE)
1353 register int jprev0 = pairlist [k ];
1354 register int jprev1 = pairlist [k + 1];
1359 __m128d PJ_X_01 = _mm_set_pd(p_1[jprev1].position.x, p_1[jprev0].position.x);
1360 __m128d PJ_Y_01 = _mm_set_pd(p_1[jprev1].position.y, p_1[jprev0].position.y);
1361 __m128d PJ_Z_01 = _mm_set_pd(p_1[jprev1].position.z, p_1[jprev0].position.z);
1364 const __m128d P_I_X = _mm_set1_pd(p_i_x);
1365 const __m128d P_I_Y = _mm_set1_pd(p_i_y);
1366 const __m128d P_I_Z = _mm_set1_pd(p_i_z);
1368 int atom2_0 = pExt_1[jprev0].
id;
1369 int atom2_1 = pExt_1[jprev1].
id;
1372 for ( ; k < ku - 2; k +=2 ) {
1377 __m128d T_01 = _mm_sub_pd(P_I_X, PJ_X_01);
1378 __m128d R2_01 = _mm_mul_pd(T_01, T_01);
1379 T_01 = _mm_sub_pd(P_I_Y, PJ_Y_01);
1380 R2_01 = _mm_add_pd(R2_01, _mm_mul_pd(T_01, T_01));
1381 T_01 = _mm_sub_pd(P_I_Z, PJ_Z_01);
1382 R2_01 = _mm_add_pd(R2_01, _mm_mul_pd(T_01, T_01));
1384 jprev0 = pairlist[k];
1385 jprev1 = pairlist[k+1];
1387 PJ_X_01 = _mm_set_pd(p_1[jprev1].position.x, p_1[jprev0].position.x);
1388 PJ_Y_01 = _mm_set_pd(p_1[jprev1].position.y, p_1[jprev0].position.y);
1389 PJ_Z_01 = _mm_set_pd(p_1[jprev1].position.z, p_1[jprev0].position.z);
1391 __align(16)
double r2_01[2];
1392 _mm_store_pd(r2_01, R2_01);
1394 if (r2_01[0] <= plcutoff2) {
1395 if ( atom2_0 >= excl_min && atom2_0 <= excl_max )
1400 atom2_0 = pExt_1[jprev0].
id;
1402 if (r2_01[1] <= plcutoff2) {
1403 if ( atom2_1 >= excl_min && atom2_1 <= excl_max )
1408 atom2_1 = pExt_1[jprev1].
id;
1412 #elif defined(A2_QPX)
1414 register int jprev0 = pairlist [k];
1415 register int jprev1 = pairlist [k + 1];
1419 vector4double pj_v_0, pj_v_1;
1420 vector4double v_0, v_1;
1426 int atom2_0 = pExt_1[jprev0].
id;
1427 int atom2_1 = pExt_1[jprev1].
id;
1430 for ( ; k < ku - 2; k +=2 ) {
1435 v_0 = vec_sub (p_i_v, pj_v_0);
1436 v_1 = vec_sub (p_i_v, pj_v_1);
1437 v_0 = vec_mul (v_0, v_0);
1438 v_1 = vec_mul (v_1, v_1);
1440 r2_0 = vec_extract(v_0, 0) + vec_extract(v_0, 1) + vec_extract(v_0, 2);
1441 r2_1 = vec_extract(v_1, 0) + vec_extract(v_1, 1) + vec_extract(v_1, 2);
1443 jprev0 = pairlist[k];
1444 jprev1 = pairlist[k+1];
1449 if (r2_0 <= plcutoff2) {
1450 if ( atom2_0 >= excl_min && atom2_0 <= excl_max )
1455 atom2_0 = pExt_1[jprev0].
id;
1457 if (r2_1 <= plcutoff2) {
1458 if ( atom2_1 >= excl_min && atom2_1 <= excl_max )
1463 atom2_1 = pExt_1[jprev1].
id;
1469 register int jprev0 = pairlist [k];
1470 register int jprev1 = pairlist [k + 1];
1475 register BigReal pj_x_0, pj_x_1;
1476 register BigReal pj_y_0, pj_y_1;
1477 register BigReal pj_z_0, pj_z_1;
1478 register BigReal t_0, t_1, r2_0, r2_1;
1480 pj_x_0 = p_1[jprev0].position.x;
1481 pj_x_1 = p_1[jprev1].position.x;
1483 pj_y_0 = p_1[jprev0].position.y;
1484 pj_y_1 = p_1[jprev1].position.y;
1486 pj_z_0 = p_1[jprev0].position.z;
1487 pj_z_1 = p_1[jprev1].position.z;
1489 int atom2_0 = pExt_1[jprev0].
id;
1490 int atom2_1 = pExt_1[jprev1].
id;
1493 for ( ; k < ku - 2; k +=2 ) {
1498 t_0 = p_i_x - pj_x_0;
1499 t_1 = p_i_x - pj_x_1;
1503 t_0 = p_i_y - pj_y_0;
1504 t_1 = p_i_y - pj_y_1;
1508 t_0 = p_i_z - pj_z_0;
1509 t_1 = p_i_z - pj_z_1;
1513 jprev0 = pairlist[k];
1514 jprev1 = pairlist[k+1];
1516 pj_x_0 = p_1[jprev0].position.x;
1517 pj_x_1 = p_1[jprev1].position.x;
1518 pj_y_0 = p_1[jprev0].position.y;
1519 pj_y_1 = p_1[jprev1].position.y;
1520 pj_z_0 = p_1[jprev0].position.z;
1521 pj_z_1 = p_1[jprev1].position.z;
1523 if (r2_0 <= plcutoff2) {
1524 if ( atom2_0 >= excl_min && atom2_0 <= excl_max )
1529 atom2_0 = pExt_1[jprev0].
id;
1531 if (r2_1 <= plcutoff2) {
1532 if ( atom2_1 >= excl_min && atom2_1 <= excl_max )
1537 atom2_1 = pExt_1[jprev1].
id;
1544 #pragma omp simd simdlen(16)
1545 for (; k < ku; k++) {
1546 int j = pairlist[k];
1547 int atom2 = pExt_1[j].
id;
1549 BigReal p_j_x = p_1[j].position.x;
1550 BigReal p_j_y = p_1[j].position.y;
1551 BigReal p_j_z = p_1[j].position.z;
1560 #pragma omp ordered simd monotonic(plin:1, pli:1)
1561 if (r2 <= plcutoff2) {
1562 if ( atom2 >= excl_min && atom2 <= excl_max )
1572 if ( plin == pairlistn && pli == pairlist2 ) {
1579 plint *plix = pairlistx;
1580 plint *plim = pairlistm;
1582 plint *plinA1 = pairlistnA1;
1583 plint *plixA1 = pairlistxA1;
1584 plint *plimA1 = pairlistmA1;
1585 plint *plinA2 = pairlistnA2;
1586 plint *plixA2 = pairlistxA2;
1587 plint *plimA2 = pairlistmA2;
1588 plint *plinA3 = pairlistnA3;
1589 plint *plixA3 = pairlistxA3;
1590 plint *plimA3 = pairlistmA3;
1591 plint *plinA4 = pairlistnA4;
1592 plint *plixA4 = pairlistxA4;
1593 plint *plimA4 = pairlistmA4;
1599 int unsortedNpairn = plin - pairlistn;
1601 for ( k=0; k<unsortedNpairn; ++k ) {
1602 int j = pairlistn[k];
1603 switch(pswitchTable[p_i_partition + 5*(p_1[j].
partition)]) {
1604 case 0: *(plin++) = j;
break;
1605 case 1: *(plinA1++) = j;
break;
1606 case 2: *(plinA2++) = j;
break;
1607 case 3: *(plinA3++) = j;
break;
1608 case 4: *(plinA4++) = j;
break;
1613 int npair2 = pli - pairlist2;
1616 for (k=0; k < npair2; ++k ) {
1617 int j = pairlist2[k];
1618 int atom2 = pExt_1[j].
id;
1619 int excl_flag = excl_flags[atom2];
1620 ALCH(
int pswitch = pswitchTable[p_i_partition + 5*(p_1[j].
partition)];)
1621 switch ( excl_flag
ALCH( + 3 * pswitch)) {
1622 case 0: *(plin++) = j;
break;
1623 case 1: *(plix++) = j;
break;
1624 case 2: *(plim++) = j;
break;
1626 case 3: *(plinA1++) = j;
break;
1627 case 6: *(plinA2++) = j;
break;
1628 case 9: *(plinA3++) = j;
break;
1629 case 12: *(plinA4++) = j;
break;
1630 case 5: *(plimA1++) = j;
break;
1631 case 8: *(plimA2++) = j;
break;
1632 case 11: *(plimA3++) = j;
break;
1633 case 14: *(plimA4++) = j;
break;
1634 case 4: *(plixA1++) = j;
break;
1635 case 7: *(plixA2++) = j;
break;
1636 case 10: *(plixA3++) = j;
break;
1637 case 13: *(plixA4++) = j;
break;
1642 npairn = plin - pairlistn;
1643 pairlistn_save = pairlistn;
1644 pairlistn_save[npairn] = npairn ? pairlistn_save[npairn-1] : -1;
1645 pairlists.
newsize(npairn + 1);
1647 npairx = plix - pairlistx;
1648 pairlistx_save = pairlists.
newlist();
1649 for ( k=0; k<npairx; ++k ) {
1650 pairlistx_save[k] = pairlistx[k];
1652 pairlistx_save[k] = k ? pairlistx_save[k-1] : -1;
1653 pairlists.
newsize(npairx + 1);
1655 npairm = plim - pairlistm;
1656 pairlistm_save = pairlists.
newlist();
1657 for ( k=0; k<npairm; ++k ) {
1658 pairlistm_save[k] = pairlistm[k];
1660 pairlistm_save[k] = k ? pairlistm_save[k-1] : -1;
1661 pairlists.
newsize(npairm + 1);
1665 #define PAIRLISTFROMARRAY(NPAIRS,PL1,PL2,PLSAVE) \
1667 (NPAIRS) = (PL2) - (PL1); \
1668 (PLSAVE) = pairlists.newlist(); \
1669 for ( k=0; k<(NPAIRS); ++k ) { \
1670 (PLSAVE)[k] = (PL1)[k]; \
1672 (PLSAVE)[k] = k ? (PLSAVE)[k-1] : -1; \
1673 pairlists.newsize((NPAIRS) + 1); \
1676 PAIRLISTFROMARRAY(npairnA1,pairlistnA1,plinA1,pairlistnA1_save);
1677 PAIRLISTFROMARRAY(npairxA1,pairlistxA1,plixA1,pairlistxA1_save);
1678 PAIRLISTFROMARRAY(npairmA1,pairlistmA1,plimA1,pairlistmA1_save);
1679 PAIRLISTFROMARRAY(npairnA2,pairlistnA2,plinA2,pairlistnA2_save);
1680 PAIRLISTFROMARRAY(npairxA2,pairlistxA2,plixA2,pairlistxA2_save);
1681 PAIRLISTFROMARRAY(npairmA2,pairlistmA2,plimA2,pairlistmA2_save);
1682 PAIRLISTFROMARRAY(npairnA3,pairlistnA3,plinA3,pairlistnA3_save);
1683 PAIRLISTFROMARRAY(npairxA3,pairlistxA3,plixA3,pairlistxA3_save);
1684 PAIRLISTFROMARRAY(npairmA3,pairlistmA3,plimA3,pairlistmA3_save);
1685 PAIRLISTFROMARRAY(npairnA4,pairlistnA4,plinA4,pairlistnA4_save);
1686 PAIRLISTFROMARRAY(npairxA4,pairlistxA4,plixA4,pairlistxA4_save);
1687 PAIRLISTFROMARRAY(npairmA4,pairlistmA4,plimA4,pairlistmA4_save);
1688 #undef PAIRLISTFROMARRAY
1692 if ( ! savePairlists ) pairlists.
reset();
1699 pairlists.
nextlist(&pairlistn_save,&npairn); --npairn;
1700 pairlists.
nextlist(&pairlistx_save,&npairx); --npairx;
1701 pairlists.
nextlist(&pairlistm_save,&npairm); --npairm;
1703 pairlists.
nextlist(&pairlistnA1_save,&npairnA1); --npairnA1;
1704 pairlists.
nextlist(&pairlistxA1_save,&npairxA1); --npairxA1;
1705 pairlists.
nextlist(&pairlistmA1_save,&npairmA1); --npairmA1;
1706 pairlists.
nextlist(&pairlistnA2_save,&npairnA2); --npairnA2;
1707 pairlists.
nextlist(&pairlistxA2_save,&npairxA2); --npairxA2;
1708 pairlists.
nextlist(&pairlistmA2_save,&npairmA2); --npairmA2;
1709 pairlists.
nextlist(&pairlistnA3_save,&npairnA3); --npairnA3;
1710 pairlists.
nextlist(&pairlistxA3_save,&npairxA3); --npairxA3;
1711 pairlists.
nextlist(&pairlistmA3_save,&npairmA3); --npairmA3;
1712 pairlists.
nextlist(&pairlistnA4_save,&npairnA4); --npairnA4;
1713 pairlists.
nextlist(&pairlistxA4_save,&npairxA4); --npairxA4;
1714 pairlists.
nextlist(&pairlistmA4_save,&npairmA4); --npairmA4;
1725 ( ( p_i.
partition == 1 ) ? 1. : -1. ) : 0.
1735 vector4double kq_iv = (vector4double)(0.0);
1736 vector4double f_i_v = (vector4double)(0.0);
1737 vector4double fullf_i_v = (vector4double)(0.0);
1738 vector4double full_cnst = (vector4double)(0.);
1739 #define f_i_x vec_extract(f_i_v, 0)
1740 #define f_i_y vec_extract(f_i_v, 1)
1741 #define f_i_z vec_extract(f_i_v, 2)
1742 #define fullf_i_x vec_extract(fullf_i_v, 0)
1743 #define fullf_i_y vec_extract(fullf_i_v, 1)
1744 #define fullf_i_z vec_extract(fullf_i_v, 2)
1758 const float kq_i_f = kq_i;
1761 p_i_x_f, p_i_y_f, p_i_z_f, pFlt_1, pairlistn_save, npairn, pairlisti,
1762 r2list_f, xlist, ylist, zlist);
1765 p_i_x, p_i_y, p_i_z, p_1, pairlistn_save, npairn, pairlisti,
1780 KNL(
float drudeNbtholeCut2 = (drudeNbtholeCut * drudeNbtholeCut); )
1784 for (k = 0; k < npairi; k++) {
1785 NOKNL(
if (r2list[k] > drudeNbtholeCut2) {
continue; } )
1786 KNL(
if (r2list_f[k] > drudeNbtholeCut2) {
continue; } )
1788 const int j = pairlisti[k];
1791 if ( p_j.hydrogenGroupSize < 2 ) {
continue; }
1793 for (kk = 0;kk < NumNbtholePairParams; kk++) {
1795 if (((nbthole_array[kk].ind1 == p_i.
vdwType) &&
1796 (nbthole_array[kk].
ind2 == p_j.vdwType)) ||
1798 (nbthole_array[kk].
ind1 == p_j.vdwType))) {
1802 if ( kk < NumNbtholePairParams ) {
1805 const BigReal aa = nbthole_array[kk].
tholeij * powf(aprod, -1.f/6);
1806 const BigReal qqaa = CC * p_0[i].charge * p_1[j].charge;
1807 const BigReal qqad = CC * p_0[i].charge * p_1[j+1].charge;
1808 const BigReal qqda = CC * p_0[i+1].charge * p_1[j].charge;
1809 const BigReal qqdd = CC * p_0[i+1].charge * p_1[j+1].charge;
1811 Vector raa = (p_0[i].position + params->
offset) - p_1[j].position;
1812 Vector rad = (p_0[i].position + params->
offset) - p_1[j+1].position;
1813 Vector rda = (p_0[i+1].position + params->
offset) - p_1[j].position;
1814 Vector rdd = (p_0[i+1].position + params->
offset) - p_1[j+1].position;
1821 BigReal auaa = aa / raa_invlen;
1822 BigReal auad = aa / rad_invlen;
1823 BigReal auda = aa / rda_invlen;
1824 BigReal audd = aa / rdd_invlen;
1831 BigReal polyauaa = 1 + 0.5*auaa;
1832 BigReal polyauad = 1 + 0.5*auad;
1833 BigReal polyauda = 1 + 0.5*auda;
1834 BigReal polyaudd = 1 + 0.5*audd;
1837 ethole += qqaa * raa_invlen * (- polyauaa * expauaa);
1838 ethole += qqad * rad_invlen * (- polyauad * expauad);
1839 ethole += qqda * rda_invlen * (- polyauda * expauda);
1840 ethole += qqdd * rdd_invlen * (- polyaudd * expaudd);
1842 polyauaa = 1 + auaa*polyauaa;
1843 polyauad = 1 + auad*polyauad;
1844 polyauda = 1 + auda*polyauda;
1845 polyaudd = 1 + audd*polyaudd;
1847 BigReal raa_invlen3 = raa_invlen * raa_invlen * raa_invlen;
1848 BigReal rad_invlen3 = rad_invlen * rad_invlen * rad_invlen;
1849 BigReal rda_invlen3 = rda_invlen * rda_invlen * rda_invlen;
1850 BigReal rdd_invlen3 = rdd_invlen * rdd_invlen * rdd_invlen;
1852 BigReal dfaa = qqaa * raa_invlen3 * (polyauaa*expauaa);
1853 BigReal dfad = qqad * rad_invlen3 * (polyauad*expauad);
1854 BigReal dfda = qqda * rda_invlen3 * (polyauda*expauda);
1855 BigReal dfdd = qqdd * rdd_invlen3 * (polyaudd*expaudd);
1857 Vector faa = -dfaa * raa;
1858 Vector fad = -dfad * rad;
1859 Vector fda = -dfda * rda;
1860 Vector fdd = -dfdd * rdd;
1862 SHORT(f_net)
NOSHORT(fullf_net) += (faa + fad) + (fda + fdd);
1863 params->
ff[0][i] += faa + fad;
1864 params->
ff[0][i+1] += fda + fdd;
1865 params->
ff[1][j] -= faa + fda;
1866 params->
ff[1][j+1] -= fad + fdd;
1880 KNL(
float loweAndersenCutoff2 = (loweAndersenCutoff * loweAndersenCutoff); )
1894 int atom_i = pExt_0[i].
id;
1896 if (loweAndersenUseCOMvelocity) {
1902 pos += v_0[i+l].
charge * p_0[i+l].position;
1913 for (k = 0; k < npairi; k++) {
1914 NOKNL(
if (r2list[k] > loweAndersenCutoff2) {
continue; } )
1915 KNL(
if (r2list_f[k] > loweAndersenCutoff2) {
continue; } )
1917 const int j = pairlisti[k];
1922 if (rand->
uniform() > loweAndersenProb) {
continue; }
1924 Mass mass_j = v_j.charge;
1927 int atom_j = pExt_1[j].
id;
1929 if (loweAndersenUseCOMvelocity) {
1935 pos += v_1[j+l].
charge * p_1[j+l].position;
1945 Mass mu_ij = (mass_i * mass_j)/(mass_i + mass_j);
1950 Force force = mu_ij * dt_inv * (lambda - (deltaV * sigma_ij)) * sigma_ij;
1955 if (loweAndersenUseCOMvelocity) {
1956 BigReal inv_mass_i = 1.0 / mass_i;
1957 BigReal inv_mass_j = 1.0 / mass_j;
1959 params->
ff[0][i+l] += (v_0[i+l].
charge * inv_mass_i) * force;
1962 params->
ff[1][j+l] -= (v_1[j+l].
charge * inv_mass_j) * force;
1965 params->
ff[0][i] += force;
1966 params->
ff[1][j] -= force;
1981 #define VDW_SWITCH_MODE VDW_SWITCH_MODE_ENERGY
1982 case VDW_SWITCH_MODE:
1985 #undef VDW_SWITCH_MODE
1987 #define VDW_SWITCH_MODE VDW_SWITCH_MODE_MARTINI
1988 case VDW_SWITCH_MODE:
1991 #undef VDW_SWITCH_MODE
1993 #define VDW_SWITCH_MODE VDW_SWITCH_MODE_FORCE
1994 case VDW_SWITCH_MODE:
1997 #undef VDW_SWITCH_MODE
2011 p_i_x, p_i_y, p_i_z, p_1, pairlistm_save, npairm, pairlisti,
2013 exclChecksum += npairi;
2017 #define MODIFIED(X) X
2025 p_i_x, p_i_y, p_i_z, p_1, pairlistx_save, npairx, pairlisti,
2027 exclChecksum += npairi;
2032 #define EXCLUDED(X) X
2045 exclChecksum += npairx;
2048 #if 0 ALCH(+1) // nonbondedbase2 for alchemical-separeted pairlists
2051 #define ALCHPAIR(X) X
2053 #define NOT_ALCHPAIR(X)
2075 p_i_x, p_i_y, p_i_z, p_1, pairlistnA1_save, npairnA1, pairlisti,
2088 p_i_x, p_i_y, p_i_z, p_1, pairlistnA2_save, npairnA2, pairlisti,
2101 p_i_x, p_i_y, p_i_z, p_1, pairlistnA3_save, npairnA3, pairlisti,
2114 p_i_x, p_i_y, p_i_z, p_1, pairlistnA4_save, npairnA4, pairlisti,
2130 #define MODIFIED(X) X
2137 p_i_x, p_i_y, p_i_z, p_1, pairlistmA1_save, npairmA1, pairlisti,
2139 exclChecksum += npairi;
2151 p_i_x, p_i_y, p_i_z, p_1, pairlistmA2_save, npairmA2, pairlisti,
2153 exclChecksum += npairi;
2165 p_i_x, p_i_y, p_i_z, p_1, pairlistmA3_save, npairmA3, pairlisti,
2167 exclChecksum += npairi;
2179 p_i_x, p_i_y, p_i_z, p_1, pairlistmA4_save, npairmA4, pairlisti,
2181 exclChecksum += npairi;
2199 #define EXCLUDED(X) X
2207 p_i_x, p_i_y, p_i_z, p_1, pairlistxA1_save, npairxA1, pairlisti,
2209 exclChecksum += npairi;
2221 p_i_x, p_i_y, p_i_z, p_1, pairlistxA2_save, npairxA2, pairlisti,
2223 exclChecksum += npairi;
2235 p_i_x, p_i_y, p_i_z, p_1, pairlistxA3_save, npairxA3, pairlisti,
2237 exclChecksum += npairi;
2249 p_i_x, p_i_y, p_i_z, p_1, pairlistxA4_save, npairxA4, pairlisti,
2251 exclChecksum += npairi;
2268 exclChecksum += npairxA1 + npairxA2 + npairxA3 + npairxA4;
2274 #define NOT_ALCHPAIR(X) X
2276 #endif // end nonbondedbase2.h includes for alchemical pairlists
2278 #ifdef NETWORK_PROGRESS
2279 CkNetworkProgress();
2284 __dcbt ((
void *) &(p_0[i+1]));
2288 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
2292 FULL( fullf_net.x += fullf_i_x; )
2293 FULL( fullf_net.y += fullf_i_y; )
2294 FULL( fullf_net.z += fullf_i_z; )
2298 FULL( fullf_0[i].
x += fullf_i_x; )
2299 FULL( fullf_0[i].
y += fullf_i_y; )
2300 FULL( fullf_0[i].
z += fullf_i_z; )
2303 if ( savePairlists || ! usePairlists ) {
2320 #
if (
PAIR( 1+ ) 0 )
2322 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
2347 #if ( FULL( 1+ ) 0 )
2348 #if ( PAIR( 1+ ) 0 )
2350 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
2358 reduction[fullElectVirialIndex_XX] += fullElectVirial_xx;
2359 reduction[fullElectVirialIndex_XY] += fullElectVirial_xy;
2360 reduction[fullElectVirialIndex_XZ] += fullElectVirial_xz;
2361 reduction[fullElectVirialIndex_YX] += fullElectVirial_xy;
2362 reduction[fullElectVirialIndex_YY] += fullElectVirial_yy;
2363 reduction[fullElectVirialIndex_YZ] += fullElectVirial_yz;
2364 reduction[fullElectVirialIndex_ZX] += fullElectVirial_xz;
2365 reduction[fullElectVirialIndex_ZY] += fullElectVirial_yz;
2366 reduction[fullElectVirialIndex_ZZ] += fullElectVirial_zz;
2372 #if !(defined(NAMD_CUDA) || defined(NAMD_HIP))
2411 delete [] excl_flags_buff;
register BigReal virial_xy
void sortEntries_mergeSort_v1(SortEntry *&se, SortEntry *&buf, int seLen)
static int pressureProfileSlabs
register BigReal virial_xz
register BigReal virial_yz
unsigned int hydrogenGroupSize
void sortEntries_selectionSort(SortEntry *const se, const int seLen)
static BigReal dielectric_1
static void partition(int *order, const FullAtom *atoms, int begin, int end)
const int32 * get_mod_exclusions_for_atom(int anum) const
register BigReal electEnergy
static const Molecule * mol
int pairlist_from_pairlist(BigReal cutoff2, BigReal p_i_x, BigReal p_i_y, BigReal p_i_z, const CompAtom *p_j, const plint *list, int list_size, int *newlist, BigReal r2_delta, BigReal *r2list)
#define NBWORKARRAY(TYPE, NAME, SIZE)
static BigReal pressureProfileThickness
SimParameters * simParameters
void sortEntries_bubbleSort(SortEntry *const se, const int seLen)
static int vdw_switch_mode
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ cudaTextureObject_t const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t float plcutoff2
#define NBWORKARRAYSINIT(ARRAYS)
register BigReal virial_yy
const Real * get_qmAtomGroup() const
void pp_clamp(int &n, int nslabs)
void nextlist(plint **list, int *list_size)
static Bool pairInteractionSelf
static BigReal * table_noshort
void NAMD_bug(const char *err_msg)
static BigReal pressureProfileMin
register BigReal virial_zz
NbtholePairValue * nbthole_array
static Bool vdwForceSwitching
static BigReal * lambda_table
static BigReal * slow_table
static Bool pairInteractionOn
static const LJTable * ljTable
register BigReal virial_xx
void newsize(int list_size)
static BigReal * table_short
const ExclusionCheck * get_excl_check_for_atom(int anum) const
void setIndexValue(plint i)
unsigned int nonbondedGroupSize
#define COMPONENT_DOTPRODUCT(A, B)
static BigReal alchVdwShiftCoeff
BigReal GetAtomAlpha(int i) const
BigReal * pressureProfileReduction
plint * newlist(int max_size)
void sortEntries_mergeSort_v2(SortEntry *&se, SortEntry *&buf, int seLen)
const int32 * get_full_exclusions_for_atom(int anum) const
const TableEntry * table_row(unsigned int i) const
ComputeNonbondedWorkArrays * workArrays