Browse Source

option for print timings

Former-commit-id: 845ce83bda
tempestpy_adaptions
sjunges 9 years ago
parent
commit
fa9e33da59
  1. 8
      src/settings/modules/GeneralSettings.cpp
  2. 9
      src/settings/modules/GeneralSettings.h
  3. 4
      src/storm.cpp

8
src/settings/modules/GeneralSettings.cpp

@ -19,6 +19,8 @@ namespace storm {
const std::string GeneralSettings::moduleName = "general";
const std::string GeneralSettings::helpOptionName = "help";
const std::string GeneralSettings::helpOptionShortName = "h";
const std::string GeneralSettings::printTimingsOptionName = "printTime";
const std::string GeneralSettings::printTimingsOptionShortName = "pt";
const std::string GeneralSettings::versionOptionName = "version";
const std::string GeneralSettings::verboseOptionName = "verbose";
const std::string GeneralSettings::verboseOptionShortName = "v";
@ -41,6 +43,7 @@ namespace storm {
this->addOption(storm::settings::OptionBuilder(moduleName, helpOptionName, false, "Shows all available options, arguments and descriptions.").setShortName(helpOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createStringArgument("hint", "A regular expression to show help for all matching entities or 'all' for the complete help.").setDefaultValueString("all").build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, versionOptionName, false, "Prints the version information.").build());
this->addOption(storm::settings::OptionBuilder(moduleName, printTimingsOptionName, false, "Prints the timing at the end").setShortName(printTimingsOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName, verboseOptionName, false, "Enables more verbose output.").setShortName(verboseOptionShortName).build());
this->addOption(storm::settings::OptionBuilder(moduleName, precisionOptionName, false, "The internally used precision.").setShortName(precisionOptionShortName)
.addArgument(storm::settings::ArgumentBuilder::createDoubleArgument("value", "The precision to use.").setDefaultValueDouble(1e-06).addValidationFunctionDouble(storm::settings::ArgumentValidators::doubleRangeValidatorExcluding(0.0, 1.0)).build()).build());
@ -113,7 +116,10 @@ namespace storm {
bool GeneralSettings::isParametricRegionSet() const {
return this->getOption(parametricRegionOptionName).getHasOptionBeenSet();
}
bool GeneralSettings::isPrintTimingsSet() const {
return this->getOption(printTimingsOptionName).getHasOptionBeenSet();
}
bool GeneralSettings::isExactSet() const {
return this->getOption(exactOptionName).getHasOptionBeenSet();

9
src/settings/modules/GeneralSettings.h

@ -127,6 +127,13 @@ namespace storm {
* @return True iff an equation solving technique has been set.
*/
bool isMinMaxEquationSolvingTechniqueSet() const;
/*!
* Retrieves whether timings should be printed after running
*
* @return True iff the option was set.
*/
bool isPrintTimingsSet() const;
/*!
@ -146,6 +153,8 @@ namespace storm {
// Define the string names of the options as constants.
static const std::string helpOptionName;
static const std::string helpOptionShortName;
static const std::string printTimingsOptionName;
static const std::string printTimingsOptionShortName;
static const std::string versionOptionName;
static const std::string verboseOptionName;
static const std::string verboseOptionShortName;

4
src/storm.cpp

@ -30,7 +30,9 @@ int main(const int argc, const char** argv) {
auto endtime = std::chrono::high_resolution_clock::now();
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(endtime-starttime);
auto durationSec = std::chrono::duration_cast<std::chrono::seconds>(endtime-starttime);
std::cout << "OVERALL RUNTIME: " << duration.count() << " ms. ( approx " << durationSec.count() << " seconds)." << std::endl;
if(storm::settings::getModule<storm::settings::modules::IOSettings>().isPrintTimingsSet()) {
std::cout << "Overal runtime: " << duration.count() << " ms. ( approx " << durationSec.count() << " seconds)." << std::endl;
}
return 0;
} catch (storm::exceptions::BaseException const& exception) {
STORM_LOG_ERROR("An exception caused Storm to terminate. The message of the exception is: " << exception.what());

Loading…
Cancel
Save