Skip to content
Snippets Groups Projects
Commit 79da6b54 authored by Simon Heybrock's avatar Simon Heybrock
Browse files

Re #21181. Keep partitioner in IndexInfo permanently.

parent 53cfb708
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ class Communicator; ...@@ -17,6 +17,7 @@ class Communicator;
} }
namespace Indexing { namespace Indexing {
class GlobalSpectrumIndex; class GlobalSpectrumIndex;
class RoundRobinPartitioner;
class SpectrumIndexSet; class SpectrumIndexSet;
class SpectrumNumberTranslator; class SpectrumNumberTranslator;
...@@ -135,6 +136,7 @@ private: ...@@ -135,6 +136,7 @@ private:
nullptr}; nullptr};
mutable Kernel::cow_ptr<SpectrumNumberTranslator> m_spectrumNumberTranslator{ mutable Kernel::cow_ptr<SpectrumNumberTranslator> m_spectrumNumberTranslator{
nullptr}; nullptr};
mutable std::unique_ptr<RoundRobinPartitioner> m_partitioner;
}; };
} // namespace Indexing } // namespace Indexing
......
...@@ -80,7 +80,9 @@ IndexInfo::IndexInfo(const IndexInfo &other) ...@@ -80,7 +80,9 @@ IndexInfo::IndexInfo(const IndexInfo &other)
m_communicator( m_communicator(
Kernel::make_unique<Parallel::Communicator>(*other.m_communicator)), Kernel::make_unique<Parallel::Communicator>(*other.m_communicator)),
m_spectrumDefinitions(other.m_spectrumDefinitions), 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; IndexInfo::IndexInfo(IndexInfo &&) = default;
...@@ -307,11 +309,11 @@ void IndexInfo::makeSpectrumNumberTranslator( ...@@ -307,11 +309,11 @@ void IndexInfo::makeSpectrumNumberTranslator(
throw std::runtime_error("IndexInfo: unknown storage mode " + throw std::runtime_error("IndexInfo: unknown storage mode " +
Parallel::toString(m_storageMode)); Parallel::toString(m_storageMode));
} }
auto partitioner = Kernel::make_unique<RoundRobinPartitioner>( m_partitioner = Kernel::make_unique<RoundRobinPartitioner>(
numberOfPartitions, partition, numberOfPartitions, partition,
Partitioner::MonitorStrategy::TreatAsNormalSpectrum); Partitioner::MonitorStrategy::TreatAsNormalSpectrum);
m_spectrumNumberTranslator = Kernel::make_cow<SpectrumNumberTranslator>( 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>, template MANTID_INDEXING_DLL IndexInfo::IndexInfo(std::vector<SpectrumNumber>,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment