File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 33
44import numpy as np
55import openmdao .api as om
6+ from mpi4py import MPI
67
78
89class Server :
@@ -427,13 +428,26 @@ def _gather_inputs_and_outputs_from_om_problem(self):
427428 def _set_design_variables_into_the_server_problem (self , input_dict ):
428429 design_changed = False
429430 for key in input_dict ["design_vars" ].keys ():
430- if (
431- self .prob .get_val (key , get_remote = True )
432- != input_dict ["design_vars" ][key ]["val" ]
433- ).any ():
431+ try :
432+ if (
433+ self .prob .get_val (key , get_remote = True )
434+ != input_dict ["design_vars" ][key ]["val" ]
435+ ).any ():
436+ design_changed = True
437+ except Exception as e :
438+ print (
439+ f"SERVER: Unable to get val of { key } due to the following error:" ,
440+ flush = True ,
441+ )
442+ print (e , flush = True )
443+ print (
444+ "This can occur with certain versions of OpenMDAO upon server restart, typically due to "
445+ + "IVCs/DVs defined within parallel groups. Assuming design has changed..." ,
446+ flush = True ,
447+ )
434448 design_changed = True
435449 self .prob .set_val (key , input_dict ["design_vars" ][key ]["val" ])
436- return design_changed
450+ return self . comm . allreduce ( design_changed , op = MPI . LOR )
437451
438452 def _set_additional_inputs_into_the_server_problem (
439453 self , input_dict , design_changed
You can’t perform that action at this time.
0 commit comments