void CurrentAnalysis_Impl::stop(analysis::DataPoint& dataPoint, runmanager::RunManager& runManager) { OptionalDataPoint exactDataPoint = analysis().getDataPointByUUID(dataPoint); if (exactDataPoint) { // get all jobs to cancel including child jobs std::vector<runmanager::Job> jobs; auto it = std::find_if(m_queuedOSDataPoints.begin(), m_queuedOSDataPoints.end(), std::bind(dataPointsEqual,std::placeholders::_1,*exactDataPoint)); if (it != m_queuedOSDataPoints.end()) { boost::optional<runmanager::Job> job = it->topLevelJob(); if (job){ recursivelyAddJobAndChildren(jobs, *job); } m_queuedOSDataPoints.erase(it); } it = std::find_if(m_queuedDakotaDataPoints.begin(), m_queuedDakotaDataPoints.end(), std::bind(dataPointsEqual,std::placeholders::_1,*exactDataPoint)); if (it != m_queuedDakotaDataPoints.end()) { boost::optional<runmanager::Job> job = it->topLevelJob(); if (job){ recursivelyAddJobAndChildren(jobs, *job); } m_queuedDakotaDataPoints.erase(it); } cancelAllJobs(jobs); } }
void CurrentAnalysis_Impl::stop(runmanager::RunManager& runManager) { // get all jobs in the queued analysis, including child jobs analysis::DataPointVector queuedOSDataPoints = m_queuedOSDataPoints; std::vector<runmanager::Job> jobs; for (const analysis::DataPoint& queuedOSDataPoint : queuedOSDataPoints) { boost::optional<runmanager::Job> job = queuedOSDataPoint.topLevelJob(); if (job){ recursivelyAddJobAndChildren(jobs, *job); } } m_queuedOSDataPoints.clear(); analysis::DataPointVector queuedDakotaDataPoints = m_queuedDakotaDataPoints; for (const analysis::DataPoint& queuedDakotaDataPoint : queuedDakotaDataPoints) { boost::optional<runmanager::Job> job = queuedDakotaDataPoint.topLevelJob(); if (job){ recursivelyAddJobAndChildren(jobs, *job); } } m_queuedDakotaDataPoints.clear(); cancelAllJobs(jobs); if (m_dakotaJob) { // DLM: does this job have children that need to be canceled too? runmanager::Job dakotaJob = runManager.getJob(*m_dakotaJob); dakotaJob.setCanceled(true); dakotaJob.requestStop(); dakotaJob.waitForFinished(); m_dakotaJobErrors = dakotaJob.errors(); m_dakotaJob.reset(); } }
void CurrentAnalysis_Impl::stopQueuedDakotaJobs(runmanager::RunManager& runManager) { // get all jobs in the queued analysis, including child jobs std::vector<runmanager::Job> jobs; auto it = m_queuedDakotaDataPoints.begin(); while (it != m_queuedDakotaDataPoints.end()) { boost::optional<runmanager::Job> job = it->topLevelJob(); if (job){ recursivelyAddJobAndChildren(jobs, *job); } it = m_queuedDakotaDataPoints.erase(it); } cancelAllJobs(jobs); }
void PodcastService::clear() { cancelAllJobs(); ::OnlineService::clear(); }