Skip to content

Commit

Permalink
refs #6449 fixed MDEventWorkspaceTest and some minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts authored and martyngigg committed Apr 10, 2013
1 parent 6adccab commit 47bb31e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
5 changes: 1 addition & 4 deletions Code/Mantid/Framework/API/inc/MantidAPI/IMDNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,14 @@ class IMDNode
virtual const IMDNode * getBoxAtCoord(const coord_t * /*coords*/)=0;
virtual void getCenter(coord_t *const /*boxCenter*/)const =0;
virtual uint32_t getDepth() const=0;

virtual signal_t getSignalNormalized() const=0;


// -------------------------------- Geometry/vertexes-Related -------------------------------------------

virtual std::vector<Mantid::Kernel::VMD> getVertexes() const =0;

virtual coord_t * getVertexesArray(size_t & numVertices) const=0;

virtual coord_t * getVertexesArray(size_t & numVertices, const size_t outDimensions, const bool * maskDim) const=0;

virtual void transformDimensions(std::vector<double> & scaling, std::vector<double> & offset)=0;

// ----------------------------- Helper Methods --------------------------------------------------------
Expand Down
9 changes: 3 additions & 6 deletions Code/Mantid/Framework/MDEvents/inc/MantidMDEvents/MDBoxBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,9 @@ namespace MDEvents

// -------------------------------- Geometry/vertexes-Related -------------------------------------------

std::vector<Mantid::Kernel::VMD> getVertexes() const;

coord_t * getVertexesArray(size_t & numVertices) const;

coord_t * getVertexesArray(size_t & numVertices, const size_t outDimensions, const bool * maskDim) const;

virtual std::vector<Mantid::Kernel::VMD> getVertexes() const;
virtual coord_t * getVertexesArray(size_t & numVertices) const;
virtual coord_t * getVertexesArray(size_t & numVertices, const size_t outDimensions, const bool * maskDim) const;
virtual void transformDimensions(std::vector<double> & scaling, std::vector<double> & offset);

//-----------------------------------------------------------------------------------------------
Expand Down
11 changes: 6 additions & 5 deletions Code/Mantid/Framework/MDEvents/test/MDEventWorkspaceTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,10 @@ class MDEventWorkspaceTest : public CxxTest::TestSuite
}
// So it doesn't split
ws->getBoxController()->setSplitThreshold(1000);
// but split once to get grid box in the centre
ws->splitBox();
//ws->addManyEvents( events, NULL );
ws->getBox()->addEvents(events);
ws->addEvents(events);
ws->refreshCache();

// Base extents
Expand Down Expand Up @@ -663,13 +665,12 @@ class MDEventWorkspacePerformanceTest : public CxxTest::TestSuite
void test_splitting_performance_parallel()
{
auto ts_splitter = new ThreadSchedulerFIFO();
ThreadPool tp_splitter(ts_splitter,8);
ThreadPool tp_splitter(ts_splitter,4);
std::cout<<"Starting Workspace splitting performance test, 4 thread with "<<nBoxes <<" events \n";
Kernel::Timer clock;
std::cout<<"Starting Workspace splitting performance test, 8 thread with "<<nBoxes <<" events \n";
m_ws->splitAllIfNeeded(ts_splitter);
tp_splitter.joinAll();
std::cout << clock.elapsed()<<std::endl;
std::cout<<"Finished Workspace splitting performance test, 8 threads in "<< clock.elapsed()<<" sec\n";
std::cout<<"Finished Workspace splitting performance test, 4 threads in "<< clock.elapsed()<<" sec\n";
}
};

Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Vates/VatesAPI/src/vtkMDHexFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace Mantid
ReadLock lock(*ws);

// First we get all the boxes, up to the given depth; with or wo the slice function
std::vector<MDBoxBase<MDE,nd> *> boxes;
std::vector<API::IMDNode *> boxes;
if (this->slice)
ws->getBox()->getBoxes(boxes, m_maxDepth, true, this->sliceImplicitFunction);
else
Expand Down Expand Up @@ -97,7 +97,7 @@ namespace Mantid
{
// Get the box here
size_t i = size_t(ii);
MDBoxBase<MDE,nd> * box = boxes[i];
API::IMDNode * box = boxes[i];
Mantid::signal_t signal_normalized= box->getSignalNormalized();

if (!boost::math::isnan( signal_normalized ) && m_thresholdRange->inRange(signal_normalized))
Expand Down

0 comments on commit 47bb31e

Please sign in to comment.