Skip to content

Commit

Permalink
refs #6362 Not calling Nexus writer when no events to write
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 22, 2013
1 parent b88385a commit 3481938
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Code/Mantid/Framework/MDAlgorithms/src/SaveMD.cpp
Expand Up @@ -328,10 +328,11 @@ namespace MDAlgorithms
MDBox<MDE,nd> * mdBox = dynamic_cast<MDBox<MDE,nd> *>(Box);
if(!mdBox) throw std::runtime_error("found unfamiliar type of box");
// Store the index
uint64_t nEvents = mdBox->getNPoints();
box_event_index[id*2] = mdBox->getFilePosition();
box_event_index[id*2+1] = mdBox->getNPoints();
box_event_index[id*2+1] = nEvents;
// save for the first time
if(!update)mdBox->saveNexus(file);
if(!update && nEvents>0)mdBox->saveNexus(file);
// set that it is on disk and clear the actual events to free up memory, saving occured earlier
if (MakeFileBacked) mdBox->clearDataFromMemory();

Expand Down

0 comments on commit 3481938

Please sign in to comment.