本文整理汇总了C++中IAlgorithm_sptr::setAlwaysStoreInADS方法的典型用法代码示例。如果您正苦于以下问题:C++ IAlgorithm_sptr::setAlwaysStoreInADS方法的具体用法?C++ IAlgorithm_sptr::setAlwaysStoreInADS怎么用?C++ IAlgorithm_sptr::setAlwaysStoreInADS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAlgorithm_sptr
的用法示例。
在下文中一共展示了IAlgorithm_sptr::setAlwaysStoreInADS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createChildAlgorithm
Workspace_sptr
GenericDataProcessorAlgorithm<Base>::assemble(const std::string &partialWSName,
const std::string &outputWSName) {
#ifdef MPI_BUILD
std::string threadOutput = partialWSName;
Workspace_sptr partialWS =
AnalysisDataService::Instance().retrieve(partialWSName);
IAlgorithm_sptr gatherAlg = createChildAlgorithm("GatherWorkspaces");
gatherAlg->setLogging(true);
gatherAlg->setAlwaysStoreInADS(true);
gatherAlg->setProperty("InputWorkspace", partialWS);
gatherAlg->setProperty("PreserveEvents", true);
gatherAlg->setPropertyValue("OutputWorkspace", outputWSName);
gatherAlg->execute();
if (isMainThread())
threadOutput = outputWSName;
#else
UNUSED_ARG(outputWSName)
const std::string &threadOutput = partialWSName;
#endif
Workspace_sptr outputWS =
AnalysisDataService::Instance().retrieve(threadOutput);
return outputWS;
}
示例2: p
Workspace_sptr
GenericDataProcessorAlgorithm<Base>::load(const std::string &inputData,
const bool loadQuiet) {
Workspace_sptr inputWS;
// First, check whether we have the name of an existing workspace
if (AnalysisDataService::Instance().doesExist(inputData)) {
inputWS = AnalysisDataService::Instance().retrieve(inputData);
} else {
std::string foundFile = FileFinder::Instance().getFullPath(inputData);
if (foundFile.empty()) {
// Get facility extensions
FacilityInfo facilityInfo = ConfigService::Instance().getFacility();
const std::vector<std::string> facilityExts = facilityInfo.extensions();
foundFile = FileFinder::Instance().findRun(inputData, facilityExts);
}
if (!foundFile.empty()) {
Poco::Path p(foundFile);
const std::string outputWSName = p.getBaseName();
IAlgorithm_sptr loadAlg = createChildAlgorithm(m_loadAlg);
loadAlg->setProperty(m_loadAlgFileProp, foundFile);
if (!loadQuiet) {
loadAlg->setAlwaysStoreInADS(true);
}
// Set up MPI if available
#ifdef MPI_BUILD
// First, check whether the loader allows use to chunk the data
if (loadAlg->existsProperty("ChunkNumber") &&
loadAlg->existsProperty("TotalChunks")) {
m_useMPI = true;
// The communicator containing all processes
boost::mpi::communicator world;
g_log.notice() << "Chunk/Total: " << world.rank() + 1 << "/"
<< world.size() << '\n';
loadAlg->setPropertyValue("OutputWorkspace", outputWSName);
loadAlg->setProperty("ChunkNumber", world.rank() + 1);
loadAlg->setProperty("TotalChunks", world.size());
}
#endif
loadAlg->execute();
if (loadQuiet) {
inputWS = loadAlg->getProperty("OutputWorkspace");
} else {
inputWS = AnalysisDataService::Instance().retrieve(outputWSName);
}
} else
throw std::runtime_error(
"DataProcessorAlgorithm::load could process any data");
}
return inputWS;
}