From ea4b772a89c8de27ddcd5b49c3cd9330cf59c01f Mon Sep 17 00:00:00 2001 From: Evan Gaertner Date: Tue, 21 May 2019 15:13:09 -0600 Subject: [PATCH] patch for using split communicators with pyoptsparse driver --- openmdao/drivers/pyoptsparse_driver.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openmdao/drivers/pyoptsparse_driver.py b/openmdao/drivers/pyoptsparse_driver.py index 73b4c67a0..f82c68d93 100644 --- a/openmdao/drivers/pyoptsparse_driver.py +++ b/openmdao/drivers/pyoptsparse_driver.py @@ -76,7 +76,7 @@ class pyOptSparseDriver(Driver): Title of this optimization run """ - def __init__(self): + def __init__(self, comm=None): """Initialize pyopt""" super(pyOptSparseDriver, self).__init__() @@ -124,6 +124,8 @@ def __init__(self): self.sub_sparsity = OrderedDict() self.active_tols = {} + self.comm = comm + def _setup(self): self.supports['gradients'] = self.options['optimizer'] in grad_drivers if len(self._objs) > 1 and self.options['optimizer'] not in multi_obj_drivers: @@ -157,7 +159,7 @@ def run(self, problem): with problem.root._dircontext: problem.root.solve_nonlinear(metadata=self.metadata) - opt_prob = Optimization(self.options['title'], self._objfunc) + opt_prob = Optimization(self.options['title'], self._objfunc, comm=self.comm) # Add all parameters param_meta = self.get_desvar_metadata()