@@ -105,9 +105,9 @@ void PQEvaluatorBasic::updateValue(
105
105
// split outer loop for many atoms. The CPUs should have similar load.
106
106
bool chop_outer = (mncpu <= ((cntsites - 1 ) * CPU_LOAD_VARIANCE + 1 ));
107
107
bool chop_inner = !chop_outer;
108
- bool hasmask = pq.hasMask ();
108
+ const bool hasmask = pq.hasMask ();
109
109
if (!this ->isParallel ()) chop_outer = chop_inner = false ;
110
- bool usefullsum = this ->getFlag (USEFULLSUM);
110
+ const bool usefullsum = this ->getFlag (USEFULLSUM);
111
111
for (int i0 = 0 ; i0 < cntsites; ++i0)
112
112
{
113
113
if (chop_outer && (n++ % mncpu)) continue ;
@@ -182,7 +182,7 @@ void PQEvaluatorOptimized::updateValue(
182
182
mtypeused = OPTIMIZED;
183
183
// revert to normal calculation if there is no structure or
184
184
// if PairQuantity uses mask
185
- if (pq.ticker () >= mvalue_ticker || !mlast_structure || pq. hasPairMask () )
185
+ if (pq.ticker () >= mvalue_ticker || !mlast_structure)
186
186
{
187
187
return this ->updateValueCompletely (pq, stru);
188
188
}
@@ -192,7 +192,7 @@ void PQEvaluatorOptimized::updateValue(
192
192
{
193
193
return this ->updateValueCompletely (pq, stru);
194
194
}
195
- if (this ->getFlag (FIXEDSITEINDEX) &&
195
+ if (( this ->getFlag (FIXEDSITEINDEX) || pq. hasPairMask () ) &&
196
196
sd.diffmethod != StructureDifference::Method::SIDEBYSIDE)
197
197
{
198
198
return this ->updateValueCompletely (pq, stru);
@@ -219,7 +219,7 @@ void PQEvaluatorOptimized::updateValue(
219
219
anchors.end () : (anchors.begin () + sd.pop0 .size ());
220
220
SiteIndices::const_iterator ii0;
221
221
bool needsreselection = usefullsum;
222
- const bool hastypemask = pq.hasTypeMask ();
222
+ const bool hasmask = pq.hasMask ();
223
223
for (ii0 = anchors.begin (); ii0 != last_anchor; ++ii0)
224
224
{
225
225
if (n++ % mncpu) continue ;
@@ -237,8 +237,7 @@ void PQEvaluatorOptimized::updateValue(
237
237
for (bnds0->rewind (); !bnds0->finished (); bnds0->next ())
238
238
{
239
239
int i1 = bnds0->site1 ();
240
- assert (hastypemask || pq.getPairMask (i0, i1));
241
- if (hastypemask && !pq.getPairMask (i0, i1)) continue ;
240
+ if (hasmask && !pq.getPairMask (i0, i1)) continue ;
242
241
const int summationscale = (usefullsum || i0 == i1) ? -1 : -2 ;
243
242
pq.addPairContribution (*bnds0, summationscale);
244
243
}
@@ -288,8 +287,7 @@ void PQEvaluatorOptimized::updateValue(
288
287
for (bnds1->rewind (); !bnds1->finished (); bnds1->next ())
289
288
{
290
289
int i1 = bnds1->site1 ();
291
- assert (hastypemask || pq.getPairMask (i0, i1));
292
- if (hastypemask && !pq.getPairMask (i0, i1)) continue ;
290
+ if (hasmask && !pq.getPairMask (i0, i1)) continue ;
293
291
const int summationscale = (usefullsum || i0 == i1) ? +1 : +2 ;
294
292
pq.addPairContribution (*bnds1, summationscale);
295
293
}
0 commit comments