diff --git a/src/storm/solver/TopologicalLinearEquationSolver.cpp b/src/storm/solver/TopologicalLinearEquationSolver.cpp index 4a797fc53..ba1a6e2db 100644 --- a/src/storm/solver/TopologicalLinearEquationSolver.cpp +++ b/src/storm/solver/TopologicalLinearEquationSolver.cpp @@ -7,6 +7,7 @@ #include "storm/exceptions/InvalidStateException.h" #include "storm/exceptions/InvalidEnvironmentException.h" #include "storm/exceptions/UnexpectedException.h" +#include "storm/utility/SignalHandler.h" namespace storm { namespace solver { @@ -79,6 +80,7 @@ namespace storm { returnValue = solveFullyConnectedEquationSystem(sccSolverEnvironment, x, b); } else { storm::storage::BitVector sccAsBitVector(x.size(), false); + uint64_t sccIndex = 0; for (auto const& scc : *this->sortedSccDecomposition) { if (scc.size() == 1) { returnValue = solveTrivialScc(*scc.begin(), x, b) && returnValue; @@ -89,6 +91,11 @@ namespace storm { } returnValue = solveScc(sccSolverEnvironment, sccAsBitVector, x, b) && returnValue; } + ++sccIndex; + if (storm::utility::resources::isTerminate()) { + STORM_LOG_WARN("Topological solver aborted after analyzing " << sccIndex << "/" << this->sortedSccDecomposition->size() << " SCCs."); + break; + } } } diff --git a/src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp b/src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp index 32f18ca0a..e22b53985 100644 --- a/src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp +++ b/src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp @@ -9,6 +9,7 @@ #include "storm/exceptions/InvalidEnvironmentException.h" #include "storm/exceptions/UnexpectedException.h" #include "storm/exceptions/UncheckedRequirementException.h" +#include "storm/utility/SignalHandler.h" namespace storm { namespace solver { @@ -77,6 +78,7 @@ namespace storm { } storm::storage::BitVector sccRowGroupsAsBitVector(x.size(), false); storm::storage::BitVector sccRowsAsBitVector(b.size(), false); + uint64_t sccIndex = 0; for (auto const& scc : *this->sortedSccDecomposition) { if (scc.size() == 1) { returnValue = solveTrivialScc(*scc.begin(), dir, x, b) && returnValue; @@ -92,6 +94,11 @@ namespace storm { } returnValue = solveScc(sccSolverEnvironment, dir, sccRowGroupsAsBitVector, sccRowsAsBitVector, x, b) && returnValue; } + ++sccIndex; + if (storm::utility::resources::isTerminate()) { + STORM_LOG_WARN("Topological solver aborted after analyzing " << sccIndex << "/" << this->sortedSccDecomposition->size() << " SCCs."); + break; + } } // If requested, we store the scheduler for retrieval.