Refinement: the repulsion search on the refinement's threads, hydrogens skipped before the neighbour walk
BuildRepulsions walked the neighbours of every atom and only then dropped the pairs of a riding hydrogen; those atoms are now skipped before the walk. The atoms are searched in 64 blocks under ParallelFor and the blocks' pairs joined in atom order, so the restraint list is the same as before for any thread count. The model is no longer copied for the NeighborSearch. Same bits. 9yl4: repulsions 3.37 -> 1.09 s (91 calls), refinement 17.7 -> 14.2 s; 5reo 0.38 -> 0.12 s (RTX 5080, -N 8, loaded box). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu (cherry picked from commit ded11388a18f5a4138a73150c4bb073570152727) (cherry picked from commit 9c96836a90c9f170008d343af2cd885a4e59b321)
This commit is contained in:
1 parent
e3782cabe4
commit
001e61c1a4
3 files changed
+74
-62
No files matched your search
@@ -729,7 +729,7 @@ RefinementResult RefineModel(const gemmi::Structure &placed, const std::vector<M
|
||||
auto restraints_now = [&]() {
|
||||
const RefinementStage stage("repulsions");
|
||||
RestraintSet set = topo.geometry;
|
||||
set.Append(BuildRepulsions(topo, ctx.Model(), cell, sg, REPULSION_MARGIN));
|
||||
set.Append(BuildRepulsions(topo, ctx.Model(), cell, sg, REPULSION_MARGIN, ctx.nthreads));
|
||||
set.Finalize(ctx.atoms.size());
|
||||
return set;
|
||||
};
|
||||
@@ -737,7 +737,7 @@ RefinementResult RefineModel(const gemmi::Structure &placed, const std::vector<M
|
||||
{
|
||||
const RestraintSet set = restraints_now();
|
||||
ctx.engine->SetRestraints(0, set);
|
||||
RestraintSet repulsions = BuildRepulsions(topo, ctx.Model(), cell, sg, 0.0);
|
||||
RestraintSet repulsions = BuildRepulsions(topo, ctx.Model(), cell, sg, 0.0, ctx.nthreads);
|
||||
result.geometry_start = MeasureGeometry(topo.geometry, repulsions, ctx.XyzB());
|
||||
}
|
||||
double w0 = 0;
|
||||
@@ -783,7 +783,7 @@ RefinementResult RefineModel(const gemmi::Structure &placed, const std::vector<M
|
||||
t.r_free = rf.r_free;
|
||||
{
|
||||
const RefinementStage s1("measure");
|
||||
t.geometry = MeasureGeometry(topo.geometry, BuildRepulsions(topo, ctx.Model(), cell, sg, 0.0), ctx.XyzB());
|
||||
t.geometry = MeasureGeometry(topo.geometry, BuildRepulsions(topo, ctx.Model(), cell, sg, 0.0, ctx.nthreads), ctx.XyzB());
|
||||
}
|
||||
t.within_bounds = t.geometry.rmsd_bonds <= MAX_RMSD_BONDS && t.geometry.rmsd_angles <= MAX_RMSD_ANGLES;
|
||||
logger.Info("Refinement, X-ray weight {:.3g}, B {}: R-work {:.4f}, R-free {:.4f}, rmsd bonds {:.4f} A, "
|
||||
|
||||
Reference in new issue
Block a user