Commit c5d7be24 authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed two bugs in MixinBase

parent cbbe1fbb
...@@ -42,7 +42,11 @@ class MixinBase(object): ...@@ -42,7 +42,11 @@ class MixinBase(object):
ensemble_space = magnetic_field.domain[0] ensemble_space = magnetic_field.domain[0]
for component in component_names: for component in component_names:
# It is important to initialize the Observables with an explicit
# value. Otherwise the d2o will not instantaneuosly be created
# (c.f. lazy object creation).
observable_dict[component] = Observable( observable_dict[component] = Observable(
val=0,
domain=(ensemble_space, self.__hpSpace), domain=(ensemble_space, self.__hpSpace),
distribution_strategy='equal') distribution_strategy='equal')
...@@ -108,8 +112,8 @@ class MixinBase(object): ...@@ -108,8 +112,8 @@ class MixinBase(object):
else: else:
mean_list = [] mean_list = []
for component in component_names: for component in component_names:
mean_list += np.empty(dummy_obs_field.domain[1].shape, mean_list += [np.empty(dummy_obs_field.domain[1].shape,
dtype=np.float64) dtype=np.float64)]
for i, component in enumerate(component_names): for i, component in enumerate(component_names):
comm.Bcast([mean_list[i], MPI.DOUBLE], root=size-1) comm.Bcast([mean_list[i], MPI.DOUBLE], root=size-1)
......
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