diff --git a/common/HostMemory.h b/common/HostMemory.h index d016ddb58..07dae951b 100644 --- a/common/HostMemory.h +++ b/common/HostMemory.h @@ -22,7 +22,7 @@ size_t DefaultHostMemoryBudget(); // The share of the budget that the large per-worker buffers of parallel steps - a translation function's // grids, a null replicate's model maps - may hold at once. The rest is what the run holds beside them: // its reflections, its merge, the detector-sized arrays. -constexpr double HOST_WORKER_POOL_FRACTION = 1.0 / 3.0; +constexpr double HOST_WORKER_POOL_FRACTION = 0.5; // One pool for those buffers, process-wide. A worker reserves its bytes before it makes them and hands // them back when it is done; one that would take the pool past its size waits until others have handed diff --git a/image_analysis/structure_refinement/ModelGrid.h b/image_analysis/structure_refinement/ModelGrid.h index 96f647292..b6075a999 100644 --- a/image_analysis/structure_refinement/ModelGrid.h +++ b/image_analysis/structure_refinement/ModelGrid.h @@ -36,3 +36,6 @@ size_t ModelGridPoints(const gemmi::UnitCell &cell, const gemmi::SpaceGroup *sg, // and the bulk-solvent mask grids, and for each of them its transform's input copy, spectrum and coefficients, // with the two made at once (ModelValidation's compute_model_factors). constexpr size_t MODEL_FACTORS_BYTES_PER_GRID_POINT = 32; +// What a molecular-replacement placement's structure factors and rigid body hold on the CPU at their peak, per +// point of that grid: measured at under half of the above. +constexpr size_t MODEL_PLACEMENT_BYTES_PER_GRID_POINT = 16; diff --git a/image_analysis/structure_refinement/MolecularReplacement.cpp b/image_analysis/structure_refinement/MolecularReplacement.cpp index 53af8ec8c..5d976310f 100644 --- a/image_analysis/structure_refinement/MolecularReplacement.cpp +++ b/image_analysis/structure_refinement/MolecularReplacement.cpp @@ -2777,7 +2777,7 @@ MolecularReplacementResult search_model(const SearchModel &model, const std::vec // gigabyte or more of grids on a large cell, so each reserves them against the host's worker // pool first (HostWorkerPool), as a null replicate does. const size_t placement_bytes = get_gpu_count() == 0 - ? MODEL_FACTORS_BYTES_PER_GRID_POINT * ModelGridPoints(cell, &sg, d_min) + ? MODEL_PLACEMENT_BYTES_PER_GRID_POINT * ModelGridPoints(cell, &sg, d_min) : 0; for (First *f : to_refine) running.push_back(std::async(std::launch::async, [&, f] {