Skip to content

Commit

Permalink
refs #9257. The way that logging works has changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Apr 11, 2014
1 parent 4c76678 commit 4975bb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
Expand Up @@ -11,11 +11,6 @@

namespace Mantid
{
namespace Kernel
{
class Logger;
}

namespace API
{
class Progress;
Expand Down Expand Up @@ -105,8 +100,6 @@ namespace Mantid
/// Run multithreaded
const boost::optional<int> m_nThreads;

Mantid::Kernel::Logger& m_logger;

};

} // namespace Crystal
Expand Down
18 changes: 10 additions & 8 deletions Code/Mantid/Framework/Crystal/src/ConnectedComponentLabeling.cpp
Expand Up @@ -222,6 +222,8 @@ namespace Mantid
while(iterator->next());
return currentLabelCount;
}

Logger g_log("ConnectedComponentLabeling");
}

/**
Expand All @@ -230,7 +232,7 @@ namespace Mantid
* @param nThreads : Optional argument of number of threads to use.
*/
ConnectedComponentLabeling::ConnectedComponentLabeling(const size_t& startId, const boost::optional<int> nThreads)
: m_startId(startId), m_nThreads(nThreads), m_logger(Kernel::Logger::get("ConnectedComponentLabeling"))
: m_startId(startId), m_nThreads(nThreads)
{
if(m_nThreads.is_initialized() && m_nThreads.get() < 0)
{
Expand Down Expand Up @@ -318,7 +320,7 @@ namespace Mantid
std::vector<std::map<size_t, boost::shared_ptr<Cluster> > > parallelClusterMapVec(nThreadsToUse);

// ------------- Stage One. Local CCL in parallel.
m_logger.debug("Parallel solve local CCL");
g_log.debug("Parallel solve local CCL");
PARALLEL_FOR_NO_WSP_CHECK()
for(int i = 0; i < nThreadsToUse; ++i)
{
Expand Down Expand Up @@ -361,7 +363,7 @@ namespace Mantid
}

// Percolate minimum label across boundaries for indexes where there is ambiguity.
m_logger.debug("Percolate minimum label across boundaries");
g_log.debug("Percolate minimum label across boundaries");
std::vector<boost::shared_ptr<Cluster> > incompleteClusterVec;
incompleteClusterVec.reserve(1000);
std::set<size_t> usedLabels;
Expand Down Expand Up @@ -399,7 +401,7 @@ namespace Mantid

// ------------- Stage 3 In parallel, process each incomplete cluster.
progress.doReport("Merging clusters across processors");
m_logger.debug("Merging clusters across processors");
g_log.debug("Merging clusters across processors");
progress.resetNumSteps(incompleteClusterVec.size(), 0.8, 0.9);
PARALLEL_FOR_NO_WSP_CHECK()
for(int i = 0; i < static_cast<int>(incompleteClusterVec.size()); ++i)
Expand All @@ -408,8 +410,8 @@ namespace Mantid
cluster->toUniformMinimum(neighbourElements);
progress.report();
}
m_logger.debug("Remove duplicates");
m_logger.debug() << incompleteClusterVec.size() << " clusters to reconstruct" << std::endl;
g_log.debug("Remove duplicates");
g_log.debug() << incompleteClusterVec.size() << " clusters to reconstruct" << std::endl;
// Now combine clusters and add the resolved clusters to the clusterMap.
for(size_t i = 0; i < incompleteClusterVec.size(); ++i)
{
Expand Down Expand Up @@ -488,9 +490,9 @@ namespace Mantid
ClusterMap clusters = calculateDisjointTree(ws, strategy,progress);

// Create the output workspace from the input workspace
m_logger.debug("Start cloning input workspace");
g_log.debug("Start cloning input workspace");
IMDHistoWorkspace_sptr outWS = cloneInputWorkspace(ws);
m_logger.debug("Finish cloning input workspace");
g_log.debug("Finish cloning input workspace");

// Get the keys (label ids) first in order to do the next stage in parallel.
VecIndexes keys;
Expand Down

0 comments on commit 4975bb8

Please sign in to comment.