diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmProxy.h b/Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmProxy.h index 5708e4bdebcd5d9981f3284543e7796948cb765e..f71a4818aa24df9d4ee085e9b414ae1735f7e1be 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmProxy.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmProxy.h @@ -93,9 +93,9 @@ namespace Mantid bool isExecuted() const; /// To query whether algorithm is a child. A proxy is always at top level, returns false - bool isChild() const {return false;} + bool isChild() const {return m_isChild;} void setAlwaysStoreInADS(const bool ) {} - void setChild(const bool) {} ///< Do nothing + void setChild(const bool val) {m_isChild = val;}; void setRethrows(const bool rethrow); /** @name PropertyManager methods */ @@ -156,6 +156,7 @@ namespace Mantid bool m_isExecuted; ///< Executed flag bool m_isLoggingEnabled;///< is the logging of the underlying algorithm enabled bool m_rethrow; ///< Whether or not to rethrow exceptions. + bool m_isChild; ///< Is this a child algo /// Temporary holder of external observers wishing to subscribe mutable std::vector<const Poco::AbstractObserver*> m_externalObservers; diff --git a/Code/Mantid/Framework/API/src/Algorithm.cpp b/Code/Mantid/Framework/API/src/Algorithm.cpp index 9d581d7e7d20ae8114619419a3e443305b1330ce..21a8b9b7dd1d8f139316e64197c69f1634af237c 100644 --- a/Code/Mantid/Framework/API/src/Algorithm.cpp +++ b/Code/Mantid/Framework/API/src/Algorithm.cpp @@ -411,6 +411,8 @@ namespace Mantid // no logging of input if a child algorithm (except for python child algos) if (!m_isChildAlgorithm || m_alwaysStoreInADS) logAlgorithmInfo(); + g_log.debug() << this->name() << " is executing with isChild = " << this->isChild() << std::endl; + // Check all properties for validity if ( !validateProperties() ) { @@ -491,11 +493,13 @@ namespace Mantid // RJT, 19/3/08: Moved this up from below the catch blocks setExecuted(true); - if (!m_isChildAlgorithm) + if (!m_isChildAlgorithm || m_alwaysStoreInADS) { g_log.notice() << name() << " successful, Duration " << std::fixed << std::setprecision(2) << duration << " seconds" << std::endl; } + else + g_log.debug() << name() << " finished with isChild = " << isChild() << std::endl; m_running = false; } catch(std::runtime_error& ex) @@ -814,6 +818,7 @@ namespace Mantid copyPropertiesFrom(proxy); m_algorithmID = proxy.getAlgorithmID(); setLogging(proxy.isLogging()); + setChild(proxy.isChild()); } @@ -883,7 +888,10 @@ namespace Mantid /** Sends out algorithm parameter information to the logger */ void Algorithm::logAlgorithmInfo() const { - g_log.notice() << name() << " started"<< std::endl; + g_log.notice() << name() << " started"; + if (this->isChild()) + g_log.notice() << " (child)"; + g_log.notice() << std::endl; // Make use of the AlgorithmHistory class, which holds all the info we want here AlgorithmHistory AH(this); g_log.information() << AH; diff --git a/Code/Mantid/Framework/API/src/AlgorithmProxy.cpp b/Code/Mantid/Framework/API/src/AlgorithmProxy.cpp index 262738782ae804f4f02772ff8b664bb2f7cb9674..9acd83601aff201609d20fc89fa36c33cfecf0c1 100644 --- a/Code/Mantid/Framework/API/src/AlgorithmProxy.cpp +++ b/Code/Mantid/Framework/API/src/AlgorithmProxy.cpp @@ -25,7 +25,8 @@ namespace Mantid PropertyManagerOwner(),_executeAsync(this,&AlgorithmProxy::executeAsyncImpl), m_name(alg->name()),m_category(alg->category()), m_categorySeparator(alg->categorySeparator()), m_alias(alg->alias()), m_version(alg->version()), m_alg(alg), - m_isExecuted(),m_isLoggingEnabled(true), m_rethrow(false) + m_isExecuted(),m_isLoggingEnabled(true), m_rethrow(false), + m_isChild(false) { if (!alg) { diff --git a/Code/Mantid/Framework/API/test/AlgorithmProxyTest.h b/Code/Mantid/Framework/API/test/AlgorithmProxyTest.h index 07ee08e6dbe93f7110b6a6a80a3befd0f6df6a86..5ee8054b7dc4a938ec5bd8d8043a315cc773a27a 100644 --- a/Code/Mantid/Framework/API/test/AlgorithmProxyTest.h +++ b/Code/Mantid/Framework/API/test/AlgorithmProxyTest.h @@ -120,8 +120,6 @@ public: TS_ASSERT_EQUALS( alg->category() , "ProxyCat" ); TS_ASSERT_EQUALS( alg->alias(), "Dog"); TS_ASSERT( alg->isInitialized() ); - alg->setChild(true); - TS_ASSERT( !alg->isChild() ); TS_ASSERT( alg->existsProperty("prop1") ); TS_ASSERT( alg->existsProperty("prop2") ); TS_ASSERT( !alg->isRunning() ); diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp index 46f3fb1af89205824708cdf0dc7531ff22dfedfe..0a7ee4755310383c9dd5f78e99aa78de5946bf05 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp @@ -129,8 +129,8 @@ void EQSANSDarkCurrentSubtraction::exec() loadAlg->setProperty("Filename", fileName); loadAlg->setPropertyValue("OutputWorkspace", darkWSName); loadAlg->execute(); - darkWS = boost::dynamic_pointer_cast<MatrixWorkspace>(AnalysisDataService::Instance().retrieve(darkWSName)); - //darkWS = loadAlg->getProperty("OutputWorkspace"); + //darkWS = boost::dynamic_pointer_cast<MatrixWorkspace>(AnalysisDataService::Instance().retrieve(darkWSName)); + darkWS = loadAlg->getProperty("OutputWorkspace"); } setProperty("OutputDarkCurrentWorkspace", darkWS); } diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp index 6d61a2ecf453b16152203171b7cdbc312982bdcd..30b97dd2ff3571ad8f15546e0cb92f30f2d82abf 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp @@ -113,7 +113,8 @@ void HFIRDarkCurrentSubtraction::exec() loadAlg->setProperty("Filename", fileName); loadAlg->setPropertyValue("OutputWorkspace", darkWSName); loadAlg->execute(); - darkWS = boost::dynamic_pointer_cast<MatrixWorkspace>(AnalysisDataService::Instance().retrieve(darkWSName)); + //darkWS = boost::dynamic_pointer_cast<MatrixWorkspace>(AnalysisDataService::Instance().retrieve(darkWSName)); + darkWS = loadAlg->getProperty("OutputWorkspace"); } setProperty("OutputDarkCurrentWorkspace", darkWS); } diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp index 025722bcea66bd1adc887eae3e75509f2fcb9e05..23322f821a24e21630bdeaabe19fc5bf3f4da214 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp @@ -191,7 +191,9 @@ void SANSSensitivityCorrection::exec() if (!isEmpty(center_x) && loadAlg->existsProperty("BeamCenterX")) loadAlg->setProperty("BeamCenterX", center_x); if (!isEmpty(center_y) && loadAlg->existsProperty("BeamCenterY")) loadAlg->setProperty("BeamCenterY", center_y); loadAlg->execute(); - rawFloodWS = boost::dynamic_pointer_cast<MatrixWorkspace>(AnalysisDataService::Instance().retrieve(rawFloodWSName)); + rawFloodWS = loadAlg->getProperty("OutputWorkspace"); + // rawFloodWS = boost::dynamic_pointer_cast<MatrixWorkspace>(AnalysisDataService::Instance().retrieve(rawFloodWSName)); + //AnalysisDataService::Instance().addOrReplace(rawFloodWSName, rawFloodWS); m_output_message += " |Loaded " + fileName + "\n"; if (loadAlg->existsProperty("OutputMessage")) {