Commit ccfc3df1 authored by theos's avatar theos

Made the registration of d2o's variables robust against pre-initialization of...

Made the registration of d2o's variables robust against pre-initialization of the configuration object.
parent 2e1a1b7a
Pipeline #3787 skipped
......@@ -2,6 +2,7 @@
from __future__ import division
from config import configuration
from distributed_data_object import distributed_data_object
from d2o_librarian import d2o_librarian
......
......@@ -29,8 +29,21 @@ variable_mpi_init_checks = keepers.Variable('mpi_init_checks',
genus='boolean')
# Construct the configuration object
configuration = keepers.get_Configuration(
'D2O',
[variable_mpi_module,
variable_default_distribution_strategy,
variable_mpi_init_checks])
\ No newline at end of file
configuration = keepers.get_Configuration('D2O')
[configuration.register(vari) for vari in
[variable_mpi_module,
variable_default_distribution_strategy,
variable_mpi_init_checks]]
# register the default comm variable as the 'mpi_module' variable is now
# available
variable_default_comm = keepers.Variable(
'default_comm',
['COMM_WORLD'],
lambda z: hasattr(dependency_injector[
configuration['mpi_module']], z))
configuration.register(variable_default_comm)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment