Skip to content

Commit

Permalink
refs #5682 Changes which hide the modifications, introduced earlier
Browse files Browse the repository at this point in the history
according to ticket #5552
  • Loading branch information
abuts committed Aug 4, 2012
1 parent b43baf4 commit 40b7b2c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
6 changes: 2 additions & 4 deletions Code/Mantid/Framework/API/inc/MantidAPI/BoxController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "MantidNexusCPP/NeXusFile.hpp"
#include <boost/shared_ptr.hpp>
#include <vector>
#include "MantidAPI/BoxCtrlChangesInterface.h"


namespace Mantid
{
Expand Down Expand Up @@ -491,9 +491,7 @@ namespace API
private:
/// Number of bytes in a single MDLeanEvent<> of the workspace.
size_t m_bytesPerEvent;

//BoxCtrlChangesInterface *m_ChangesList;


};

/// Shared ptr to BoxController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define MDEVENTS_MDBOX_CHANGESLIST_H
#include "MantidKernel/System.h"
#include "MantidKernel/ThreadScheduler.h"
#include "MantidAPI/BoxCtrlChangesInterface.h"
#include "MantidMDEvents/MDBox.h"
#include "MantidMDEvents/MDGridBox.h"
namespace Mantid
Expand Down
33 changes: 22 additions & 11 deletions Code/Mantid/Framework/MDEvents/src/ConvToMDHistoWS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ void ConvToMDHistoWS::runConversion(API::Progress *pProgress)
// if any property dimension is outside of the data range requested, the job is done;
if(!m_QConverter->calcGenericVariables(m_Coord,m_NDims))return;

//Kernel::ThreadScheduler * ts = NULL;
//pProgress->resetNumSteps(nValidSpectra,0,1);

// Create the thread pool that will run all of these.
//Kernel::ThreadScheduler * ts = new Kernel::ThreadSchedulerFIFO();
Kernel::ThreadScheduler * ts = new Kernel::ThreadSchedulerFIFO();
// initiate thread pool with number of machine's cores (0 in tp constructor)
Kernel::ThreadScheduler * ts = NULL;
pProgress->resetNumSteps(nValidSpectra,0,1);
//Kernel::ThreadPool tp(ts, 0, new API::Progress(*pProgress));
Kernel::ThreadPool tp(ts, 0, new API::Progress(*pProgress));
// estimate the size of data conversion a single thread should perform

//size_t nThreads = tp.getNumPhysicalCores();
Expand All @@ -160,22 +160,33 @@ void ConvToMDHistoWS::runConversion(API::Progress *pProgress)
n_added_events+=n_thread_ev;
nEventsInWS +=n_thread_ev;

if (m_OutWSWrapper->ifNeedsSplitting())
if (bc->shouldSplitBoxes(nEventsInWS,n_added_events, lastNumBoxes))
{
// Do all the adding tasks
//tp.joinAll();
tp.joinAll();
// Now do all the splitting tasks
//m_OutWSWrapper->pWorkspace()->splitAllIfNeeded(ts);
m_OutWSWrapper->splitList(ts);
//if (ts->size() > 0) tp.joinAll();
m_OutWSWrapper->pWorkspace()->splitAllIfNeeded(ts);
if (ts->size() > 0) tp.joinAll();
// Count the new # of boxes.
lastNumBoxes = m_OutWSWrapper->pWorkspace()->getBoxController()->getTotalNumMDBoxes();
}
pProgress->report(i);
//if (m_OutWSWrapper->ifNeedsSplitting())
//{
// // Do all the adding tasks
// //tp.joinAll();
// // Now do all the splitting tasks
// //m_OutWSWrapper->pWorkspace()->splitAllIfNeeded(ts);
// m_OutWSWrapper->splitList(ts);
// //if (ts->size() > 0) tp.joinAll();
// // Count the new # of boxes.
// lastNumBoxes = m_OutWSWrapper->pWorkspace()->getBoxController()->getTotalNumMDBoxes();
//}
//pProgress->report(i);
} // end detectors loop;

m_OutWSWrapper->splitList(ts);
// m_OutWSWrapper->pWorkspace()->splitAllIfNeeded(ts);
// m_OutWSWrapper->splitList(ts);
m_OutWSWrapper->pWorkspace()->splitAllIfNeeded(ts);
m_OutWSWrapper->pWorkspace()->refreshCache();
m_OutWSWrapper->refreshCentroid();
pProgress->report();
Expand Down

0 comments on commit 40b7b2c

Please sign in to comment.