There is a maintenance of MPCDF Gitlab on Thursday, April 22st 2020, 9:00 am CEST - Expect some service interruptions during this time

Commit ad5ddd5c authored by theos's avatar theos

Mode Field._parse_distribution_strategy more robust.

parent 1bc3f502
......@@ -6,7 +6,6 @@ from d2o import distributed_data_object,\
from nifty.config import about,\
nifty_configuration as gc,\
dependency_injector as gdi
from nifty.field_types import FieldType
......@@ -17,10 +16,6 @@ import nifty.nifty_utilities as utilities
from nifty.random import Random
POINT_DISTRIBUTION_STRATEGIES = DISTRIBUTION_STRATEGIES['global']
COMM = getattr(gdi[gc['mpi_module']], gc['default_comm'])
class Field(object):
# ---Initialization methods---
......@@ -121,9 +116,10 @@ class Field(object):
else:
about.warnings.cprint("WARNING: Datamodel set to default!")
distribution_strategy = gc['default_distribution_strategy']
elif distribution_strategy not in DISTRIBUTION_STRATEGIES['all']:
elif distribution_strategy not in DISTRIBUTION_STRATEGIES['global']:
raise ValueError(about._errors.cstring(
"ERROR: Invalid distribution_strategy!"))
"ERROR: distribution_strategy must be a global-type "
"strategy."))
return distribution_strategy
# ---Factory methods---
......
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