Skip to content
Snippets Groups Projects
Commit 8c447534 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Extended queue settings to host environment settings

* Renamed 'queue_settings' to 'environment'
* Changed to allow overriding environment by command line settings
* Added file system layout for blizzard and thunder to environment
* Fixed partition name for thunder
parent 54081ed8
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ class ExpConfig(ConfigObj):
#
exp_lib_dir = 'standard_experiments'
queue_lib_dir = 'standard_queue_settings'
env_lib_dir = 'standard_environments'
default_name = 'DEFAULT'
# Class constructor
......@@ -58,6 +58,14 @@ class ExpConfig(ConfigObj):
pre_config = ConfigObj(experiment_config_name, interpolation=False)
experiment_type = extra_dict.get('EXP_TYPE', pre_config['EXP_TYPE'])
environment = extra_dict.get('ENVIRONMENT',
pre_config.get('ENVIRONMENT',
'local'))
# Backwards compatibility
if environment == 'local' and 'QUEUE_TYPE' in pre_config:
feedback.warning("found obsolete keyword 'QUEUE_TYPE'; "
"should be replaced by 'ENVIRONMENT'")
environment = pre_config['QUEUE_TYPE']
pre_config = None
......@@ -68,7 +76,7 @@ class ExpConfig(ConfigObj):
# Read Environment
pre_config.merge({'DEFAULT': dict(os.environ)})
# Read settings from library (general default and experiment type specific)
# Read experiment settings from library (default and type specific)
lib_config_name = os.path.join(ExpConfig.exp_lib_dir,
ExpConfig.default_name+'.config')
......@@ -88,30 +96,33 @@ class ExpConfig(ConfigObj):
feedback.warning("cannot find config for '%s', using default only",
experiment_type)
# Read host environment settings from library
lib_config_name = os.path.join(ExpConfig.env_lib_dir,
environment+'.config')
pre_config.merge(ConfigObj(lib_config_name, interpolation=False))
config_versions.append(pre_config['VERSION_'])
del pre_config['VERSION_']
# Re-read config to allow overriding default settings
# TODO: probably nicer if default experiment is given as argument
experiment_config = ConfigObj(experiment_config_name, interpolation=False)
experiment_config = ConfigObj(experiment_config_name,
interpolation=False)
pre_config.merge(experiment_config)
split_jobs(pre_config)
# Add extra dictionary
pre_config.merge(extra_dict)
# Read queue settings from library
queue_type = pre_config.get('QUEUE_TYPE', 'immediate')
lib_config_name = os.path.join(ExpConfig.queue_lib_dir,
queue_type+'.config')
pre_config.merge(ConfigObj(lib_config_name, interpolation=False))
config_versions.append(pre_config['VERSION_'])
del pre_config['VERSION_']
if not 'ENVIRONMENT' in pre_config:
pre_config['ENVIRONMENT'] = environment
# Add complete versioning info
pre_config['VERSIONS_'] = ', '.join(config_versions)
# Re-read merged config with interpolation set
# This works around incomprehensible inheritance of interpolation with merge
# Then make sure that all values are interpolated
# Re-read merged config with interpolation set.
# This works around incomprehensible inheritance of interpolation with
# merge. Make sure that all values are interpolated
config_lines = StringIO.StringIO()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment