Skip to content

Commit a47f3c2

Browse files
committed
changes from comments
1 parent 673eac3 commit a47f3c2

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

Framework/DataHandling/src/LoadBankFromDiskTask.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void LoadBankFromDiskTask::loadPulseTimes(Nexus::File &file) {
9797
}
9898

9999
// Not found? Need to load and add it
100-
thisBankPulseTimes = std::make_shared<BankPulseTimes>(boost::ref(file), m_framePeriodNumbers);
100+
thisBankPulseTimes = std::make_shared<BankPulseTimes>(file, m_framePeriodNumbers);
101101
m_loader.m_bankPulseTimes.emplace_back(thisBankPulseTimes);
102102
}
103103

@@ -190,7 +190,7 @@ std::unique_ptr<std::vector<uint32_t>> LoadBankFromDiskTask::loadEventId(Nexus::
190190

191191
// determine the range of pixel ids
192192
{
193-
const auto [min_id, max_id] = Mantid::Kernel::parallel_minmax<uint32_t>(event_id.get(), 1);
193+
const auto [min_id, max_id] = Mantid::Kernel::parallel_minmax<uint32_t>(event_id.get());
194194
m_min_id = min_id;
195195
m_max_id = max_id;
196196
}
@@ -470,14 +470,13 @@ void LoadBankFromDiskTask::run() {
470470
// this method is for unweighted events that the user wants compressed on load
471471

472472
// TODO should this be created elsewhere?
473-
const auto [tof_min, tof_max] =
474-
std::minmax_element(event_time_of_flight_shrd->cbegin(), event_time_of_flight_shrd->cend());
473+
const auto [tof_min, tof_max] = Mantid::Kernel::parallel_minmax(event_time_of_flight.get());
475474

476475
const bool log_compression = (m_loader.alg->compressTolerance < 0);
477476

478477
// reduce tof range if filtering was requested
479-
auto tof_min_fixed = *tof_min;
480-
auto tof_max_fixed = *tof_max;
478+
auto tof_min_fixed = tof_min;
479+
auto tof_max_fixed = tof_max;
481480
if (m_loader.alg->filter_tof_range) {
482481
if (m_loader.alg->filter_tof_max != EMPTY_DBL())
483482
tof_max_fixed = std::min<float>(tof_max_fixed, static_cast<float>(m_loader.alg->filter_tof_max));

Framework/DataHandling/src/ProcessBankData.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ void ProcessBankData::run() {
235235
if (alg->getLogger().isDebug())
236236
alg->getLogger().debug() << "Time to ProcessBankData " << entry_name << " " << timer << "\n";
237237
#endif
238+
event_detid.reset();
239+
event_time_of_flight.reset();
240+
event_index.reset();
241+
event_weight.reset();
242+
thisBankPulseTimes.reset();
238243
} // END-OF-RUN()
239244

240245
/**

Framework/Kernel/inc/MantidKernel/ParallelMinMax.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ template <typename T> class MANTID_KERNEL_DLL MinMaxFinder {
3131

3232
/** parallel_minmax
3333
* @param vec -- a pointer to a vector of values of type T, to search for a min and max
34-
* @param grainsize -- the grainsize for use in tbb::parallel_reduce. Default = 2
34+
* @param grainsize -- the grainsize for use in tbb::parallel_reduce. Default = 1000
3535
* @return a std::pair<T,T> with the min (first) and max (second)
3636
*/
37-
template <typename T> std::pair<T, T> parallel_minmax(std::vector<T> const *const vec, size_t const grainsize = 2);
37+
template <typename T> std::pair<T, T> parallel_minmax(std::vector<T> const *const vec, size_t const grainsize = 1000);
3838
} // namespace Mantid::Kernel

Framework/Kernel/inc/MantidKernel/ThreadScheduler.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ class MANTID_KERNEL_DLL ThreadScheduler {
5757
* @param task :: the Task that was completed.
5858
* @param threadnum :: Thread ID that launched the task
5959
*/
60-
virtual void finished(Task *task, size_t threadnum) {
61-
UNUSED_ARG(task);
62-
UNUSED_ARG(threadnum);
63-
}
60+
virtual void finished(Task *, size_t) {}
6461

6562
//-----------------------------------------------------------------------------------
6663
/** Signal to the scheduler that a task is complete. The

Framework/Kernel/src/ParallelMinMax.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ template <typename T> std::pair<T, T> parallel_minmax(std::vector<T> const *cons
3434
#define EXPORTPARALLELMINMAX(type) \
3535
template std::pair<type, type> MANTID_KERNEL_DLL parallel_minmax(std::vector<type> const *const, size_t);
3636

37+
EXPORTPARALLELMINMAX(float)
3738
EXPORTPARALLELMINMAX(double)
3839
EXPORTPARALLELMINMAX(uint32_t)
3940

0 commit comments

Comments
 (0)