Skip to content

Commit

Permalink
Re #7192. Adding more progress bar updates.
Browse files Browse the repository at this point in the history
The bar now updates after the event list is created in the thread
as well as at the start of creating the event list.

Also moved some delete statements earlier to when the data is no
longer needed.
  • Loading branch information
peterfpeterson committed May 28, 2013
1 parent 191b710 commit d9a9290
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Code/Mantid/Framework/DataHandling/src/LoadEventNexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ class ProcessBankData : public Task
}
} //(for each event)

// Free Memory
delete [] event_id;
delete [] event_time_of_flight;
delete event_index_ptr;

//------------ Compress Events (or set sort order) ------------------
// Do it on all the detector IDs we touched
for (detid_t pixID = 0; pixID <= alg->eventid_max; pixID++)
Expand All @@ -375,7 +380,7 @@ class ProcessBankData : public Task
}
}
}

prog->report(entry_name + ": filled events");

alg->getLogger().debug() << entry_name << (pulsetimesincreasing ? " had " : " DID NOT have ") <<
"monotonically increasing pulse times" << std::endl;
Expand All @@ -389,10 +394,7 @@ class ProcessBankData : public Task
alg->bad_tofs += badTofs;
}

// Free Memory
delete [] event_id;
delete [] event_time_of_flight;
delete event_index_ptr;

// For Linux with tcmalloc, make sure memory goes back;
// but don't call if more than 15% of memory is still available, since that slows down the loading.
MemoryManager::Instance().releaseFreeMemoryIfAbove(0.85);
Expand Down Expand Up @@ -1560,7 +1562,7 @@ void LoadEventNexus::loadEvents(API::Progress * const prog, const bool monitors)
shortest_tof = static_cast<double>(std::numeric_limits<uint32_t>::max()) * 0.1;
longest_tof = 0.;

Progress * prog2 = new Progress(this,0.3,1.0, bankNames.size()*3);
Progress * prog2 = new Progress(this,0.3,1.0, bankNames.size()*4);

// Make the thread pool
ThreadScheduler * scheduler = new ThreadSchedulerMutexes();
Expand Down

0 comments on commit d9a9290

Please sign in to comment.