From 1a4bc33e5b2b8692c426414bdbc758bb73c1e7a2 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Tue, 10 Oct 2017 11:14:04 +0200 Subject: [PATCH] Fixed setting of debug settings in storm-dft-cli --- src/storm-dft-cli/storm-dyftee.cpp | 63 ++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/src/storm-dft-cli/storm-dyftee.cpp b/src/storm-dft-cli/storm-dyftee.cpp index 8eef6f0b5..001adabf4 100644 --- a/src/storm-dft-cli/storm-dyftee.cpp +++ b/src/storm-dft-cli/storm-dyftee.cpp @@ -28,6 +28,7 @@ #include "storm-gspn/storm-gspn.h" #include "storm/settings/modules/GSPNSettings.h" #include "storm/settings/modules/GSPNExportSettings.h" +#include "storm-cli-utilities/cli.cpp" #include @@ -125,23 +126,12 @@ void initializeSettings() { storm::settings::addModule(); } -/*! - * Entry point for the DyFTeE backend. - * - * @param argc The argc argument of main(). - * @param argv The argv argument of main(). - * @return Return code, 0 if successfull, not 0 otherwise. - */ -int main(const int argc, const char** argv) { - try { - storm::utility::setUp(); - storm::cli::printHeader("Storm-DyFTeE", argc, argv); - initializeSettings(); - - bool optionsCorrect = storm::cli::parseOptions(argc, argv); - if (!optionsCorrect) { - return -1; - } + +void processOptions() { + // Start by setting some urgent options (log levels, resources, etc.) + storm::cli::setUrgentOptions(); + + storm::cli::processOptions(); storm::settings::modules::DFTSettings const& dftSettings = storm::settings::getModule(); storm::settings::modules::GeneralSettings const& generalSettings = storm::settings::getModule(); @@ -157,7 +147,7 @@ int main(const int argc, const char** argv) { // Export to json storm::storage::DftJsonExporter::toFile(dft, dftSettings.getExportJsonFilename()); storm::utility::cleanUp(); - return 0; + return; } @@ -199,7 +189,7 @@ int main(const int argc, const char** argv) { delete model; delete gspn; storm::utility::cleanUp(); - return 0; + return; } bool parametric = false; @@ -216,7 +206,7 @@ int main(const int argc, const char** argv) { analyzeWithSMT(dftSettings.getDftFilename()); } storm::utility::cleanUp(); - return 0; + return; } #endif @@ -272,7 +262,38 @@ int main(const int argc, const char** argv) { } else { analyzeDFT(properties, dftSettings.useSymmetryReduction(), dftSettings.useModularisation(), !dftSettings.isDisableDC(), approximationError); } - +} + +/*! + * Entry point for the DyFTeE backend. + * + * @param argc The argc argument of main(). + * @param argv The argv argument of main(). + * @return Return code, 0 if successfull, not 0 otherwise. + */ +/*! + * Main entry point of the executable storm-pars. + */ +int main(const int argc, const char** argv) { + try { + storm::utility::setUp(); + storm::cli::printHeader("Storm-DyFTeE", argc, argv); + //storm::settings::initializeParsSettings("Storm-pars", "storm-pars"); + initializeSettings(); + + storm::utility::Stopwatch totalTimer(true); + if (!storm::cli::parseOptions(argc, argv)) { + return -1; + } + + processOptions(); + //storm::pars::processOptions(); + + totalTimer.stop(); + if (storm::settings::getModule().isPrintTimeAndMemorySet()) { + storm::cli::printTimeAndMemoryStatistics(totalTimer.getTimeInMilliseconds()); + } + // All operations have now been performed, so we clean up everything and terminate. storm::utility::cleanUp(); return 0;