Skip to content

Commit

Permalink
Refs #4782 fix MDEventWorkspace parallel iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed Feb 10, 2012
1 parent da0f6f6 commit c488944
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MDEvents/src/MDEventWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ namespace MDEvents
std::vector<IMDBox<MDE,nd> *> boxes;
// TODO: Should this be leaf only? Depends on most common use case
if (function)
data->getBoxes(boxes, 10000, true, function);
this->data->getBoxes(boxes, 10000, true, function);
else
data->getBoxes(boxes, 10000, true);
this->data->getBoxes(boxes, 10000, true);

// Calculate the right number of cores
size_t numCores = suggestedNumCores;
Expand Down
16 changes: 16 additions & 0 deletions Code/Mantid/Framework/MDEvents/test/MDEventWorkspaceTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ class MDEventWorkspaceTest : public CxxTest::TestSuite
delete ew;
}

//-------------------------------------------------------------------------------------
/** Create several IMDIterators to run them in parallel */
void test_createIterators()
{
MDEventWorkspace3 * ew = new MDEventWorkspace3();
BoxController_sptr bc = ew->getBoxController();
bc->setSplitInto(4);
ew->splitBox();
std::vector<IMDIterator *> iterators = ew->createIterators(3);
TS_ASSERT_EQUALS(iterators.size(), 3);

TS_ASSERT_EQUALS(iterators[0]->getDataSize(), 21);
TS_ASSERT_EQUALS(iterators[1]->getDataSize(), 21);
TS_ASSERT_EQUALS(iterators[2]->getDataSize(), 22);
}

//-------------------------------------------------------------------------------------
/** Method that makes a table workspace for use in MantidPlot */
void test_makeBoxTable()
Expand Down

0 comments on commit c488944

Please sign in to comment.