diff --git a/Framework/Indexing/inc/MantidIndexing/IndexInfo.h b/Framework/Indexing/inc/MantidIndexing/IndexInfo.h index b96a988ca0a99235f8c381acc52fbf0695404f16..59513b6182ee38ea3bc8a0b827e4dfcd61696cc4 100644 --- a/Framework/Indexing/inc/MantidIndexing/IndexInfo.h +++ b/Framework/Indexing/inc/MantidIndexing/IndexInfo.h @@ -17,6 +17,7 @@ class Communicator; } namespace Indexing { class GlobalSpectrumIndex; +class RoundRobinPartitioner; class SpectrumIndexSet; class SpectrumNumberTranslator; @@ -135,6 +136,7 @@ private: nullptr}; mutable Kernel::cow_ptr<SpectrumNumberTranslator> m_spectrumNumberTranslator{ nullptr}; + mutable std::unique_ptr<RoundRobinPartitioner> m_partitioner; }; } // namespace Indexing diff --git a/Framework/Indexing/src/IndexInfo.cpp b/Framework/Indexing/src/IndexInfo.cpp index 30e91a8dd85b0657a3b315ebbc79b51c53f8b37e..ad0f012a809e3fc81b62ca44d2dfc9e9dea970b5 100644 --- a/Framework/Indexing/src/IndexInfo.cpp +++ b/Framework/Indexing/src/IndexInfo.cpp @@ -80,7 +80,9 @@ IndexInfo::IndexInfo(const IndexInfo &other) m_communicator( Kernel::make_unique<Parallel::Communicator>(*other.m_communicator)), m_spectrumDefinitions(other.m_spectrumDefinitions), - m_spectrumNumberTranslator(other.m_spectrumNumberTranslator) {} + m_spectrumNumberTranslator(other.m_spectrumNumberTranslator), + m_partitioner( + Kernel::make_unique<RoundRobinPartitioner>(*other.m_partitioner)) {} IndexInfo::IndexInfo(IndexInfo &&) = default; @@ -307,11 +309,11 @@ void IndexInfo::makeSpectrumNumberTranslator( throw std::runtime_error("IndexInfo: unknown storage mode " + Parallel::toString(m_storageMode)); } - auto partitioner = Kernel::make_unique<RoundRobinPartitioner>( + m_partitioner = Kernel::make_unique<RoundRobinPartitioner>( numberOfPartitions, partition, Partitioner::MonitorStrategy::TreatAsNormalSpectrum); m_spectrumNumberTranslator = Kernel::make_cow<SpectrumNumberTranslator>( - std::move(spectrumNumbers), *partitioner, partition); + std::move(spectrumNumbers), *m_partitioner, partition); } template MANTID_INDEXING_DLL IndexInfo::IndexInfo(std::vector<SpectrumNumber>,