Browse Source

changed sylvan behaviour to take auto-detected number of threads if no thread count was set

tempestpy_adaptions
dehnert 8 years ago
parent
commit
208938b0a1
  1. 6
      src/storm/settings/modules/SylvanSettings.cpp
  2. 5
      src/storm/settings/modules/SylvanSettings.h
  3. 8
      src/storm/storage/dd/sylvan/InternalSylvanDdManager.cpp

6
src/storm/settings/modules/SylvanSettings.cpp

@ -17,12 +17,16 @@ namespace storm {
SylvanSettings::SylvanSettings() : ModuleSettings(moduleName) {
this->addOption(storm::settings::OptionBuilder(moduleName, maximalMemoryOptionName, true, "Sets the upper bound of memory available to Sylvan in MB.").addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("value", "The memory available to Sylvan.").setDefaultValueUnsignedInteger(4096).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, threadCountOptionName, true, "Sets the number of threads used by Sylvan.").addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("value", "The number of threads available to Sylvan (0 means 'auto-detect').").setDefaultValueUnsignedInteger(1).build()).build());
this->addOption(storm::settings::OptionBuilder(moduleName, threadCountOptionName, true, "Sets the number of threads used by Sylvan.").addArgument(storm::settings::ArgumentBuilder::createUnsignedIntegerArgument("value", "The number of threads available to Sylvan (0 means 'auto-detect').").build()).build());
}
uint_fast64_t SylvanSettings::getMaximalMemory() const {
return this->getOption(maximalMemoryOptionName).getArgumentByName("value").getValueAsUnsignedInteger();
}
bool SylvanSettings::isNumberOfThreadsSet() const {
return this->getOption(threadCountOptionName).getArgumentByName("value").getHasBeenSet();
}
uint_fast64_t SylvanSettings::getNumberOfThreads() const {
return this->getOption(threadCountOptionName).getArgumentByName("value").getValueAsUnsignedInteger();

5
src/storm/settings/modules/SylvanSettings.h

@ -32,6 +32,11 @@ namespace storm {
*/
uint_fast64_t getNumberOfThreads() const;
/*!
* Retrieves whether the number of threads to use was set.
*/
bool isNumberOfThreadsSet() const;
// The name of the module.
static const std::string moduleName;

8
src/storm/storage/dd/sylvan/InternalSylvanDdManager.cpp

@ -33,8 +33,12 @@ namespace storm {
InternalDdManager<DdType::Sylvan>::InternalDdManager() {
if (numberOfInstances == 0) {
// Initialize lace: auto-detect number of workers.
lace_init(storm::settings::getModule<storm::settings::modules::SylvanSettings>().getNumberOfThreads(), 1000000);
storm::settings::modules::SylvanSettings const& settings = storm::settings::getModule<storm::settings::modules::SylvanSettings>();
if (settings.isNumberOfThreadsSet()) {
lace_init(settings.getNumberOfThreads(), 1000000);
} else {
lace_init(0, 1000000);
}
lace_startup(0, 0, 0);
// Each node takes 24 bytes and the maximal memory is specified in megabytes.

Loading…
Cancel
Save