diff --git a/image_analysis/structure_refinement/Refinement.cpp b/image_analysis/structure_refinement/Refinement.cpp index 60846728d..760b19f60 100644 --- a/image_analysis/structure_refinement/Refinement.cpp +++ b/image_analysis/structure_refinement/Refinement.cpp @@ -118,6 +118,9 @@ struct Context { std::unique_ptr scale_gpu; #endif size_t nthreads = 1; + // the likelihood fit's: all of the run's, also in a trial's slot - the slots refit at the same time, the GPU + // idles meanwhile, and the bins they queue on the shared worker pool are fitted by whichever thread is free + size_t ml_threads = 1; int device = -1; // the engine's GPU size_t engine_bytes = 0; // and what it holds there XrayRowModel rows; @@ -260,7 +263,7 @@ struct Context { } { const RefinementStage s4("refit.ml"); - EstimateLikelihoodParameters(refl, fmodel, rows, nthreads); + EstimateLikelihoodParameters(refl, fmodel, rows, ml_threads); } engine->SetRowModel(rows); return ComputeRFactors(refl, fmodel); @@ -967,6 +970,7 @@ std::unique_ptr MakeOwnSlot(const gemmi::Structure &before_topology, co ctx.d_min = main.d_min; ctx.refl = main.refl; ctx.nthreads = nthreads; + ctx.ml_threads = settings.nthreads; ctx.cancel = main.cancel; ctx.b_ceiling = main.b_ceiling; ctx.mask = std::make_unique(ctx.cell, *ctx.sg, ctx.d_min, nthreads); @@ -1158,6 +1162,7 @@ RefinementResult RefineModel(const gemmi::Structure &placed, const std::vector(ctx.atoms.size());