Skip to content

Commit

Permalink
Refs #4980 event workspace size fixed for append
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Mar 26, 2012
1 parent 96ccfba commit 5589a17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class GatherWorkspaces : public API::Algorithm
void execEvent();
DataObjects::EventWorkspace_const_sptr eventW;
std::size_t totalSpec;
std::size_t sumSpec;
int hist;
std::size_t numBins;
mpi::communicator included;
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/MPIAlgorithms/src/GatherWorkspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void GatherWorkspaces::exec()
std::string accum = this->getPropertyValue("AccumulationMethod");
// Get the total number of spectra in the combined inputs
totalSpec = inputWorkspace->getNumberHistograms();
size_t sumSpec = totalSpec;
sumSpec = totalSpec;
if (accum == "Append")
{
reduce(included, totalSpec, sumSpec, std::plus<std::size_t>(), 0);
Expand Down Expand Up @@ -194,7 +194,7 @@ void GatherWorkspaces::execEvent()
g_log.debug() << "Total number of spectra is " << totalSpec << "\n";
// Create the workspace for the output
outputWorkspace =
boost::dynamic_pointer_cast<EventWorkspace>( API::WorkspaceFactory::Instance().create("EventWorkspace", totalSpec,numBins+hist,numBins));
boost::dynamic_pointer_cast<EventWorkspace>( API::WorkspaceFactory::Instance().create("EventWorkspace", sumSpec,numBins+hist,numBins));
//Copy geometry over.
API::WorkspaceFactory::Instance().initializeFromParent(eventW, outputWorkspace, true);
setProperty("OutputWorkspace",outputWorkspace);
Expand Down

0 comments on commit 5589a17

Please sign in to comment.