diff --git a/image_analysis/structure_refinement/Refinement.cpp b/image_analysis/structure_refinement/Refinement.cpp index 3e1cf4d5c..2ade4b84b 100644 --- a/image_analysis/structure_refinement/Refinement.cpp +++ b/image_analysis/structure_refinement/Refinement.cpp @@ -4212,6 +4212,17 @@ RefinementResult RefineModel(const gemmi::Structure &placed, const std::vector &data = moved > 0 ? closed : merged; + // RefinementSettings::lean_on_cpu +#ifdef JFJOCH_USE_CUDA + const bool on_cpu = !settings.gpu || get_gpu_count() == 0; +#else + const bool on_cpu = true; +#endif + if (settings.lean_on_cpu && on_cpu) { + settings.population = 0; + settings.rounds = 1; + logger.Info("Refinement on the CPU: no population and one round (half of the evaluations)"); + } // Each arm, untwinned and twinned, is a whole refinement - the solvent built and the displacement model chosen // against its own target - and the decision is taken on where they ended. A model only scored is scored both // ways and decided by the same rule, so the R-free it reports is not an untwinned one by default. diff --git a/image_analysis/structure_refinement/Refinement.h b/image_analysis/structure_refinement/Refinement.h index 90a3c27a9..484001fd5 100644 --- a/image_analysis/structure_refinement/Refinement.h +++ b/image_analysis/structure_refinement/Refinement.h @@ -97,6 +97,11 @@ struct RefinementSettings { // model of this crystal scored on a free set drawn here). bool as_given_competes = true; bool gpu = true; + // Where the refinement runs on the CPU (no GPU wanted, or none to run on), where an evaluation costs some thirty + // times a GPU's: no population and one round, for about half of the evaluations, at an R-free 0.001 higher in the + // median of 19 sets (at most 0.015, a placed prediction the population helps). The twinned data are still refined + // against: without that arm a crystal 30% twinned is refined as untwinned. + bool lean_on_cpu = true; size_t nthreads = 1; size_t gpu_resident_bytes = 0; // held on the card by what runs beside // The most weight trials run side by side, 0 for as many as the ladders and the cards take; the result does not