PickBest: the file centre's indexing starts before the work beside it, so it overlaps the beam-centre capture wait
With two or more GPUs StartCentreSpeculation joins the pre-scan's beam-centre capture; that join used to come before the file centre's schemes were indexed, so on the live server (capture 2.1 s) the file centre and the short-axis pass waited for it. The file centre's indexing now runs on its own thread while alongside() runs, and the short-axis pass is started before the centre speculation. Each indexer reads only what it was fed, so the results are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PXc1zD1yxHqaR1DGdCTHL4
This commit is contained in:
1 parent
8261b7354e
commit
a955bee0fc
1 file changed
+6
-3
@@ -1099,13 +1099,15 @@ auto Rugnux::FirstPassRun::ScoreSchemes(const SchemeIndexers &ris, IndexAndRefin
|
||||
}
|
||||
|
||||
// Feed the schemes, index them concurrently, and keep the best (ScoreSchemes).
|
||||
// alongside: started once the schemes are fed and before they are indexed, to run beside them.
|
||||
// alongside: started once the schemes are fed and their indexing has begun, to run beside it - it
|
||||
// may wait (StartCentreSpeculation waits for the beam-centre capture), and the indexing goes on.
|
||||
auto Rugnux::FirstPassRun::PickBest(IndexerThreadPool &pool, IndexAndRefine &idx,
|
||||
const std::function<void()> &alongside) -> FirstPass {
|
||||
const SchemeIndexers ris = FeedSchemes(pool);
|
||||
auto indexing = std::async(std::launch::async, [&ris] { RunIndexing(ris); });
|
||||
if (alongside)
|
||||
alongside();
|
||||
RunIndexing(ris);
|
||||
indexing.get();
|
||||
return ScoreSchemes(ris, idx);
|
||||
}
|
||||
|
||||
@@ -1558,9 +1560,10 @@ void Rugnux::FirstPassRun::StartShortAxisSpeculation() {
|
||||
}
|
||||
|
||||
auto Rugnux::FirstPassRun::IndexSchemes() -> FirstPass {
|
||||
// The short axis first: the measured centre's pass waits for the beam-centre capture.
|
||||
return PickBest(*indexer_pool, *indexer, [&] {
|
||||
StartCentreSpeculation();
|
||||
StartShortAxisSpeculation();
|
||||
StartCentreSpeculation();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user